Per sql standards keywords should be upper case.
Currently coder module doesn't check for this, but it would be nice if it did.
In the same territory, coder misses the need for {} around table names..
Per sql standards keywords should be upper case.
Currently coder module doesn't check for this, but it would be nice if it did.
In the same territory, coder misses the need for {} around table names..
Comments
Comment #1
douggreen commentedI marked this as "code needs review" even though it is already committed. I marked it such so that it will get some testing, and additional community input.
I've added a basic sql review to both 5.x and 6.x. It catches some lower case keywords, and most unbracketed table names. It doesn't catch mixed case keywords, nor does it catch the multitude of valid SQL keywords. It basically looks for INSERT|UPDATE|SELECT|DELETE (with some additional words needed to make sure it's a SQL string instead of a help message). It doesn't catch unbracketed table names in joins.
I ran it against core, and it did fairly well, finding one real error in upload.module:
But it also found some exceptions such as pg_proc in system.install and temp_search_sids in search.module. I'm not sure about pg_proc. I know that the temp_search_sids is actually OK as-is; but a case could be made to bracketing it for consistency -- even though this is just a temporary table.
I've marked it as a "new" review pending testing. Please test it. Once it's confirmed to work well, I'll remove the "new review" message.
Comment #2
gregglesAwesome - thanks Doug.
I've read several patches and seen discussions of several fixes to core which were found with this new feature. Well done.
Comment #3
douggreen commentedAs this has already been committed, and is now quite old, I'm marking as fixed.
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.