Skip to content

Commit

Permalink
Revert wp-includes/sqlite/class-wp-sqlite-translator.php
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed Jun 6, 2024
1 parent 554342e commit 13e58d7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions wp-includes/sqlite/class-wp-sqlite-translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3238,8 +3238,8 @@ private function execute_drop() {
*/
private function execute_show() {
$this->rewriter->skip();
$what1 = $this->rewriter->consume()->token;
$what2 = $this->rewriter->consume()->token;
$what1 = strtoupper( $this->rewriter->consume()->token );
$what2 = strtoupper( $this->rewriter->consume()->token );
$what = $what1 . ' ' . $what2;
switch ( $what ) {
case 'CREATE PROCEDURE':
Expand Down Expand Up @@ -3338,10 +3338,18 @@ private function execute_show() {
return;

case 'CREATE TABLE':
$table_name = $this->rewriter->consume()->token;
// Value is unquoted table name
$table_name = $this->rewriter->consume()->value;
$columns = $this->get_columns_from( $table_name );
$keys = $this->get_keys( $table_name );

if ( empty( $columns ) ) {
$this->set_results_from_fetched_data(
array()
);
return;
}

foreach ( $columns as $column ) {
$column = (array) $column;
$definition = '';
Expand Down Expand Up @@ -3452,6 +3460,7 @@ private function execute_show() {
':param' => $table_expression->value,
)
);

$this->set_results_from_fetched_data(
$stmt->fetchAll( $this->pdo_fetch_mode )
);
Expand Down

0 comments on commit 13e58d7

Please sign in to comment.