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.

CommentFileSizeAuthor
#2 tw_1100896_2.patch6.84 KBslantview
#1 tw_1100896_1.patch6.11 KBslantview

Comments

slantview’s picture

StatusFileSize
new6.11 KB

Patch attached this time.

slantview’s picture

StatusFileSize
new6.84 KB

Ignore the last patch, needed to add update hook for changing existing tables.

slantview’s picture

Status: Active » Needs review
slantview’s picture

Bump. 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.

chrisnovak’s picture

I am seeing this issue as well. Can we get this patch added? Thanks

elliotttf’s picture

Status: Needs review » Reviewed & tested by the community

I am seeing this too and can confirm the changes in this patch resolve the issue.

Alex Andrascu’s picture

Assigned: Unassigned » Alex Andrascu
Alex Andrascu’s picture

Version: 6.x-1.3 » 6.x-1.x-dev
lquessenberry’s picture

Has this been fixed in the latest version?

pwolanin’s picture

I 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.

Mixologic’s picture

I 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.

Mixologic’s picture

Issue summary: View changes

Still RTBC. But no committers.