Skip to content

Commit

Permalink
Merge branch '5.11.x'
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <[email protected]>
  • Loading branch information
MauricioFauth committed Nov 10, 2024
2 parents ac8dab3 + a05588a commit 6d8c215
Show file tree
Hide file tree
Showing 12 changed files with 1,876 additions and 319 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@
- Move `Misc::getAliases()` into `SelectStatement::getAliases()` (#454)
- Drop `USE_UTF_STRINGS` constant (#471)

## [5.10.1] - 2024-11-10

### Fixed

- Fix parsing of ALTER TABLE … RENAME KEY (#580)
- Fix parsing table names that start with "e1" (#578)
- Improve handling of negative and overflowed offsets on TokensList (#582)
- Fix parsing of queries with 'AND' (#590)
- Fix C style comments with two asterisks (#597)
- Fix parsing of SRID in column definition (#595)

## [5.10.0] - 2024-08-29

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

* First release of this library.

[5.10.1]: https://github.com/phpmyadmin/sql-parser/compare/5.10.0...5.10.1
[5.10.0]: https://github.com/phpmyadmin/sql-parser/compare/5.9.1...5.10.0
[5.9.1]: https://github.com/phpmyadmin/sql-parser/compare/5.9.0...5.9.1
[5.9.0]: https://github.com/phpmyadmin/sql-parser/compare/5.8.2...5.9.0
2 changes: 1 addition & 1 deletion src/Lexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ public function parseComment(): Token|null
// - "SELECT */* comment */ FROM ..."
// - "SELECT 2*/* comment */3 AS `six`;"
$next = $this->last + 1;
if (($next < $this->len) && $this->str[$next] === '*') {
if (($next < $this->len) && $this->str[$next] === '*' && $token === '*/') {
// Conflict in "*/*": first "*" was not for ending a comment.
// Stop here and let other parsing method define the true behavior of that first star.
$this->last = $iBak;
Expand Down
1 change: 1 addition & 0 deletions src/Parsers/CreateDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ final class CreateDefinitions implements Parseable
'ENFORCED' => 14,
'NOT' => 15,
'COMPRESSED' => 16,
'SRID' => [17, 'var'],
// Common entries.
//
// NOTE: Some of the common options are not in the same order which
Expand Down
1 change: 1 addition & 0 deletions tests/Lexer/LexerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public static function lexProvider(): array
['lexer/lexOperator'],
['lexer/lexOperatorStarIsArithmetic'],
['lexer/lexOperatorStarIsWildcard'],
['lexer/lexEmptyCStyleComment'],
['lexer/lexString'],
['lexer/lexStringErr1'],
['lexer/lexSymbol'],
Expand Down
1 change: 1 addition & 0 deletions tests/Parser/CreateStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public static function createProvider(): array
['parser/parseCreateTableAsSelect'],
['parser/parseCreateTableLike'],
['parser/parseCreateTableSpatial'],
['parser/parseCreateTableSRID'],
['parser/parseCreateTableTimestampWithPrecision'],
['parser/parseCreateTableEnforcedCheck'],
['parser/parseCreateTableNotEnforcedCheck'],
Expand Down
5 changes: 5 additions & 0 deletions tests/data/lexer/lexEmptyCStyleComment.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SELECT /**/ 1
SELECT /*+*/ 1
SELECT /***/ 1
SELECT /** */ 1
SELECT /* **/ 1
Loading

0 comments on commit 6d8c215

Please sign in to comment.