Commit Graph

649 Commits

Author SHA1 Message Date
Nikita Popov
9ce5776922 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Remove incorrect format argument
2021-04-27 22:23:06 +02:00
Nikita Popov
3f71ba2611 Remove incorrect format argument
rc is not used by the printf format.
2021-04-27 22:22:32 +02:00
Christoph M. Becker
4c80e439a8
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80460: ODBC doesn't account for SQL_NO_TOTAL indicator
2021-04-27 17:12:01 +02:00
Christoph M. Becker
7f83976200
Fix #80460: ODBC doesn't account for SQL_NO_TOTAL indicator
The `StrLen_or_IndPtr` parameter usually may be `SQL_NO_TOTAL`; we need
to cater to that possibility to avoid working with negative string
lengths and other issues.  A noteable exemption are calls to
`SQLGetData()` which return `SQL_SUCCESS`; in that case `SQL_NO_TOTAL`
can not occur.

Closes GH-6809.
2021-04-27 17:09:36 +02:00
Christoph M. Becker
f674a3343c Fix #80592: all floats are the same in ODBC parameters
We must not release the strings until we are done with them.

Closes GH-6579.
2021-01-06 13:56:02 +01:00
Christoph M. Becker
489b5328c0 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix format specifier
2020-10-29 13:10:32 +01:00
Christoph M. Becker
dd97cb1665 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix format specifier
2020-10-29 13:09:19 +01:00
Christoph M. Becker
ee3227af48 Fix format specifier
In this function, `i` is of type `size_t`.
2020-10-29 13:08:16 +01:00
Christoph M. Becker
9838eff68b Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #44618: Fetching may rely on uninitialized data
2020-10-29 12:03:11 +01:00
Christoph M. Becker
133ac0151b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #44618: Fetching may rely on uninitialized data
2020-10-29 12:00:57 +01:00
Christoph M. Becker
c21e901ba7 Fix #44618: Fetching may rely on uninitialized data
Unless `SQLGetData()` returns `SQL_SUCCESS` or `SQL_SUCCESS_WITH_INFO`,
the `StrLen_or_IndPtr` output argument is not guaranteed to be properly
set.  Thus we handle retrieval failure other than `SQL_ERROR` by
yielding `false` for those column values and raising a warning.

Closes GH-6281.
2020-10-29 11:59:12 +01:00
Christoph M. Becker
8e531b5b00 Update ext/odbc parameter names
Closes GH-6303.
2020-10-13 15:34:12 +02:00
Christoph M. Becker
8d4774a2df Change parameters types from int to bool
These are typical boolean parameters, so we shouldn't advertize them as
integers.  For the `$reverse` parameter that even fixes expectations,
because the `reverse` member is a bitfield of 1 bit, so assigning any
even integer would not set it.

Closes GH-6328.
2020-10-12 23:10:13 +02:00
Christoph M. Becker
3eae7aa77e Don't separate array parameter
Closes GH-6243.
2020-10-05 23:11:36 +02:00
Christoph M. Becker
9fe5479eeb Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #46050: odbc_next_result corrupts prepared resource
2020-10-05 17:48:44 +02:00
Christoph M. Becker
c6e7969f05 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #46050: odbc_next_result corrupts prepared resource
2020-10-05 17:47:35 +02:00
Christoph M. Becker
69ba81d183 Fix #46050: odbc_next_result corrupts prepared resource
When resetting the result's values, we also have to reset its numcols.
2020-10-05 17:46:37 +02:00
Christoph M. Becker
07fa13088e Revert "Use external iterator instead of via the internal pointer"
This reverts commit a6ecafece9.

Closes GH-6242.
2020-09-30 01:23:16 +02:00
Christoph M. Becker
a1ee3c74d1 Fix recently introduced off-by-one error 2020-09-29 18:46:07 +02:00
Nikita Popov
82f0d3c181 Remove unused variable 2020-09-29 12:35:39 +02:00
Christoph M. Becker
a6ecafece9 Use external iterator instead of via the internal pointer 2020-09-29 11:41:17 +02:00
Christoph M. Becker
a0051be42a Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #80152: odbc_execute() moves internal pointer of $params
2020-09-29 11:36:54 +02:00
Christoph M. Becker
b87e43d931 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80152: odbc_execute() moves internal pointer of $params
2020-09-29 11:35:41 +02:00
Christoph M. Becker
bf5f07cc8b Fix #80152: odbc_execute() moves internal pointer of $params
As least intrusive fix, we separate the passed array argument.

