Author Topic: DB Error: Bad SQL Query: INSERT INTO 4images_wordmatch ... Duplicate entry ...  (Read 10606 times)

0 Members and 1 Guest are viewing this topic.

Offline adrianTNT

  • Newbie
  • *
  • Posts: 14
    • View Profile
Hello, I get this error on the page that shows the jpg right after it was uploaded:

DB Error: Bad SQL Query: INSERT INTO 4images_wordmatch (image_id, word_id, name_match, desc_match, keys_match) SELECT DISTINCT 77, word_id, 0, 1, 0 FROM 4images_wordlist WHERE word_text = 'murcielago'
Duplicate entry '77-178' for key 1

Edit: it seems to be happening if i have 2 words like this in description:
Murciélago Murcielago

Anyone has an idea?
Thank you.
« Last Edit: March 10, 2007, 04:27:02 PM by adrianTNT »

Offline k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
I also get this error from time to time. When uploading/editing the pics... Its a bit annoying  :roll:


Offline adrianTNT

  • Newbie
  • *
  • Posts: 14
    • View Profile
I think it has to do with the special characters, in my case the é from Murciélago.
Did you noticed teh same thing ?

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Hi,,

- have you add a table in db  :?:
http://www.4homepages.de/forum/index.php?topic=1313.0

- have you forgot to rebuilt the search index  :?:
http://www.4homepages.de/forum/index.php?topic=6718.0
- have you edit anything  :?:
- Link :?:


cu
Kurt

Offline k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Those errors are still emerging from time to time... a bit annoying  :|
I also think it has to do something with non-latin characters in `4im_wordlist` (`word_text` items).

The errors are:
Code: [Select]
DB Error: Bad SQL Query: INSERT INTO 4im_wordmatch (image_id, word_id, name_match, desc_match, keys_match) SELECT DISTINCT 2199, word_id, 0, 1, 0 FROM 4im_wordlist WHERE word_text = 'Ioni?'
Duplicate entry '2199-272' for key 1
...
DB Error: Bad SQL Query: INSERT INTO 4im_wordmatch (image_id, word_id, name_match, desc_match, keys_match) SELECT DISTINCT 2202, word_id, 0, 0, 1 FROM 4im_wordlist WHERE word_text = 'i?i?ua'
Duplicate entry '2202-12360' for key 1
Фотография была отредактирована.
only numbers and the werds themselves differ.
These errrors appear after adding a picture or after modifying it.

2 KurtW: I didn't add tables in DB since I didn't add any additional fields.
And I didn't rebuild search index. Why should I?  :)

P.S: I already wrote about this issue here, but it had no answeres...


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Have you tried change collation (encoding) in mysql to match the encoding you are using on the site?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Have you tried change collation (encoding) in mysql to match the encoding you are using on the site?
Hmm...I think no  :roll:
For You to be able to see whether something is wrong with my mysql encoding and collations - I've made 3 screenshots inside my PHPMyAdmin: first, second, and third screenshot. :|


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Well according to your third screenshot all tables are using cp1251 encoding, but 4im_wordmatch uses latin and that's the table produces error.
First thing I'd suggest you do is backup your database via phpmyadmin.
Then open 4im_wordmatch table, then click on "operations" ("операции") and change collation to cp1251. Hopefully it won't break existing keywords, if it did, simply run "recreate keywords" plugin in ACP.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Well according to your third screenshot all tables are using cp1251 encoding, but 4im_wordmatch uses latin and that's the table produces error.
First thing I'd suggest you do is backup your database via phpmyadmin.
Then open 4im_wordmatch table, then click on "operations" ("операции") and change collation to cp1251. Hopefully it won't break existing keywords, if it did, simply run "recreate keywords" plugin in ACP.
Thanks, V@no! I did just what You`ve pointed out... Existing keywords are working just fine as before,  but I still get those errors while trying ti modify some of the existing posts, for example: screenshot .
Maybe that is because I haven't run the "Rebuild search index Plugin"?  Or maybe it doesn't matter  :roll: