r/badcode •

[deleted by user]

[deleted] — view deleted post

0 Upvotes

87 comments sorted by

View all comments

Show parent comment

1

u/Tynach Jan 03 '19

I recreated the logic in a script and it runs fine without a DB (just pulling out of a word list instead). So... Perhaps something to do with the database query, or how you're using the MySQLdb API?

I have noticed that you have a multi-column primary key for some reason, and you're not using parameterized queries or prepared statements. Though you don't specify which way around the multi-column primary key is, I don't think that should matter.

If I weren't feeling lazy I'd recreate the table and test your code as-is. But I am, so..

1

u/Achereto Jan 03 '19

Yes, the use of that MySQL API is essential to create the infinite loop. :)