Commit Graph

703 Commits

Author SHA1 Message Date
Niels Dossche
42575ac966 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-12974: Apache crashes on shutdown when using pg_pconnect()
2023-12-27 20:16:32 +01:00
Niels Dossche
77ac1e8592 Fix GH-12974: Apache crashes on shutdown when using pg_pconnect()
On ZTS, the global variables are stored in dynamically allocated memory.
When the module gets shut down this memory is released. After the module
is shut down, only then are the persistent resources cleared. Normally
this isn't an issue, but pgsql and odbc refer to the globals to modify
some counters, after the globals have been freed.
Fix this by guarding the modification.

Closes GH-13032.
2023-12-27 20:14:23 +01:00
David Carlier
0c8e45e71f Merge branch 'PHP-8.2' into PHP-8.3 2023-12-23 17:15:06 +00:00
David Carlier
d98a45d08c ext/pgsql: pgsql.allow_persistent, no need to use such large type for boolean state.
also ext/odbc, simplifying odd comparison with non persistent connections.

Close GH-12976
2023-12-23 17:14:48 +00:00
Ilija Tovilo
5ed58386d1
[skip ci] Skip leaking odbc test on asan 2023-09-08 11:05:34 +02:00
George Peter Banyard
e2667f17bc Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  ODBC unit tests shouldn't override odbc.ini location
  Fix persistent procedural ODBC connections not getting closed
2023-09-06 01:58:11 +01:00
George Peter Banyard
88ed678935 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  ODBC unit tests shouldn't override odbc.ini location
  Fix persistent procedural ODBC connections not getting closed
2023-09-06 01:57:28 +01:00
Calvin Buckley
a648d39297 ODBC unit tests shouldn't override odbc.ini location
`ext/odbc/tests/config.inc` overrides the INIs used for the ODBC driver
manager pointlessly. It's not pointing to some custom PHP test suite
specific one, but the system one in `/etc/odbc(inst).ini`. Which
doesn't necessarily exist, on i.e. NixOS, MacPorts, etc.

Closes GH-12133

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-09-06 01:56:04 +01:00
Calvin Buckley
5a2b251610 Fix persistent procedural ODBC connections not getting closed
Like oci8, procedural ODBC uses an apply function on the hash list to
enumerate persistent connections and close the specific one. However,
this function take zvals, not resources. However, it was getting casted
as such, causing it to interpret the pointer incorrectly. This could
have caused other issues, but mostly manifested as failing to close the
connection even fi it matched.

The function now takes a zval and gets the resource from that. In
addition, it also removes the cast of the function pointer and moves
casting to the function body, to avoid possible confusion like this in
refactors again. It also cleans up style and uses constants in the
function body.

Closes GH-12132

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-09-06 01:55:02 +01:00
George Peter Banyard
508e70ac3c Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix memory leak with failed SQLPrepare
2023-09-02 23:03:04 +01:00
George Peter Banyard
30b550bad5 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix memory leak with failed SQLPrepare
2023-09-02 23:01:08 +01:00
Calvin Buckley
a022ec53bd Fix memory leak with failed SQLPrepare
Closes GH-12095

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-09-02 23:00:06 +01:00
Ilija Tovilo
d1a38e8b8e
Fix variable resource ids in odbc test
Ids may vary when using persistent resources. We're not actually interested in
the exact ids anyway.
2023-08-29 12:05:24 +02:00
Máté Kocsis
2f9f2928ce
Improve test for odbc_columns()
Hopefully, intermittent test failures will be fixed by creating and using a separate database.

