Skip to content

Unable to parse table names that start with "e1" #578

Closed
@sergio-paternoster

Description

@sergio-paternoster

Not sure if this is a bug of just a table name with reserved keywords. If the name of my table starts with "e1" the parser is unable to recognize it. It works with any other table name that doesn't start with "e1". Here is my code (SqlParser v.5.10, php version 8.2.16 CLI):

use PhpMyAdmin\SqlParser\Parser         as Parser;

$query = "LOAD DATA LOCAL INFILE '/home/user/myloadfile.csv' 
          IGNORE INTO TABLE erp.e1_table
          FIELDS TERMINATED BY '\t'
          LINES TERMINATED BY '\n'
          IGNORE 0 LINES;";

$parser                                 = new Parser($query);
echo "\n file:   ".$parser->statements[0]->file_name->file;
echo "\n schema: ".$parser->statements[0]->table->database;
echo "\n table:  ".$parser->statements[0]->table->table;

This is the actual output:

 file:   /home/user/myloadfile.csv
 schema:
 table:  erp

Expected output:

 file:   /home/user/myloadfile.csv
 schema: erp
 table:  e1_table

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions