Skip to content

Commit 795e5c4

Browse files
committed
actually return index names instead of discarding them.
decode them too
1 parent 04117a0 commit 795e5c4

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

lib_sql_parser.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,8 @@ function parse_field_or_key(&$tokens, &$fields, &$indexes){
346346

347347
array_shift($tokens);
348348

349-
$name = null;
350349
if ($tokens[0] != '(' && $tokens[0] != 'USING BTREE' && $tokens[0] != 'USING HASH'){
351-
$name = $tokens[0];
352-
array_shift($tokens);
350+
$index['name'] = $this->decode_identifier(array_shift($tokens));
353351
}
354352

355353
$this->parse_index_type($tokens, $index);
@@ -407,10 +405,8 @@ function parse_field_or_key(&$tokens, &$fields, &$indexes){
407405

408406
array_shift($tokens);
409407

410-
$name = null;
411408
if ($tokens[0] != '('){
412-
$name = $tokens[0];
413-
array_shift($tokens);
409+
$index['name'] = $this->decode_identifier(array_shift($tokens));
414410
}
415411

416412
$this->parse_index_type($tokens, $index);

0 commit comments

Comments
 (0)