GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fixes #299 - array_key_exists warning when parsing a "DEFAULT FALSE" … · phpmyadmin/sql-parser@ce56f16

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/Components
    • AlterOperation.php
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/Components/AlterOperation.php‎

Copy file name to clipboardExpand all lines: src/Components/AlterOperation.php
+9-3Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,12 @@ public static function parse(Parser $parser, TokensList $list, array $options =
263263
}
264264
$state = 2;
265265
} elseif ($state === 2) {
266+
$array_key = '';
267+
if (is_string($token->value) || is_numeric($token->value)) {
268+
$array_key = $token->value;
269+
} else {
270+
$array_key = $token->token;
271+
}
266272
if ($token->type === Token::TYPE_OPERATOR) {
267273
if ($token->value === '(') {
268274
++$brackets;
@@ -282,9 +288,9 @@ public static function parse(Parser $parser, TokensList $list, array $options =
282288
);
283289
break;
284290
}
285-
} elseif ((array_key_exists($token->value, self::$DB_OPTIONS)
286-
|| array_key_exists($token->value, self::$TABLE_OPTIONS))
287-
&& ! self::checkIfColumnDefinitionKeyword($token->value)
291+
} elseif ((array_key_exists($array_key, self::$DB_OPTIONS)
292+
|| array_key_exists($array_key, self::$TABLE_OPTIONS))
293+
&& ! self::checkIfColumnDefinitionKeyword($array_key)
288294
) {
289295
// This alter operation has finished, which means a comma was missing before start of new alter operation
290296
$parser->error(

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.