Closes GH-6219.
2020-09-29 11:34:48 +02:00
Christoph M. Becker
9f5a77188c Fix #22986: odbc_connect() may reuse persistent connection
`odbc_connect()` should not reuse persistent connections, since that
prohibits multiple concurrent connections, which are occasionally
desireable.  We fix that by no longer looking for already cached
connections when `odbc_connect()` is called, and instead creating a new
connection instead.

Closes GH-6223.
2020-09-29 11:20:41 +02:00
Christoph M. Becker
5f5eba1d7a Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #80150: Failure to fetch error message
2020-09-29 11:05:31 +02:00
Christoph M. Becker
e08f69194c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80150: Failure to fetch error message
2020-09-29 11:04:09 +02:00
Christoph M. Becker
df5efa2fcd Fix #80150: Failure to fetch error message
In case of statement related errors, we need to pass the respective
statement handle to `SQLError()`.

Closes GH-6217.
2020-09-29 11:02:51 +02:00
Christoph M. Becker
3d148804cc Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #80147: BINARY strings may not be properly zero-terminated
2020-09-25 13:53:19 +02:00
Christoph M. Becker
1086e4ec88 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80147: BINARY strings may not be properly zero-terminated
2020-09-25 13:52:08 +02:00
Christoph M. Becker
a49555a9e1 Fix #80147: BINARY strings may not be properly zero-terminated
We have to manually ensure that all strings fetched from a data source
are zero-terminated.

Closes GH-6213.
2020-09-25 13:51:18 +02:00
Christoph M. Becker
439878c8f9 Rename $qualifier/$owner params to $catalog/$schema
These have been called qualifier and owner with ODBC 2, but ODBC 3
changed that to catalog and schema, respectively.

Closes GH-6210.
2020-09-25 13:46:23 +02:00
Máté Kocsis
166178ae6d
Update ext/odbc stub hash 2020-09-25 11:19:50 +02:00
Christoph M. Becker
3277cb6941 Remove outdated link to bug report
That bug has been fixed, so no need to keep that link any longer.
2020-09-24 23:21:50 +02:00
Máté Kocsis
9b50fd2626
Fix UNKNOWN default values in ext/odbc
Closes GH-6154
2020-09-24 22:17:04 +02:00
Christoph M. Becker
553072b0be Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Use proper skipif section
2020-09-24 17:14:22 +02:00
Christoph M. Becker
54cbee526a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Use proper skipif section
2020-09-24 17:13:01 +02:00
Christoph M. Becker
e74f89d95a Use proper skipif section
The ODBC tests have to be skipped if no connection to the server can be
established.
2020-09-24 17:12:18 +02:00
Christoph M. Becker
555e7eccc4 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #78470: odbc_specialcolumns() no longer accepts $nullable
2020-09-24 12:23:37 +02:00
Christoph M. Becker
901d022001 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78470: odbc_specialcolumns() no longer accepts $nullable
2020-09-24 12:16:54 +02:00
Christoph M. Becker
610e7d2c77 Fix #78470: odbc_specialcolumns() no longer accepts $nullable
It is mandatory to pass either `SQL_NO_NULLS` or `SQL_NULLABLE` as
tenth parameter to `SQLSpecialColumns()`; otherwise the function call
fails.  Therefore the user must be allowed to pass the desired value
as parameter to `odbc_specialcolumns()` again.

Closes GH-6200.
2020-09-24 12:15:59 +02:00
Christoph M. Becker
c25b5c64d1 Fix test for cases where data sources are available
That `bool(false)` is a relict of adapting the test expectations to the
warning promotions.
2020-09-24 11:26:16 +02:00
Nikita Popov
c5401854fc Run tidy
This should fix most of the remaining issues with tabs and spaces
being mixed in tests.
2020-09-18 14:28:32 +02:00
Nikita Popov
d4e5b5b6fc Fix compilation warnings in odbc
SQLCHAR* cast all the things.
2020-09-17 12:52:31 +02:00
Máté Kocsis
36fd95b524
Generate arginfos 2020-09-16 21:28:27 +02:00
Máté Kocsis
de912821e0
Display string default values in stubs more uniformly
Settling on using quoted string
2020-09-16 21:27:01 +02:00
George Peter Banyard
c1823c6c8a Promote warning to Error in ODBC extension
Closes GH-6123
2020-09-15 12:50:00 +02:00
Máté Kocsis
3e800e997b
Move custom type checks to ZPP
Closes GH-6034
2020-09-02 11:11:38 +02:00
Máté Kocsis
bdacd2ae8f
Add a few missing types to stubs 2020-08-01 23:55:08 +02:00
Max Semenik
2b5de6f839
Remove proto comments from C files
Closes GH-5758
2020-07-06 21:13:34 +02:00