Technically it's infinite recursive calls that will make the program crash eventually, yes. But why and when that happens is a bit hidden and might be surprising.
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..
View all comments
Show parent comment
1
u/Achereto Jan 02 '19 edited Jan 02 '19
Technically it's infinite recursive calls that will make the program crash eventually, yes. But why and when that happens is a bit hidden and might be surprising.