db-sync icon indicating copy to clipboard operation
db-sync copied to clipboard

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

Open afeno opened this issue 4 years ago • 3 comments

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!

afeno avatar Jun 02 '21 22:06 afeno

Hi

I'm sorry to hear it's not working for you!

Could you share the command you're using to run dbsync and also the "create table" statement (the table structure) for the table you're trying to sync?

Cheers Joe Green

On 2 Jun 2021, at 23:38, afeno @.***> wrote:

 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!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

mrjgreen avatar Jun 03 '21 07:06 mrjgreen

Hi, I don't know what you are talking about. Sorry but I didn't send this message. Regards.

El jue, 3 jun 2021 a las 2:54, Joe Green @.***>) escribió:

Hi

I'm sorry to hear it's not working for you!

Could you share the command you're using to run dbsync and also the "create table" statement (the table structure) for the table you're trying to sync?

Cheers Joe Green

On 2 Jun 2021, at 23:38, afeno @.***> wrote:

 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!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mrjgreen/db-sync/issues/49#issuecomment-853664162, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7K5YZQS2AILVJVUPY657DTQ4YKDANCNFSM457TKK2Q .

-- Germán García Fernández

ggarciaf avatar Jun 03 '21 21:06 ggarciaf

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!

afeno avatar Jun 04 '21 06:06 afeno