@@ -2897,20 +2897,43 @@ private function execute_show_columns_statement( WP_Parser_Node $node ): void {
28972897 $ condition = $ this ->translate_show_like_or_where_condition ( $ like_or_where , 'column_name ' );
28982898 }
28992899
2900+ // Handle the FULL keyword.
2901+ $ command_type = $ node ->get_first_child_node ( 'showCommandType ' );
2902+ $ is_full = $ command_type && $ command_type ->has_child_token ( WP_MySQL_Lexer::FULL_SYMBOL );
2903+
29002904 // Fetch column information.
29012905 $ columns_table = $ this ->information_schema_builder ->get_table_name ( $ table_is_temporary , 'columns ' );
2902- $ stmt = $ this ->execute_sqlite_query (
2906+
2907+ if ( $ is_full ) {
2908+ $ fields = '
2909+ column_name AS `Field`,
2910+ column_type AS `Type`,
2911+ collation_name AS `Collation`,
2912+ is_nullable AS `Null`,
2913+ column_key AS `Key`,
2914+ column_default AS `Default`,
2915+ extra AS `Extra`,
2916+ privileges AS `Privileges`,
2917+ column_comment AS `Comment`
2918+ ' ;
2919+ } else {
2920+ $ fields = '
2921+ column_name AS `Field`,
2922+ column_type AS `Type`,
2923+ is_nullable AS `Null`,
2924+ column_key AS `Key`,
2925+ column_default AS `Default`,
2926+ extra AS `Extra`
2927+ ' ;
2928+ }
2929+
2930+ $ stmt = $ this ->execute_sqlite_query (
29032931 sprintf (
2904- 'SELECT
2905- column_name AS `Field`,
2906- column_type AS `Type`,
2907- is_nullable AS `Null`,
2908- column_key AS `Key`,
2909- column_default AS `Default`,
2910- extra AS `Extra`
2932+ 'SELECT %s
29112933 FROM %s
29122934 WHERE table_schema = ? AND table_name = ? %s
29132935 ORDER BY ordinal_position ' ,
2936+ $ fields ,
29142937 $ this ->quote_sqlite_identifier ( $ columns_table ),
29152938 $ condition ?? ''
29162939 ),
0 commit comments