[Phpmyadmin-devel] Parser support for virtual columns
madhura.cj at gmail.com
Tue Jul 14 07:26:51 CEST 2015
On Tue, Jul 14, 2015 at 4:27 AM, Dan Ungureanu <udan1107 at gmail.com> wrote:
> On 13.07.2015 18:09, Madhura Jayaratne wrote:
> Hi Dan,
> MariaDB (5.2.0+) supports virtual columns and the syntax is
> <type> [GENERATED ALWAYS] AS ( <expression> ) [VIRTUAL | PERSISTENT]
> [UNIQUE] [UNIQUE KEY] [COMMENT <text>]
> While implementing , to add parser support for virtual columns, I
> tried to model this syntax using $FIELD_OPTIONS . Even though I am able
> to retrieve the expression this way, all the brackets and spaces of the
> expression are gone. As I understand, this due to the tokenization.
> Do you have any suggestion for an alternative approach?
>  https://sourceforge.net/p/phpmyadmin/feature-requests/1517/
> Thanks and Regards,
> Madhura Jayaratne
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.https://www.gigenetcloud.com/
> Phpmyadmin-devel mailing listPhpmyadmin-devel at lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel
> Hello Madhura,
> The way you approached this was the correct solution, however, there was a
> bug in my code which skipped white-spaces. I am not sure what exactly you
> want to extract from that expression and I implemented here  a new type
> of option "expr" that should make your job easier and parse an expression
> You can find here  a snippet of code I used to parse a CREATE statement
> that contains virtual fields and the result of the parsing. As you can see,
> the fact that I used the `Expression` component to parse the expression
> extracted the function name as well. Anyway, you can continue using the
> "var" option which will only format the expression, without extracting any
>  https://gist.github.com/udan11/4b6eaee2a1fb7fa315c2
> Best regards,
> Dan Ungureanu
I've taken the latest version of sql-parser into phpMyAdmin in . I've
used the parsed output to detect the expression in MariaDB generated
columns and it works fine.
Btw, great job with parser rewrite!
Thanks and Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Developers