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

') < ()) t limit 1' added into the query #49

Open
afeno opened this issue Jun 2, 2021 · 3 comments
Open

') < ()) t limit 1' added into the query #49

afeno opened this issue Jun 2, 2021 · 3 comments

Comments

@afeno
Copy link

afeno commented Jun 2, 2021

Hello,
I really want db-sync to work with my databases but I can't run the command.
For some reason, the scrip is adding some strange characters into query and generating this error:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') < ()) t limit 1' at line 1

This is the full query created by the script:
select CONCAT(COALESCE(LOWER(CONV(BIT_XOR(CAST(CONV(SUBSTR(MD5(CONCAT_WS('#',ID, asin, categories, VERSION)),17,16),16,10) AS UNSIGNED)), 10, 16)), 0),COALESCE(LOWER(CONV(BIT_XOR(CAST(CONV(SUBSTR(MD5(CONCAT_WS('#', ID, asin, categories, VERSION)),1,16),16,10) AS UNSIGNED)), 10, 16)), 0)) from (select ID, asin, categories, VERSIONfromlibrospa_amazon.Tasin where () < ()) t limit 1

How can I fix it? Why it is not working?

Thanks! Great work!

@mrjgreen
Copy link
Owner

mrjgreen commented Jun 3, 2021 via email

@ggarciaf
Copy link

ggarciaf commented Jun 3, 2021 via email

@afeno
Copy link
Author

afeno commented Jun 4, 2021

Hi mrjgreen,
Thank you for answering so quickly.
I found the problem. I was missing the primary key in the destination table.
Now I added the primary ID and it is working fine.
Thanks for creating this great product.
Kind regards!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants