[MXS-4307] Parser can't recognize convert function parameters and cause wrong routing decision Created: 2022-09-21 Updated: 2022-09-22 Resolved: 2022-09-22 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | qc_sqlite |
| Affects Version/s: | 2.4, 2.5, 6.4, 22.08 |
| Fix Version/s: | 6.4.3, 22.08.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | danielforever | Assignee: | Johan Wikman |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
in `CONVERT(substring(receive_code,8), UNSIGNED INTEGER)`, UNSIGNED INTEGER is not recognized. The SQL is parsed as QUERY_TYPE_READ. |
| Comments |
| Comment by danielforever [ 2022-09-21 ] |
|
@markus makela |
| Comment by markus makela [ 2022-09-21 ] |
|
Can you try if this affects other releases as well? Given that LOCK IN SHARE MODE and FOR UPDATE do not work outside of a transaction, this doesn't seem like a big problem. Can you confirm that if a transaction is open, the query is still routed to the active master server? |
| Comment by danielforever [ 2022-09-21 ] |
|
here is the thing: if users use `for update` or `LOCK IN SHARE MODE`, they want to route this SQL to the master server. As for the other versions, I've checked the parse.y, it's the same. (It has the same issue). |
| Comment by markus makela [ 2022-09-21 ] |
|
Yes, temporary tables can indeed be missed due to this which will cause problems outside of transactions. |
| Comment by Johan Wikman [ 2022-09-22 ] |
|
daniel_xu_forever If you rewrite CONVERT(substring(receive_code,8), UNSIGNED INTEGER) as CAST(substring(receive_code,8) AS UNSIGNED INTEGER) the whole statement should be parsed correctly. The CONVERT case will be fixed, but it will take a while before it is available. |