@@ -290,6 +290,47 @@ public function testShowCreateTable1() {
290290 );
291291 }
292292
293+ public function testShowCreateTableWithEmptyDatetimeDefault () {
294+ $ this ->assertQuery (
295+ "CREATE TABLE _tmp_table (
296+ ID BIGINT PRIMARY KEY AUTO_INCREMENT,
297+ timestamp1 datetime NOT NULL,
298+ timestamp2 date NOT NULL,
299+ timestamp3 time NOT NULL,
300+ timestamp4 timestamp NOT NULL,
301+ timestamp5 year NOT NULL,
302+ notempty1 datetime DEFAULT '1999-12-12 12:12:12',
303+ notempty2 date DEFAULT '1999-12-12',
304+ notempty3 time DEFAULT '12:12:12',
305+ notempty4 year DEFAULT '2024',
306+ notempty5 timestamp DEFAULT '1734539165',
307+ ); "
308+ );
309+
310+ $ this ->assertQuery (
311+ 'SHOW CREATE TABLE _tmp_table; '
312+ );
313+ $ results = $ this ->engine ->get_query_results ();
314+
315+ $ this ->assertEquals (
316+ "CREATE TABLE `_tmp_table` (
317+ `ID` bigint AUTO_INCREMENT,
318+ `timestamp1` datetime NOT NULL,
319+ `timestamp2` date NOT NULL,
320+ `timestamp3` time NOT NULL,
321+ `timestamp4` timestamp NOT NULL,
322+ `timestamp5` year NOT NULL,
323+ `notempty1` datetime DEFAULT '1999-12-12 12:12:12',
324+ `notempty2` date DEFAULT '1999-12-12',
325+ `notempty3` time DEFAULT '12:12:12',
326+ `notempty4` year DEFAULT '2024',
327+ `notempty5` timestamp DEFAULT '1734539165',
328+ PRIMARY KEY (`ID`)
329+ ); " ,
330+ $ results [0 ]->{'Create Table ' }
331+ );
332+ }
333+
293334 public function testShowCreateTableQuoted () {
294335 $ this ->assertQuery (
295336 "CREATE TABLE _tmp_table (
0 commit comments