Skip to content

Commit 713011e

Browse files
committed
since the returned prop is called mode, call the function that too.
return mode in upper case, to match .type
1 parent dc2997b commit 713011e

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/SQLParser.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ function parse_field_or_key(&$tokens, &$fields, &$indexes){
374374
$index['name'] = $this->decode_identifier(array_shift($tokens));
375375
}
376376

377-
$this->parse_index_type($tokens, $index);
377+
$this->parse_index_mode($tokens, $index);
378378
$this->parse_index_columns($tokens, $index);
379379
$this->parse_index_options($tokens, $index);
380380

@@ -396,7 +396,7 @@ function parse_field_or_key(&$tokens, &$fields, &$indexes){
396396

397397
array_shift($tokens);
398398

399-
$this->parse_index_type($tokens, $index);
399+
$this->parse_index_mode($tokens, $index);
400400
$this->parse_index_columns($tokens, $index);
401401
$this->parse_index_options($tokens, $index);
402402

@@ -433,7 +433,7 @@ function parse_field_or_key(&$tokens, &$fields, &$indexes){
433433
$index['name'] = $this->decode_identifier(array_shift($tokens));
434434
}
435435

436-
$this->parse_index_type($tokens, $index);
436+
$this->parse_index_mode($tokens, $index);
437437
$this->parse_index_columns($tokens, $index);
438438
$this->parse_index_options($tokens, $index);
439439

@@ -796,10 +796,10 @@ function _extract_tokens($sql, &$source_map){
796796
return $out;
797797
}
798798

799-
function parse_index_type(&$tokens, &$index){
799+
function parse_index_mode(&$tokens, &$index){
800800
if (count($tokens) >= 1){
801-
if ($tokens[0] == 'USING BTREE'){ $index['mode'] = 'btree'; array_shift($tokens); }
802-
if ($tokens[0] == 'USING HASH' ){ $index['mode'] = 'hash'; array_shift($tokens); }
801+
if ($tokens[0] == 'USING BTREE'){ $index['mode'] = 'BTREE'; array_shift($tokens); }
802+
if ($tokens[0] == 'USING HASH' ){ $index['mode'] = 'HASH'; array_shift($tokens); }
803803
}
804804
}
805805

@@ -863,7 +863,7 @@ function parse_index_options(&$tokens, &$index){
863863
}
864864
}
865865

866-
$this->parse_index_type($tokens, $index);
866+
$this->parse_index_mode($tokens, $index);
867867

868868
if (count($tokens) >= 1){
869869
if ($tokens[0] == 'WITH PARSER'){

0 commit comments

Comments
 (0)