Skip to content

Migrate ext/odbc resources to opaque objects #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 72 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
f907a00
Align highlight_string|file with HTML standard and modern browsers
kamil-tekiela Aug 11, 2023
bb092ab
Fix #80927: Removing documentElement after creating attribute node: p…
nielsdos Aug 6, 2023
e56ed6e
BCmath extension code reformatting (#11896)
jorgsowa Aug 13, 2023
2196e22
Use zend_ast_size consistenly (#11955)
crrodriguez Aug 13, 2023
ee000ea
Fix uouv on oom on object allocation
iluuu1994 Aug 8, 2023
902d39d
Use per-branch matrix for windows nightly
iluuu1994 Aug 14, 2023
e11b55d
Merge branch 'PHP-8.1' into PHP-8.2
iluuu1994 Aug 14, 2023
7fcfaae
Merge branch 'PHP-8.2'
iluuu1994 Aug 14, 2023
67ab2b7
Align the return type of snmp_set_oid_numeric_print() to its aliased …
kocsismate Aug 14, 2023
17b3af2
GH-11964: In ext/date/php_date.stub.php, DateRangeError extends itself
nielsdos Aug 14, 2023
2012fd3
ci update freebsd image to the 13.2 image (#11110)
devnexen Apr 21, 2023
231a1f8
Merge branch 'PHP-8.1' into PHP-8.2
iluuu1994 Aug 14, 2023
09e63e4
Merge branch 'PHP-8.2'
iluuu1994 Aug 14, 2023
27fb8d1
Fix DateTime exception hierarchy for DateInvalidTimeZoneException (#1…
Ayesh Aug 14, 2023
0b88704
mysqli_field_seek return type changed to true (#11948)
kamil-tekiela Aug 14, 2023
b71c6b2
Fix #81992: SplFixedArray::setSize() causes use-after-free
nielsdos Aug 13, 2023
0b516ae
Merge branch 'PHP-8.1' into PHP-8.2
nielsdos Aug 14, 2023
63a7f22
Merge branch 'PHP-8.2'
nielsdos Aug 14, 2023
02a80c5
Fix various bugs related to DNF types
Girgias Aug 14, 2023
82972f4
Merge branch 'PHP-8.2'
Girgias Aug 15, 2023
d46dc56
Fix various namespace prefix conflict resolution bugs and namespace s…
nielsdos Jul 23, 2023
6e3f93f
PHP-8.1 is now for PHP 8.1.24-dev
patrickallaert Aug 15, 2023
6e8f5e0
Merge branch 'PHP-8.1' into PHP-8.2
patrickallaert Aug 15, 2023
5713bc3
Merge branch 'PHP-8.2'
patrickallaert Aug 15, 2023
32fa673
Update NEWS for PHP 8.3.0beta3
ericmann Aug 15, 2023
4467f33
PHP-8.2 is now for PHP 8.2.11-dev
adoy Aug 15, 2023
baaa37f
Merge branch 'PHP-8.2'
adoy Aug 15, 2023
543eedf
[skip-ci] minor typo fixes in UPGRADING and CONTRIBUTING.md (#11976)
Ayesh Aug 16, 2023
2b61f71
Add test for SimpleXMLElement::asXML() with a fragment and a filename
nielsdos Aug 15, 2023
c1103a9
Fix implicit/explicit port in mysqlnd
kamil-tekiela Mar 24, 2023
06bda99
Merge branch 'PHP-8.1' into PHP-8.2
kamil-tekiela Aug 16, 2023
7e4ca2e
Merge branch 'PHP-8.2'
kamil-tekiela Aug 16, 2023
f78d1d0
Fix segfault in format_default_value due to unexpected enum/object
iluuu1994 Aug 12, 2023
9437aa9
Merge branch 'PHP-8.1' into PHP-8.2
iluuu1994 Aug 17, 2023
48ede64
Merge branch 'PHP-8.2'
iluuu1994 Aug 17, 2023
dd01c74
Remove redundant condition
iluuu1994 Aug 17, 2023
d016c49
Merge branch 'PHP-8.1' into PHP-8.2
iluuu1994 Aug 17, 2023
1b9ff16
Merge branch 'PHP-8.2'
iluuu1994 Aug 17, 2023
ffd398b
Fix failing test on nightly
kamil-tekiela Aug 17, 2023
6d039d2
Merge branch 'PHP-8.1' into PHP-8.2
kamil-tekiela Aug 17, 2023
ee82c94
Merge branch 'PHP-8.2'
kamil-tekiela Aug 17, 2023
4ff93f7
Remove unnecessary invalidation from processing instructions
nielsdos Aug 18, 2023
7f1c3bf
Adds support for DNF types in internal functions and properties (#11…
ju1ius Aug 18, 2023
c180e9b
Remove unused call to Makefile.frag in ext/zip
petk Aug 19, 2023
85661a3
Remove `mysqli.reconnect` from php.ini files (#11836)
jrfnl Jul 30, 2023
b94f9f6
Merge branch 'PHP-8.2'
saundefined Aug 19, 2023
fc8d5c7
ext/iconv: fix build for netbsd.
devnexen Aug 19, 2023
f995c0d
Merge branch 'PHP-8.1' into PHP-8.2
devnexen Aug 19, 2023
0d65f72
Merge branch 'PHP-8.2'
devnexen Aug 19, 2023
20ac42e
Fix memory leak when setting an invalid DOMDocument encoding
nielsdos Aug 19, 2023
767697c
Merge branch 'PHP-8.1' into PHP-8.2
nielsdos Aug 20, 2023
807a05e
Merge branch 'PHP-8.2'
nielsdos Aug 20, 2023
e6627cc
gen_stub: fix regexps with unintentional range due to `-` character p…
Ayesh Aug 20, 2023
278a57f
Add all README.* files to paths-ignore (#12003)
petk Aug 20, 2023
1887f02
Add class constant types to Phar extension (#11826)
Ayesh Aug 21, 2023
9026596
Sync --enable-mysqlnd-compression-support option (#12006)
petk Aug 21, 2023
e199104
Fix passing null to parameter of type string (#12014)
petk Aug 22, 2023
adc4a48
Fix configure phpdbg help output (#12013)
petk Aug 22, 2023
32cdd33
Remove unneeded zend_language_parser.h patch (#11974)
petk Aug 22, 2023
782ffd7
Use a single version of strnlen (#12015)
crrodriguez Aug 22, 2023
bad5298
Make php_cli_server_pdeathsig.phpt SKIPIF more specific
iluuu1994 Aug 22, 2023
ba07a0b
Move installation of oracle instant client in GHA
iluuu1994 Aug 23, 2023
a8e5285
Merge branch 'PHP-8.1' into PHP-8.2
iluuu1994 Aug 23, 2023
75f5b22
Merge branch 'PHP-8.2'
iluuu1994 Aug 23, 2023
e055e12
[skip ci] Mark test as XLEAK due to LSAN bug (#12018)
Girgias Aug 23, 2023
94e26dc
[ci skip] bump zip version
remicollet Aug 23, 2023
c9e5e1f
Switch asan build to Ubuntu 23.04 in Docker
iluuu1994 Aug 23, 2023
66acaba
Add more test coverage for ext/odbc
kocsismate Jul 26, 2023
985511e
Enable ext/odbc and ext/pdo_odbc tests on Linux in GitHub CI
kocsismate Aug 7, 2023
8726ae0
Improve and fix ext/odbc tests
kocsismate Aug 8, 2023
462792e
Expose PDO_ODBC_TYPE to userland
kocsismate Aug 22, 2023
de3adc0
Migrate ext/odbc resources to opaque objects
kocsismate May 19, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions .github/actions/apt-x64/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,21 @@ runs:
run: |
set -x

sudo apt-get update
sudo apt-get install \
export DEBIAN_FRONTEND=noninteractive

# Install sudo in Docker for consistent actions
if ! type "sudo" > /dev/null; then
apt-get update -y | true
apt-get install -y sudo
fi

sudo apt-get update -y | true
sudo apt-get install -y \
autoconf \
gcc \
make \
curl \
unzip \
bison \
re2c \
locales \
Expand All @@ -20,6 +33,7 @@ runs:
libtidy-dev \
libenchant-2-dev \
libaspell-dev \
libbz2-dev \
libpspell-dev \
libsasl2-dev \
libxpm-dev \
Expand Down Expand Up @@ -60,15 +74,3 @@ runs:
libjpeg-dev \
libpng-dev \
libfreetype6-dev

mkdir /opt/oracle
wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip
unzip instantclient-basiclite-linuxx64.zip && rm instantclient-basiclite-linuxx64.zip
wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip
unzip instantclient-sdk-linuxx64.zip && rm instantclient-sdk-linuxx64.zip
mv instantclient_*_* /opt/oracle/instantclient
# interferes with libldap2 headers
rm /opt/oracle/instantclient/sdk/include/ldap.h
# fix debug build warning: zend_signal: handler was replaced for signal (2) after startup
echo DISABLE_INTERRUPT=on > /opt/oracle/instantclient/network/admin/sqlnet.ora
sudo sh -c 'echo /opt/oracle/instantclient >/etc/ld.so.conf.d/oracle-instantclient.conf && ldconfig'
2 changes: 1 addition & 1 deletion .github/actions/install-linux-x32/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ runs:
run: |
set -x
make install
mkdir /etc/php.d
mkdir -p /etc/php.d
chmod 777 /etc/php.d
echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini
Expand Down
8 changes: 1 addition & 7 deletions .github/actions/install-linux/action.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
name: Install
inputs:
withOci:
default: true
required: false
runs:
using: composite
steps:
- shell: bash
run: |
set -x
sudo make install
sudo mkdir /etc/php.d
sudo mkdir -p /etc/php.d
sudo chmod 777 /etc/php.d
echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini
${{ inputs.withOci == 'true' && 'echo extension=oci8.so > /etc/php.d/oci8.ini' || '' }}
${{ inputs.withOci == 'true' && 'echo extension=pdo_oci.so > /etc/php.d/pdo_oci.ini' || '' }}
17 changes: 17 additions & 0 deletions .github/actions/setup-oracle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,20 @@ runs:
--name oracle \
-h oracle \
-d gvenzl/oracle-xe:slim

mkdir /opt/oracle
wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip
unzip instantclient-basiclite-linuxx64.zip && rm instantclient-basiclite-linuxx64.zip
wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip
unzip instantclient-sdk-linuxx64.zip && rm instantclient-sdk-linuxx64.zip
mv instantclient_*_* /opt/oracle/instantclient
# interferes with libldap2 headers
rm /opt/oracle/instantclient/sdk/include/ldap.h
# fix debug build warning: zend_signal: handler was replaced for signal (2) after startup
echo DISABLE_INTERRUPT=on > /opt/oracle/instantclient/network/admin/sqlnet.ora
sudo sh -c 'echo /opt/oracle/instantclient >/etc/ld.so.conf.d/oracle-instantclient.conf && ldconfig'

sudo mkdir -p /etc/php.d
sudo chmod 777 /etc/php.d
echo extension=oci8.so > /etc/php.d/oci8.ini
echo extension=pdo_oci.so > /etc/php.d/pdo_oci.ini
2 changes: 2 additions & 0 deletions .github/actions/setup-x64/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ runs:
# Ensure local_infile tests can run.
mysql -uroot -proot -e "SET GLOBAL local_infile = true"
docker exec sql1 /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U SA -P "<YourStrong@Passw0rd>" -Q "create login pdo_test with password='password', check_policy=off; create user pdo_test for login pdo_test; grant alter, control to pdo_test;"
docker exec sql1 /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U SA -P "<YourStrong@Passw0rd>" -Q "create login odbc_test with password='password', check_policy=off; create user odbc_test for login odbc_test; grant alter, control, delete to odbc_test;"
docker exec sql1 /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U SA -P "<YourStrong@Passw0rd>" -Q "ALTER SERVER ROLE sysadmin ADD MEMBER odbc_test;"
sudo locale-gen de_DE

./.github/scripts/setup-slapd.sh
Expand Down
4 changes: 4 additions & 0 deletions .github/actions/test-linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ runs:
export PDO_OCI_TEST_DSN="oci:dbname=localhost/XEPDB1;charset=AL32UTF8"
export PGSQL_TEST_CONNSTR="host=postgres dbname=test port=5432 user=postgres password=postgres"
export PDO_PGSQL_TEST_DSN="host=postgres dbname=test port=5432 user=postgres password=postgres"
export ODBC_TEST_USER="odbc_test"
export ODBC_TEST_PASS="password"
export ODBC_TEST_DSN="Driver={ODBC Driver 17 for SQL Server};Server=127.0.0.1;Database=master;uid=$ODBC_TEST_USER;pwd=$ODBC_TEST_PASS"
export PDO_ODBC_TEST_DSN="odbc:$ODBC_TEST_DSN"
export SKIP_IO_CAPTURE_TESTS=1
export TEST_PHP_JUNIT=junit.out.xml
export STACK_LIMIT_DEFAULTS_CHECK=1
Expand Down
21 changes: 21 additions & 0 deletions .github/nightly_matrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,25 @@ function get_matrix_include(array $branches) {
return $jobs;
}

function get_windows_matrix_include(array $branches) {
$jobs = [];
foreach ($branches as $branch) {
$jobs[] = [
'branch' => $branch,
'x64' => true,
'zts' => true,
'opcache' => true,
];
$jobs[] = [
'branch' => $branch,
'x64' => false,
'zts' => false,
'opcache' => false,
];
}
return $jobs;
}

$trigger = $argv[1] ?? 'schedule';
$attempt = (int) ($argv[2] ?? 1);
$discard_cache = ($trigger === 'schedule' && $attempt !== 1) || $trigger === 'workflow_dispatch';
Expand All @@ -90,8 +109,10 @@ function get_matrix_include(array $branches) {

$branches = get_branches();
$matrix_include = get_matrix_include($branches);
$windows_matrix_include = get_windows_matrix_include($branches);

$f = fopen(getenv('GITHUB_OUTPUT'), 'a');
fwrite($f, 'branches=' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n");
fwrite($f, 'matrix-include=' . json_encode($matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
fwrite($f, 'windows-matrix-include=' . json_encode($windows_matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
fclose($f);
17 changes: 8 additions & 9 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
outputs:
branches: ${{ steps.set-matrix.outputs.branches }}
matrix-include: ${{ steps.set-matrix.outputs.matrix-include }}
windows-matrix-include: ${{ steps.set-matrix.outputs.windows-matrix-include }}
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -637,7 +638,7 @@ jobs:
- name: make install
run: |
sudo make install
sudo mkdir /etc/php.d
sudo mkdir -p /etc/php.d
sudo chmod 777 /etc/php.d
echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini
Expand Down Expand Up @@ -837,17 +838,13 @@ jobs:
with:
token: ${{ secrets.ACTION_MONITORING_SLACK }}
WINDOWS:
needs: GENERATE_MATRIX
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
strategy:
fail-fast: false
matrix:
include:
- x64: true
zts: true
opcache: true
- x64: false
zts: false
opcache: false
name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.windows-matrix-include) }}
name: "${{ matrix.branch.name }}_WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
runs-on: windows-2019
env:
PHP_BUILD_CACHE_BASE_DIR: C:\build-cache
Expand All @@ -865,6 +862,8 @@ jobs:
run: git config --global core.autocrlf false && git config --global core.eol lf
- name: git checkout
uses: actions/checkout@v3
with:
ref: ${{ matrix.branch.ref }}
- name: Setup
uses: ./.github/actions/setup-windows
- name: Build
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- NEWS
- UPGRADING
- UPGRADING.INTERNALS
- README.md
- '**/README.*'
- CONTRIBUTING.md
- CODING_STANDARDS.md
branches:
Expand All @@ -21,7 +21,7 @@ on:
- NEWS
- UPGRADING
- UPGRADING.INTERNALS
- README.md
- '**/README.*'
- CONTRIBUTING.md
- CODING_STANDARDS.md
branches:
Expand All @@ -37,12 +37,21 @@ env:
jobs:
LINUX_X64:
services:
mysql:
image: mysql:8
env:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: root
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
env:
MYSQL_TEST_HOST: mysql
PDO_MYSQL_TEST_DSN: mysql:host=mysql;dbname=test
PDO_MYSQL_TEST_HOST: mysql
strategy:
fail-fast: false
matrix:
Expand All @@ -55,17 +64,21 @@ jobs:
asan: true
name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}"
runs-on: ubuntu-22.04
container:
image: ${{ matrix.asan && 'ubuntu:23.04' || null }}
steps:
- name: git checkout
uses: actions/checkout@v3
- name: apt
uses: ./.github/actions/apt-x64
- name: Create MSSQL container
if: ${{ !matrix.asan }}
uses: ./.github/actions/setup-mssql
- name: Create Oracle container
if: ${{ !matrix.asan }}
uses: ./.github/actions/setup-oracle
- name: Setup Caddy server
uses: ./.github/actions/setup-caddy
- name: apt
uses: ./.github/actions/apt-x64
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
Expand All @@ -86,9 +99,8 @@ jobs:
run: make -j$(/usr/bin/nproc) >/dev/null
- name: make install
uses: ./.github/actions/install-linux
with:
withOci: ${{ !matrix.asan }}
- name: Setup
if: ${{ !matrix.asan }}
uses: ./.github/actions/setup-x64
- name: Test
if: matrix.asan == false
Expand All @@ -105,6 +117,7 @@ jobs:
${{ !matrix.asan && '-d opcache.jit_buffer_size=16M' || '' }}
${{ matrix.asan && '--asan -x' || '' }}
- name: Verify generated files are up to date
if: ${{ !matrix.asan }}
uses: ./.github/actions/verify-generated-files
MACOS_DEBUG_NTS:
runs-on: macos-11
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ accompanied by [pull requests](#pull-requests). You can find the extremely large
list of RFCs that have been previously considered on the
[PHP Wiki](https://wiki.php.net/rfc).

To create a RFC, discuss it with the extension maintainer, and discuss it on the
development mailing list internals@lists.php.net. RFC Wiki accounts can be
To create an RFC, discuss it with the extension maintainer, and discuss it on
the development mailing list internals@lists.php.net. RFC Wiki accounts can be
requested on https://wiki.php.net/start?do=register. PHP extension maintainers
can be found in the [EXTENSIONS](/EXTENSIONS) file in the PHP source code
repository. Mailing list subscription is explained on the
Expand Down Expand Up @@ -318,7 +318,7 @@ detailed [information on Git](https://git-scm.com/).

PHP is developed through the efforts of a large number of people. Collaboration
is a Good Thing(tm), and Git lets us do this. Thus, following some basic rules
with regards to Git usage will:
with regard to Git usage will:

* Make everybody happier, especially those responsible for maintaining PHP
itself.
Expand Down Expand Up @@ -348,7 +348,7 @@ Having said that, here are the organizational rules:
`--enable-zts` switch to ensure your code handles TSRM correctly and doesn't
break for those who need that.

Currently we have the following branches in use:
Currently, we have the following branches in use:

| Branch | |
| --------- | --------- |
Expand Down
22 changes: 21 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.3.0beta3
?? ??? ????, PHP 8.3.0RC1

- Core:
. Fixed bug GH-11937 (Constant ASTs containing objects). (ilutov)

17 Aug 2023, PHP 8.3.0beta3

- Core:
. Fixed strerror_r detection at configuration time. (Kévin Dunglas)
. Fixed segfault during freeing of some incompletely initialized objects due
to OOM error (PDO, SPL, XSL). (ilutov)
. Fixed trait typed properties using a DNF type not being correctly bound.
(Girgias)
. Fixed trait property types not being arena allocated if copied from
an internal trait. (Girgias)
. Fixed deep copy of property DNF type during lazy class load.
(Girgias, ilutov)
. Fixed memory freeing of DNF types for non arena allocated types.
(Girgias, ju1ius)

- DOM:
. adoptNode now respects the strict error checking property. (nielsdos)
. Align DOMChildNode parent checks with spec. (nielsdos)
. Fixed bug #80927 (Removing documentElement after creating attribute node:
possible use-after-free). (nielsdos)
. Fix various namespace prefix conflict resolution bugs. (nielsdos)
. Fix calling createAttributeNS() without prefix causing the default
namespace of the element to change. (nielsdos)

- Opcache:
. Avoid resetting JIT counter handlers from multiple processes/threads.
Expand Down
Loading