This repository was archived by the owner on Jun 2, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -3404,7 +3404,7 @@ public function testCurrentTimestamp() {
3404
3404
$ this ->assertRegExp ( '/\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d/ ' , $ results [0 ]->t );
3405
3405
3406
3406
// UPDATE
3407
- $ this ->assertQuery ( ' UPDATE _dates SET option_value = NULL ' );
3407
+ $ this ->assertQuery ( " UPDATE _dates SET option_value = '' " );
3408
3408
$ results = $ this ->assertQuery ( 'SELECT option_value AS t FROM _dates ' );
3409
3409
$ this ->assertCount ( 1 , $ results );
3410
3410
$ this ->assertEmpty ( $ results [0 ]->t );
Original file line number Diff line number Diff line change @@ -1586,6 +1586,14 @@ private function translate_runtime_function_call( WP_Parser_Node $node ): string
1586
1586
}
1587
1587
1588
1588
switch ( $ child ->id ) {
1589
+ case WP_MySQL_Lexer::CURRENT_TIMESTAMP_SYMBOL :
1590
+ case WP_MySQL_Lexer::NOW_SYMBOL :
1591
+ /*
1592
+ * 1) SQLite doesn't support CURRENT_TIMESTAMP() with parentheses.
1593
+ * 2) In MySQL, CURRENT_TIMESTAMP and CURRENT_TIMESTAMP() are an
1594
+ * alias of NOW(). In SQLite, there is no NOW() function.
1595
+ */
1596
+ return 'CURRENT_TIMESTAMP ' ;
1589
1597
case WP_MySQL_Lexer::DATE_ADD_SYMBOL :
1590
1598
case WP_MySQL_Lexer::DATE_SUB_SYMBOL :
1591
1599
$ nodes = $ node ->get_child_nodes ();
You can’t perform that action at this time.
0 commit comments