Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Issue parsing « WITH PARSER ngram » #563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dugwood opened this issue Jul 3, 2024 · 3 comments
Closed

Issue parsing « WITH PARSER ngram » #563

dugwood opened this issue Jul 3, 2024 · 3 comments
Assignees
Labels
Milestone

Comments

@dugwood
Copy link

dugwood commented Jul 3, 2024

It seems the parser has an issue with fulltext index with ngram, which throws an exception. I've seen it on phpmyadmin: foreign keys (that are defined after the fulltext) are missing on the table's relations page.

Simple example with:

CREATE TABLE `mytable` (
  `column_one` smallint unsigned DEFAULT NULL,
  FULLTEXT KEY `fulltext_index` (`column_one`) /*!50100 WITH PARSER `ngram` */,
  CONSTRAINT `my_constraint_1` FOREIGN KEY (`column_one`) REFERENCES `other_table` (`column_two`) ON DELETE RESTRICT ON UPDATE RESTRICT
)

Exception: A comma or a closing bracket was expected.
Exception debug for ->token:

public 'token' => 
            object(PhpMyAdmin\SqlParser\Token)[1299]
              public 'token' => string 'WITH' (length=4)
              public 'value' => string 'WITH' (length=4)
              public 'keyword' => string 'WITH' (length=4)
              public 'type' => int 1
              public 'flags' => int 3
              public 'position' => int 128
@williamdes
Copy link
Member

Thank you for reporting this @dugwood

What do you think about it @iifawzi or @niconoe- ?

@williamdes williamdes added the bug label Aug 26, 2024
@niconoe-
Copy link
Contributor

niconoe- commented Aug 26, 2024

I'll try to take a look today.

EDIT:

Note

WITH PARSER only came from MySQL 5.1 and I can't find any MariaDB documentation about it.

I just found it is not part of the available tokens. Therefore, instead of parsing WITH PARSER, the parser parses WITH only, causing an error. I'll add the token in the contextes.

@niconoe-
Copy link
Contributor

@williamdes / @iifawzi here you go 😉

niconoe- added a commit to niconoe-/sql-parser that referenced this issue Aug 26, 2024
niconoe- added a commit to niconoe-/sql-parser that referenced this issue Aug 26, 2024
@MauricioFauth MauricioFauth self-assigned this Aug 26, 2024
@MauricioFauth MauricioFauth added this to the 5.10.0 milestone Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants