This repository was archived by the owner on Jun 2, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +28
-3
lines changed Expand file tree Collapse file tree 1 file changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -1252,16 +1252,14 @@ public function testColumnWithOnUpdate() {
1252
1252
$ this ->assertNull ( $ result [0 ]->updated_at );
1253
1253
}
1254
1254
1255
- public function testTypeKeywordsAsKeyNames () {
1255
+ public function testDataTypeKeywordsAsKeyNames () {
1256
1256
// CREATE TABLE with a data type as a key name
1257
1257
$ this ->assertQuery (
1258
1258
'CREATE TABLE `_tmp_table` (
1259
1259
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
1260
1260
`timestamp` datetime NOT NULL,
1261
- `INDEX` timestamp,
1262
1261
PRIMARY KEY (`id`),
1263
1262
KEY `timestamp` (`timestamp`),
1264
- KEY numeric (numeric)
1265
1263
); '
1266
1264
);
1267
1265
$ results = $ this ->assertQuery ( 'DESCRIBE _tmp_table; ' );
@@ -1283,6 +1281,33 @@ public function testTypeKeywordsAsKeyNames() {
1283
1281
'Default ' => null ,
1284
1282
'Extra ' => '' ,
1285
1283
),
1284
+ ),
1285
+ $ results
1286
+ );
1287
+ }
1288
+
1289
+
1290
+ public function testReservedKeywordsAsFieldNames () {
1291
+ // CREATE TABLE with a reserved keyword as a field name
1292
+ $ this ->assertQuery (
1293
+ 'CREATE TABLE `_tmp_table` (
1294
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
1295
+ `INDEX` timestamp,
1296
+ PRIMARY KEY (`id`),
1297
+ KEY numeric (numeric)
1298
+ ); '
1299
+ );
1300
+ $ results = $ this ->assertQuery ( 'DESCRIBE _tmp_table; ' );
1301
+ $ this ->assertEquals (
1302
+ array (
1303
+ (object ) array (
1304
+ 'Field ' => 'id ' ,
1305
+ 'Type ' => 'bigint(20) unsigned ' ,
1306
+ 'Null ' => 'NO ' ,
1307
+ 'Key ' => 'PRI ' ,
1308
+ 'Default ' => '0 ' ,
1309
+ 'Extra ' => '' ,
1310
+ ),
1286
1311
(object ) array (
1287
1312
'Field ' => 'INDEX ' ,
1288
1313
'Type ' => 'timestamp ' ,
You can’t perform that action at this time.
0 commit comments