Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Commit 8432d2a

Browse files
committed
Implement "CAST(... AS BINARY)"
1 parent d356021 commit 8432d2a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

wp-includes/sqlite-ast/class-wp-sqlite-driver.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,6 +1454,12 @@ private function translate( $ast ) {
14541454

14551455
// When we have no value, it's reasonable to use NULL.
14561456
return 'NULL';
1457+
case 'castType':
1458+
// Translate "CAST(... AS BINARY)" to "CAST(... AS BLOB)".
1459+
if ( $ast->has_child_token( WP_MySQL_Lexer::BINARY_SYMBOL ) ) {
1460+
return 'BLOB';
1461+
}
1462+
return $this->translate_sequence( $ast->get_children() );
14571463
case 'defaultCollation':
14581464
// @TODO: Check and save in information schema.
14591465
return null;

0 commit comments

Comments
 (0)