[Lxr-dev] [ lxr-Bugs-1209273 ] "release" a reserved word in MySQL 5.x
Brought to you by:
ajlittoz
From: SourceForge.net <no...@so...> - 2006-06-07 08:25:59
|
Bugs item #1209273, was opened at 2005-05-26 16:33 Message generated for change (Comment added) made by lmop You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390117&aid=1209273&group_id=27350 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Database interface Group: None Status: Open Resolution: Accepted Priority: 5 Submitted By: Jeff Warnica (jeffwarnica) Assigned to: Malcolm Box (mbox) Summary: "release" a reserved word in MySQL 5.x Initial Comment: And perhaps earlier versions too. The table lxr_releases can not be created.. The MySQL docs claim that you can use reserved words as identifiers if you quote them, but testing the CREATE TABLE with "release" quoted also failed. ---------------------------------------------------------------------- Comment By: Laurence Passmore (lmop) Date: 2006-06-07 08:25 Message: Logged In: YES user_id=1410237 I think you need to change lib/LXR/Index/Mysql.pm thus: 1) s/r.release/r.`release`/g 2) s/release =/`release` =/g 3) s/ release\)/ `release`\)/g (I say think because I haven't tested it; I currently have other issues with my LXR installation that is preventing me from getting it working at all...) ---------------------------------------------------------------------- Comment By: Malcolm Box (mbox) Date: 2006-06-06 22:24 Message: Logged In: YES user_id=215386 Apparently not a good fix - reopening ---------------------------------------------------------------------- Comment By: Malcolm Box (mbox) Date: 2006-06-05 10:16 Message: Logged In: YES user_id=215386 Now fixed in CVS. Thanks to lmop for the fix. ---------------------------------------------------------------------- Comment By: S Melody (prplehaze2) Date: 2006-05-31 15:37 Message: Logged In: YES user_id=911986 I used this fix to create the tables, but indexing seems to fail, most likely because release is a reserved word: DBD::mysql::st execute failed: 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 'release = 'head'' at line 1 at lib/LXR/Index/Mysql.pm line 209. DBD::mysql::st execute failed: 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 'release) values ('387', 'head')' at line 1 at lib/LXR/Index/Mysql.pm line 213. ---------------------------------------------------------------------- Comment By: Laurence Passmore (lmop) Date: 2005-12-21 17:20 Message: Logged In: YES user_id=1410237 This is a simple fix. initdb-mysql should be changed as follows (basically, backtick (`) the column name `release` to escape/quote it): create table lxr_releases ( fileid int not null references lxr_files, `release` char(255) binary not null, primary key (fileid, `release`) ); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390117&aid=1209273&group_id=27350 |