Since MySQLdb uses paramstyle 'format', literal "%" has to be escaped as "%%". However, if you do a query without parameters using cursor.execute(sql), "%%" remains literal "%%". Workaround is to use cursor.execute(sql,())
I suppose it could default the parameters to (), and I think that won't break anything, but I'll have to test it.
Log in to post a comment.
I suppose it could default the parameters to (), and I think that won't break anything, but I'll have to test it.