I was getting errors when analyzing tables like this:
# User warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'maxvalue) VALUES (33, 'tid', 0, 1, 1, 0, 0, 0, 'serial', 4, 142)' at line 1 query: INSERT INTO tw_columns (twtid, colname, weight, primarykey, availablefk, secure, ignorecol, isempty, coltype, minvalue, maxvalue) VALUES (33, 'tid', 0, 1, 1, 0, 0, 0, 'serial', 4, 142) in _db_query() (line 148 of /Users/steverude/Documents/workspace/guitarworld.com/httpdocs/includes/database.mysqli.inc).
# User warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'maxvalue) VALUES (33, 'vid', 1, 0, 0, 0, 0, 0, 'int', 2, 7)' at line 1 query: INSERT INTO tw_columns (twtid, colname, weight, primarykey, availablefk, secure, ignorecol, isempty, coltype, minvalue, maxvalue) VALUES (33, 'vid', 1, 0, 0, 0, 0, 0, 'int', 2, 7) in _db_query() (line 148 of /Users/steverude/Documents/workspace/guitarworld.com/httpdocs/includes/database.mysqli.inc).
# User warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'maxvalue) VALUES (33, 'weight', 4, 0, 0, 0, 0, 0, 'int', -10, 9)' at line 1 query: INSERT INTO tw_columns (twtid, colname, weight, primarykey, availablefk, secure, ignorecol, isempty, coltype, minvalue, maxvalue) VALUES (33, 'weight', 4, 0, 0, 0, 0, 0, 'int', -10, 9) in _db_query() (line 148 of /Users/steverude/Documents/workspace/guitarworld.com/httpdocs/includes/database.mysqli.inc).
You are using minvalue and maxvalue as column names in tw_column. Per #141051: [Obsolete] List of SQL reserved words these are SQL reserved keywords. Need to change these to something else. I am changing these to minnumvalue and maxnumvalue in order to avoid the problem with name clashes with the SQL reserved keywords.
Please see attached patch.
Comments
Comment #1
slantview commentedPatch attached this time.
Comment #2
slantview commentedIgnore the last patch, needed to add update hook for changing existing tables.
Comment #3
slantview commentedComment #4
slantview commentedBump. I know you don't want to work on this any more in favor of data module, but if you need someone to make the commits just give me git access and I'll update the module for you.
Comment #5
chrisnovak commentedI am seeing this issue as well. Can we get this patch added? Thanks
Comment #6
elliotttf commentedI am seeing this too and can confirm the changes in this patch resolve the issue.
Comment #7
Alex Andrascu commentedComment #8
Alex Andrascu commentedComment #9
lquessenberry commentedHas this been fixed in the latest version?
Comment #10
pwolanin commentedI just ran into this too and was quite confused for a while.
@lquessenberry - it's still waiting to be committed it seems - I'm not sure that patch is in the right format either.
Comment #11
MixologicI too, randomly ran into this.
The patch is old, yes, but it applies. And it fixes the issue I had adding some functionality to an old D6 site.
Comment #12
MixologicStill RTBC. But no committers.