Re: [PHP-DEV] Use MySQL syntax only for parsing MySQL statements in PDO

2021-04-12 Thread Matteo Beccati
Sergei, On 11/04/2021 19:48, Sergei Morozov wrote: This is great to see this effort happening! As I understand, you also implement an API for platform-specific parsers but via a much better extensible API. > I'm curious if instead of keeping the MySQL syntax in the default parser and creating on

Re: [PHP-DEV] Use MySQL syntax only for parsing MySQL statements in PDO

2021-04-11 Thread Sergei Morozov
Kamil, > You are attempting to fix a small issue in another driver while the MySQL parser is already broken with similar bugs. Yes, this is what the original idea was given the existing bugs on bugs.php.net while I wasn't aware of all the other MySQL parser problems that you pointed out. > Which

Re: [PHP-DEV] Use MySQL syntax only for parsing MySQL statements in PDO

2021-04-11 Thread Kamil Tekiela
> This specific issue doesn't seem to be related to the emulation. As far as I understand, PDO parses SQL as well in order to replace positional placeholders and vise versa depending on the input and the target platform capabilities. True, PDO has a huge flaw because of its SQL parser. In non-emul

Re: [PHP-DEV] Use MySQL syntax only for parsing MySQL statements in PDO

2021-04-11 Thread Matteo Beccati
Hi Sergei, in fact I have been working on a secret plan to allow each driver to optionally have their own parser. Due to very limited time I haven't finalised all the details, but the proof of concept looks promising: https://github.com/php/php-src/pull/6852 Perhaps we could work together an

Re: [PHP-DEV] Use MySQL syntax only for parsing MySQL statements in PDO

2021-04-10 Thread Sergei Morozov
Hi, > it seems to be a cheap hack To me, it seems to be within the existing architecture. I agree that the existing architecture has its flaws. > What about backtick character ` ? What about NO_BACKSLASH_ESCAPES mode? These are out of scope. I wasn't aware of the NO_BACKSLASH_ESCAPES but it ind

Re: [PHP-DEV] Use MySQL syntax only for parsing MySQL statements in PDO

2021-04-10 Thread Kamil Tekiela
This is an interesting solution to the problem, but I am unsure if it's the best one. I didn't look into it in detail yet, but at first glance, it seems to be a cheap hack to solve a bug. What about backtick character ` ? What about NO_BACKSLASH_ESCAPES mode? Any question mark within backtick-escap

[PHP-DEV] Use MySQL syntax only for parsing MySQL statements in PDO

2021-04-10 Thread Sergei Morozov
Hi Internals, There are bugs #79276 and #80340 where PDO parses valid PostgreSQL statements incorrectly because it uses MySQL grammar for all statements regardless of the underlying platform. I submitted pull request