Skip to content
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

Backport sqlparser patch - 14763 Fix accepting bind variables in time related function calls. #589

Closed
wants to merge 3 commits into from

Conversation

tanjinx
Copy link

@tanjinx tanjinx commented Jan 22, 2025

Description

during the upgrade from v15 to v19, we hit this sql error:

the query only works on v19 vtgate (w/ v15 and v19 tablets):
on a v19 vtgate:
mysql> use lists; select UNIX_TIMESTAMP(NOW(6))*1000000; //<= v15 tablets 
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
+--------------------------------------------+
| UNIX_TIMESTAMP(now(6)) * :vtg1 /* INT64 */ |
+--------------------------------------------+
|                    1737522009882463.000000 |
+--------------------------------------------+
1 row in set (0.01 sec)

mysql> use byuser; select UNIX_TIMESTAMP(NOW(6))*1000000; //<= v19 tablets
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
+--------------------------------------------+
| UNIX_TIMESTAMP(now(6)) * :vtg1 /* INT64 */ |
+--------------------------------------------+
|                    1737522017085859.000000 |
+--------------------------------------------+
1 row in set (0.00 sec)
but not working on v15 vtgates (w/ v19 tablets):
mysql> use lists; select UNIX_TIMESTAMP(NOW(6))*1000000;  //<= v15 tablets
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
+----------------------------------+
| UNIX_TIMESTAMP(now(6)) * 1000000 |
+----------------------------------+
|          1737522031680930.000000 |
+----------------------------------+
1 row in set (0.00 sec)

mysql> use byuser; select UNIX_TIMESTAMP(NOW(6))*1000000; //<= v19 tablets
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
ERROR 1105 (HY000): target: byuser.8000-c000.primary: vttablet: rpc error: code = InvalidArgument desc = syntax error at position 32 near ':vtg1' (CallerID: vt_appdebug_b)

which is exactly the same problem as vitessio#14740. It was fixed in this patch vitessio#14763, now to make the upgrade v15->v19 work, we need to patch v19 temporarily. After all vtgates on v19, will revert this change.

Related Issue(s)

Checklist

  • "Backport to:" labels have been added if this change should be back-ported
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on the CI
  • Documentation was added or is not required

Deployment Notes

@tanjinx tanjinx requested a review from a team as a code owner January 22, 2025 21:01
Copy link

Thanks for the contribution! Before we can merge this, we need @GuptaManan100 to sign the Salesforce Inc. Contributor License Agreement.

@github-actions github-actions bot added this to the v19.0.7 milestone Jan 22, 2025
@tanjinx
Copy link
Author

tanjinx commented Jan 22, 2025

closing as dup of #590

@tanjinx tanjinx closed this Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants