Skip to content

Commit 1531358

Browse files
committed
Merge branch 'master' into 6.0.x
2 parents 5d6bb40 + 6c3f09b commit 1531358

626 files changed

Lines changed: 104789 additions & 10404 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
/tools export-ignore
2+
/tests/benchmarks export-ignore
23
.gitattributes export-ignore
34
.gitignore export-ignore
45
.editorconfig export-ignore
56
.github export-ignore
67
.weblate export-ignore
78
.scrutinizer.yml export-ignore
89
infection.json.dist export-ignore
10+
phpbench.json export-ignore
911
phpcs.xml.dist export-ignore
1012
phpstan.neon.dist export-ignore
1113
phpstan-baseline.neon export-ignore

.github/workflows/lint-and-analyse-php.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,16 @@ on:
44
push:
55
pull_request:
66
types: [opened, synchronize, reopened]
7-
branches:
8-
- master
9-
- QA
10-
- 6.0.x
117

128
jobs:
139
lint-php:
1410
runs-on: ubuntu-latest
1511
steps:
1612
- uses: actions/checkout@v3
17-
- name: Use php 7.2
13+
- name: Use PHP 8.1
1814
uses: shivammathur/setup-php@v2
1915
with:
20-
php-version: 7.2
21-
tools: composer:v2
16+
php-version: 8.1
2217
- name: Validate composer.json and composer.lock
2318
run: composer validate
2419
- name: Cache module
@@ -35,7 +30,7 @@ jobs:
3530
runs-on: ubuntu-latest
3631
strategy:
3732
matrix:
38-
php-version: ["7.4"]
33+
php-version: ["8.1"]
3934
steps:
4035
- uses: actions/checkout@v3
4136
- name: Use PHP ${{ matrix.php-version }}

.github/workflows/lint-docs.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ on:
44
push:
55
pull_request:
66
types: [opened, synchronize, reopened]
7-
branches:
8-
- master
9-
- QA
10-
- 6.0.x
117

128
jobs:
139
lint-docs:

.github/workflows/mutation-tests.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,7 @@ jobs:
3636
php-version: ${{ matrix.php-version }}
3737
coverage: pcov
3838
ini-values: memory_limit=-1
39-
tools: composer:v2, phive
40-
41-
- name: Install Infection
42-
# The GPG key can be found at https://infection.github.io/guide/installation.html
43-
run: |
44-
phive --no-progress install --target ./build/tools --trust-gpg-keys C5095986493B4AA0 infection
39+
tools: composer:v2, infection
4540

4641
- name: Get Composer cache directory
4742
id: composer-cache
@@ -67,7 +62,7 @@ jobs:
6762
if: ${{ github.base_ref != '' }}
6863
run: |
6964
CHANGED_FILES=$(git diff origin/$GITHUB_BASE_REF --diff-filter=AM --name-only | grep src/ | paste -sd "," -);
70-
./build/tools/infection -j$(nproc) --skip-initial-tests --no-interaction --no-progress --coverage=build/logs \
65+
infection -j$(nproc) --skip-initial-tests --no-interaction --no-progress --coverage=build/logs \
7166
--ignore-msi-with-no-mutations \
7267
--filter=$CHANGED_FILES
7368
env:
@@ -76,6 +71,6 @@ jobs:
7671
- name: Infection
7772
if: ${{ github.base_ref == '' }}
7873
run: |
79-
./build/tools/infection -j$(nproc) --skip-initial-tests --no-interaction --no-progress --coverage=build/logs
74+
infection -j$(nproc) --skip-initial-tests --no-interaction --no-progress --coverage=build/logs
8075
env:
8176
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}

.github/workflows/tests.yml

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ on:
44
push:
55
pull_request:
66
types: [opened, synchronize, reopened]
7-
branches:
8-
- master
9-
- QA
10-
- 6.0.x
117

128
jobs:
139
test-php:
@@ -16,7 +12,7 @@ jobs:
1612
continue-on-error: ${{ matrix.experimental }}
1713
strategy:
1814
matrix:
19-
php-version: ["7.2", "7.3", "7.4", "8.0", "8.1", "8.2"]
15+
php-version: ["8.1", "8.2"]
2016
os: [ubuntu-latest]
2117
experimental: [false]
2218
composer-options: ['']
@@ -61,3 +57,47 @@ jobs:
6157
if: github.repository == 'phpmyadmin/sql-parser'
6258
with:
6359
cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"
60+
61+
php-benchmark:
62+
name: Benchmark on PHP ${{ matrix.php-version }} and ${{ matrix.os }}
63+
runs-on: ${{ matrix.os }}
64+
continue-on-error: ${{ matrix.experimental }}
65+
strategy:
66+
matrix:
67+
php-version: ["8.1", "8.2"]
68+
os: [ubuntu-latest]
69+
experimental: [false]
70+
composer-options: ['']
71+
include:
72+
- { php-version: 'nightly', experimental: true, os: ubuntu-latest, composer-options: '--ignore-platform-reqs' }
73+
steps:
74+
- uses: actions/checkout@v3
75+
with:
76+
# Fetch some commits for Scrutinizer coverage upload
77+
fetch-depth: 15
78+
- name: Use PHP ${{ matrix.php-version }}
79+
uses: shivammathur/setup-php@v2
80+
with:
81+
php-version: ${{ matrix.php-version }}
82+
# phar, json and curl are used by composer
83+
# json is used by testing code
84+
# dom, json, mbstring, libxml, xml, xmlwriter are used by phpunit
85+
# tokenizer, xmlwriter and simplexml are used by phpcs
86+
# ctype is used by Psalm
87+
extensions: none, mbstring, phar, json, curl, tokenizer, xml, xmlwriter, simplexml, libxml, dom, ctype
88+
coverage: xdebug
89+
- name: Get Composer Cache Directory
90+
id: composer-cache
91+
run: |
92+
echo "::set-output name=dir::$(composer config cache-files-dir)"
93+
- name: Restore cache
94+
uses: actions/cache@v3
95+
with:
96+
path: ${{ steps.composer-cache.outputs.dir }}
97+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
98+
restore-keys: |
99+
${{ runner.os }}-composer-
100+
- name: Install dependencies
101+
run: composer install --no-interaction ${{ matrix.composer-options }}
102+
- name: Run benchmarks
103+
run: composer run phpbench

