Skip to content

Commit 2827a25

Browse files
Merge pull request #595 from MoonE/srid-in-column-definition
Parse SRID in column definition Fixes phpmyadmin/phpmyadmin#18513
2 parents 0f48e26 + 705d0b3 commit 2827a25

File tree

4 files changed

+835
-0
lines changed

4 files changed

+835
-0
lines changed

src/Components/CreateDefinition.php

+4
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ class CreateDefinition extends Component
9393
'ENFORCED' => 14,
9494
'NOT' => 15,
9595
'COMPRESSED' => 16,
96+
'SRID' => [
97+
17,
98+
'var',
99+
],
96100
// Common entries.
97101
//
98102
// NOTE: Some of the common options are not in the same order which

tests/Parser/CreateStatementTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public static function createProvider(): array
6262
['parser/parseCreateTableAsSelect'],
6363
['parser/parseCreateTableLike'],
6464
['parser/parseCreateTableSpatial'],
65+
['parser/parseCreateTableSRID'],
6566
['parser/parseCreateTableTimestampWithPrecision'],
6667
['parser/parseCreateTableEnforcedCheck'],
6768
['parser/parseCreateTableNotEnforcedCheck'],
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CREATE TABLE IF NOT EXISTS `public_areas` (
2+
`id` INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
3+
`kind` enum('COUNTRY','REGION','DEPARTMENT','MUNICIPALITY') NOT NULL,
4+
`area` geometry NOT NULL SRID 4326,
5+
`properties` json NOT NULL,
6+
`title` varchar(100) NOT NULL
7+
);

0 commit comments

Comments
 (0)