Skip to content

Commit 6d8c215

Browse files
committed
Merge branch '5.11.x'
Signed-off-by: Maurício Meneghini Fauth <[email protected]>
2 parents ac8dab3 + a05588a commit 6d8c215

12 files changed

+1876
-319
lines changed

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@
66
- Move `Misc::getAliases()` into `SelectStatement::getAliases()` (#454)
77
- Drop `USE_UTF_STRINGS` constant (#471)
88

9+
## [5.10.1] - 2024-11-10
10+
11+
### Fixed
12+
13+
- Fix parsing of ALTER TABLE … RENAME KEY (#580)
14+
- Fix parsing table names that start with "e1" (#578)
15+
- Improve handling of negative and overflowed offsets on TokensList (#582)
16+
- Fix parsing of queries with 'AND' (#590)
17+
- Fix C style comments with two asterisks (#597)
18+
- Fix parsing of SRID in column definition (#595)
19+
920
## [5.10.0] - 2024-08-29
1021

1122
- Fix parsing of UPDATE ... SET (#577)
@@ -586,6 +597,7 @@ __Breaking changes:__
586597

587598
* First release of this library.
588599

600+
[5.10.1]: https://github.com/phpmyadmin/sql-parser/compare/5.10.0...5.10.1
589601
[5.10.0]: https://github.com/phpmyadmin/sql-parser/compare/5.9.1...5.10.0
590602
[5.9.1]: https://github.com/phpmyadmin/sql-parser/compare/5.9.0...5.9.1
591603
[5.9.0]: https://github.com/phpmyadmin/sql-parser/compare/5.8.2...5.9.0

src/Lexer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ public function parseComment(): Token|null
568568
// - "SELECT */* comment */ FROM ..."
569569
// - "SELECT 2*/* comment */3 AS `six`;"
570570
$next = $this->last + 1;
571-
if (($next < $this->len) && $this->str[$next] === '*') {
571+
if (($next < $this->len) && $this->str[$next] === '*' && $token === '*/') {
572572
// Conflict in "*/*": first "*" was not for ending a comment.
573573
// Stop here and let other parsing method define the true behavior of that first star.
574574
$this->last = $iBak;

src/Parsers/CreateDefinitions.php

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ final class CreateDefinitions implements Parseable
8383
'ENFORCED' => 14,
8484
'NOT' => 15,
8585
'COMPRESSED' => 16,
86+
'SRID' => [17, 'var'],
8687
// Common entries.
8788
//
8889
// NOTE: Some of the common options are not in the same order which

tests/Lexer/LexerTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public static function lexProvider(): array
7575
['lexer/lexOperator'],
7676
['lexer/lexOperatorStarIsArithmetic'],
7777
['lexer/lexOperatorStarIsWildcard'],
78+
['lexer/lexEmptyCStyleComment'],
7879
['lexer/lexString'],
7980
['lexer/lexStringErr1'],
8081
['lexer/lexSymbol'],

tests/Parser/CreateStatementTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public static function createProvider(): array
5959
['parser/parseCreateTableAsSelect'],
6060
['parser/parseCreateTableLike'],
6161
['parser/parseCreateTableSpatial'],
62+
['parser/parseCreateTableSRID'],
6263
['parser/parseCreateTableTimestampWithPrecision'],
6364
['parser/parseCreateTableEnforcedCheck'],
6465
['parser/parseCreateTableNotEnforcedCheck'],
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
SELECT /**/ 1
2+
SELECT /*+*/ 1
3+
SELECT /***/ 1
4+
SELECT /** */ 1
5+
SELECT /* **/ 1

0 commit comments

Comments
 (0)