.scrutinizer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ checks:
1111
php: true
1212
tools:
1313
external_code_coverage:
14-
runs: 4 # php 7.x versions
14+
runs: 2 # php 8.x versions
1515
timeout: 480 # 8 min
1616
build:
1717
nodes:
1818
analysis:
1919
environment:
20-
php: 7.2
20+
php: 8.1
2121
dependencies:
2222
before:
2323
- composer install

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
11
# Change Log
22

3+
## [6.0.x] - YYYY-MM-DD
4+
5+
* Drop support for PHP 7.2, 7.3, 7.4 and 8.0
6+
37
## [5.x.x] - YYYY-MM-DD
48

9+
- Fix `ALTER EVENT RENAME TO` to use expression instead of var (#419)
10+
- Fix incorrect order of operations to parse table/db called `` (#422)
11+
- Fix ALTER EVENT statement with DEFINER=user modifier fails to be parsed (#418)
12+
- Fix GROUP BY modifier WITH ROLLUP is treated as a syntax error and prevents export of SQL query results
13+
- Fix `TokensList::getPrevious` was not able to reach very first token (#428)
14+
- Fix `TransactionStatement::build()` "Call to a member function build() on null" when the transaction has no end
15+
- Fix MySQL-specific commands parsing (#226)
16+
- Fix `ALTER TABLE … RENAME COLUMN … TO …` is not understood by the parser/linter (#430)
17+
- Fix `PARTITION` syntax errors (#377)
18+
- Fix `ALTER USER` when used with `IDENTIFIED WITH/VIA/BY` option (#431)
19+
20+
## [5.7.0] - 2023-01-25
21+
522
* Performance improvement to use less the `nextToken()` function (#397)
623
* Lexer - Solving ambiguity on function keywords (#385)
24+
* Implement `ALTER EVENT` (#404)
25+
* Add `ALTER EVENT` keywords (#404)
26+
* Drop PHP 7.1 support
27+
* Fix the alter operation table options `RENAME INDEX x TO y` (#405)
28+
* Fix `CreateStatement` function's options (#406)
29+
* Fix a PHP notice on Linter using `ANALYZE` (#413)
730

831
## [5.6.0] - 2023-01-02
932

composer.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@
2222
}
2323
],
2424
"require": {
25-
"php": "^7.2.5 || ^8.0",
26-
"symfony/polyfill-mbstring": "^1.3",
27-
"symfony/polyfill-php80": "^1.16"
25+
"php": "^8.1",
26+
"symfony/polyfill-mbstring": "^1.24"
2827
},
2928
"require-dev": {
30-
"phpmyadmin/coding-standard": "^3.0",
31-
"phpmyadmin/motranslator": "^5.2",
32-
"phpstan/extension-installer": "^1.1",
33-
"phpstan/phpstan": "^1.3",
34-
"phpstan/phpstan-phpunit": "^1.0",
35-
"phpunit/phpunit": "^8.5 || ^9.5",
36-
"psalm/plugin-phpunit": "^0.16.1",
37-
"vimeo/psalm": "^4.17",
29+
"phpbench/phpbench": "^1.2",
30+
"phpmyadmin/coding-standard": "^4.0",
31+
"phpmyadmin/motranslator": "^5.3",
32+
"phpstan/extension-installer": "^1.2",
33+
"phpstan/phpstan": "^1.10",
34+
"phpstan/phpstan-phpunit": "^1.3",
35+
"phpunit/phpunit": "^10.0",
36+
"psalm/plugin-phpunit": "^0.18.4",
37+
"vimeo/psalm": "^5.7",
3838
"zumba/json-serializer": "^3.0"
3939
},
4040
"conflict": {
@@ -65,6 +65,7 @@
6565
"phpstan": "@php phpstan analyse",
6666
"psalm": "@php psalm --no-diff",
6767
"phpunit": "@php phpunit --color=always",
68+
"phpbench": "@php phpbench run tests/benchmarks --report=aggregate",
6869
"test": [
6970
"@phpcs",
7071
"@phpstan",

locale/af/LC_MESSAGES/sqlparser.mo

-59 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)