Furthermore, more meaningful test cases are added which also assert the output, as well as wildcard character based searching.
2023-08-29 00:26:25 +02:00
Máté Kocsis
9dcdfa5e3f
Use correct format specifier 2023-08-29 00:26:24 +02:00
Máté Kocsis
8726ae0601 Improve and fix ext/odbc tests
Some test failures are fixed, parallelization is enabled, section order is fixed.
2023-08-23 21:20:41 +02:00
Máté Kocsis
66acaba9db Add more test coverage for ext/odbc 2023-08-23 21:20:41 +02:00
Máté Kocsis
038b2ae254
Make the $enable parameter of odbc_autocommit() nullable (#11909)
Co-authored-by: George Peter Banyard <girgias@php.net>
2023-08-08 15:31:58 +02:00
Máté Kocsis
b275e13af7
Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix return type of odbc_data_source()
2023-08-08 08:55:36 +02:00
Máté Kocsis
43e62aa21f
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix return type of odbc_data_source()
2023-08-08 08:54:41 +02:00
Máté Kocsis
77252afaf0
Fix return type of odbc_data_source() 2023-08-08 08:52:41 +02:00
George Peter Banyard
163c0b5f4c Merge branch 'PHP-8.2' 2022-09-06 10:42:34 +01:00
George Peter Banyard
5011a185b5 Update globals to use bool type 2022-09-06 10:34:10 +01:00
George Peter Banyard
1ad59b32c2 Update INI validator and displayers depending on INI type
Closes GH-9451
2022-09-06 10:33:34 +01:00
Tim Düsterhus
03fd405423
Use php_info_print_table_header for actual column headers only (#9485)
Using php_info_print_table_header() for "Foo: bar" looks odd and out of place,
because the whole line is colored. It is also questionable from a HTML
semantics point of view, because it does not described the columns that follow.

The use of this across extensions is inconsistent. It was part of the skeleton,
but ext/date or ext/json already use a regular row.
2022-09-06 08:48:22 +02:00
Máté Kocsis
e733ebf30e
Add parenthesis around preprocessor conditions in stubs
gen_stub.php concatenates nested #ifs into one #if so let's make sure the semantics remain the same.
2022-09-02 16:21:28 +02:00
Calvin Buckley
f3a14d1b1a
Fix GH-9347: Current ODBC liveness checks may be inadequate
We implement SQL_ATTR_CONNECTION_DEAD for ODBC and PDO_ODBC.

This is semantically appropriate and should be used whenever the
driver supports it. In the event that it fails or says the connection
isn't dead (which may be inaccurate in some cases), try the old
heuristic.

Closes GH-9353.
2022-08-29 18:32:31 +02:00
Máté Kocsis
b4ec3e9bc0
Do not generate CONST_CS when registering constants (#9439) 2022-08-28 08:27:19 +02:00
Nikita Popov
ba9debb544 Fix parentheses warnings 2022-07-28 21:09:18 +02:00
Máté Kocsis
236fd4ced2
Declare ext/odbc constants in stubs (#9045) 2022-07-20 11:49:22 +02:00
Remi Collet
55a88f36b6
add SensitiveParameter as known string and use it in arginfo 2022-07-18 11:43:33 +02:00
Tim Düsterhus
342e18f105
Support the actual #[\SensitiveParameter] attribute in stubs (#8836) 2022-07-12 12:43:44 +02:00
Pierrick Charron
6fd2b39397
Indent with TAB in .h files generated by gen_stub 2022-06-13 08:55:54 -04:00
Christoph M. Becker
e7f6acd068
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix handling of single-key connection strings
2022-06-13 14:44:49 +02:00
Christoph M. Becker
4b8bbfb6db
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix handling of single-key connection strings
2022-06-13 14:43:51 +02:00
Calvin Buckley
445d9502bf
Fix handling of single-key connection strings
A connection string may contain just a single key, but
PHP used ";" as the heuristic to detect if a string was a connection
string versus plain DSN. However, a single-key connection string
would get treated like a DSN name, i.e. "DSN=*LOCAL". This makes it
so that "=" is used, as a connection string must contain a key.

Closes GH-8748.
2022-06-13 14:41:50 +02:00
Tim Düsterhus
e85b17b934 Mark parameter in ext/odbc as sensitive 2022-06-13 11:09:12 +02:00
Calvin Buckley
2920a26636
Quote when adding to connection string in (PDO_)ODBC
Because the UID= and PWD= values are appended to the SQLDriverConnect
case when credentials are passed, we have to append them to the string
in case users are relying on this behaviour. However, they must be
quoted, or the arguments will be invalid (or possibly more injected).
This means users had to quote arguments or append credentials to the raw
connection string themselves.

It seems that ODBC quoting rules are consistent enough (and that
Microsoft trusts them enough to encode into the .NET BCL) that we can
actually check if the string is already quoted (in case a user is
already quoting because of this not being fixed), and if not, apply the
appropriate ODBC quoting rules.

This is because the code exists in main/, and are shared between
both ODBC extensions, so it doesn't make sense for it to only exist
in one or the other. There may be a better spot for it.

Closes GH-8307.
2022-05-27 16:56:44 +02:00
Christoph M. Becker
c6bb747115
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix ODBC test which may not properly clean up
2022-01-07 19:26:01 +01:00
Christoph M. Becker
0a9f552911
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix ODBC test which may not properly clean up
2022-01-07 19:25:23 +01:00
Christoph M. Becker
9781085782
Fix ODBC test which may not properly clean up
If these tests fail with a fatal error, they won't properly clean up,
which likely causes other tests to fail as (several ODBC tests use the
`odbcTEST` database and tables or stored procedures named `FOO`).  This
is particularly annoying during development, where you would need to
clean up manually.

We fix this by moving the cleanup code to the --CLEAN-- section, so
that this code is executed no matter what.

Closes GH-7886.
2022-01-07 19:23:57 +01:00
Máté Kocsis
a1a8e9032c
Remove unnecessary PHP_FUNCTION() declarations (#7472) 2021-09-07 10:04:00 +02:00
Nikita Popov
1c07b11b1c Deprecate odbc_result_all()
Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 16:46:08 +02:00
Patrick Allaert
aff365871a Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
Nikita Popov
b5a14e6c04 Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
Nikita Popov
7485978339
Migrate SKIPIF -> EXTENSIONS (#7138)
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Nikita Popov
bd2c743f1d Merge branch 'PHP-8.0'
* PHP-8.0:
  Remove incorrect format argument
2021-04-27 22:23:22 +02:00
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