The Error:
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 'I last modified' tab, access 'Published' tab' WHERE rid = 2' at line 1 query: UPDATE permission SET perm = 'access send to friend, report abuse, show..............................................

The failed update:

Failed: UPDATE {permission} SET perm = 'access PDF version, report abuse, show advertisements, enable add another, view addtoany, view advanced help popup, view passwords, access news feeds, apply for roles, collapse format fieldset by default, collapsible format selection, show format selection for blocks, show format selection for comments, show format selection for nodes, show format tips, show more format tips link, access bitstreams, list bitstreams, upload bitstreams, create blog entries, delete own blog entries, edit own blog entries, administer content with blog api, access printer-friendly version, check out documents, keep documents checked out, access comments, post comments, access site-wide contact form, administer site-wide contact form, grant own content access, edit field_profile_picture, view field_contractor_location, view field_contractor_sales, view field_contractor_service, view field_contractor_user, view field_profile_picture, view field_stormproject_location, view date repeats, access DAV resources, view faq page, ask question, create favorite nodes, view favorite nodes, advanced feedapi options, access feedback form, create file content, delete own file content, edit own file content, attach files, view attached files, browse files, create terms, upload files, embed files, view files, get own binary files, use advanced options, use basic options, use display options, create forum topics, delete own forum topics, edit own forum topics, set user location, show node map, show user map, user locations, create gmap macro, create images, edit own images, view original images, send invitations, track invitations, withdraw accepted invitations, view own invite statistics, apply for jobs, manage job applications, view jobs, access own broken links report, use live comment preview, use live node preview, translate interface, submit latitude/longitude, set own user location, view own user location, macro access, access multiform content, access content, create profile content, delete own profile content, edit own profile content, revert revisions, view revisions, load own node data, maintain own subscriptions, manage own subscriptions, skip notifications, subscribe to content, view own access token, set personal openid url, use panels caching features, use panels dashboard, administer mini panels, create mini panels, create panel-nodes, edit own panel-nodes, notify of path changes, cancel own vote, inspect all votes, vote on polls, access print, node-specific print configuration, read privatemsg, write privatemsg, create private message tags, filter private messages, tag private messages, access RDF data, view node relations, view own role history, access services, administer signups for own content, cancel own signups, edit own signups, email users signed up for own content, sign up for content, Storm: access dashboard, Storm attribute: access, Storm invoice: access, Storm note: access, Storm note: add, Storm note: delete own, Storm note: edit own, Storm note: view own, Storm organization: access, Storm organization: add, Storm organization: delete own, Storm organization: edit own, Storm organization: view belonged, Storm organization: view own, Storm person: access, Storm person: add, Storm person: delete own, Storm person: edit own, Storm person: view of user organization, Storm person: view own, Storm project: access, Storm project: add, Storm project: delete own, Storm project: edit own, Storm project: view of user organization, Storm project: view own, Storm task: access, Storm task: add, Storm task: delete own, Storm task: edit own, Storm task: view of user organization, Storm task: view own, Storm teammember: access, Storm teammember: add, Storm teammember: view of user organization, Storm ticket: access, Storm ticket: add, Storm ticket: delete own, Storm ticket: edit own, Storm ticket: view own, Storm timetracking: access, Storm timetracking: add, Storm timetracking: delete own, Storm timetracking: edit own, Storm timetracking: view of user organization, Storm timetracking: view own, send mail from remote, view uploaded files, access user profiles, grant delete permission to related users, grant update permission to related users, grant view permission to related users, can have relationships, maintain own relationships, view user relationships, delete own user, get own user data, update own user data, download vcard, download vcard with e-mail, have vcard, access 'I last modified' tab, access 'Published' tab' WHERE rid = 2

Comments

chadd’s picture

i get the same error

Failed: UPDATE {permission} SET perm = 'access PDF version, ....

roball’s picture

No problem here (using mysql-server 5.1.37 on CentOS 5.3).

jcnventura’s picture

I think that the problem will only show up in setups where there are permissions that include quotes in the name. In 99% of the cases it won't cause any problem. For the 1% that want problems (i.e. defined permissions with quotes), I will fix the code, but the solution will be to enable the permissions manually.

chadd’s picture

awesome, thanks for fixing this.

broon’s picture

This is the closest one to my issue so I'm posting it here. I'm using Drupal 6.13, too and if download print module 1.8 it still says it's 1.7 on the available updates page:

Printer, e-mail and PDF versions 6.x-1.7
Security update: 6.x-1.8 (2009-Aug-20)

I deleted the old folder and replaced it with downloaded one, I ran update.php and checked manually again, still this message appears. In print.info it tells me "6.x-1.8" as version. What could be the error?

rdp mac’s picture

Thanks in advance for fixing the code. I had the same problem using MySQL 5.1.32. If you find useful the error report from my site, I'll send it to you.

broon’s picture

Never mind my 'bug' mentioned in #5. I found the error, instead of deleting the old folder it was apparently renamed to print.old and the modules system was irritated by this second folder. Final deletion solved the issue.

jcnventura’s picture

Status: Active » Fixed

The new permissions string is now passed through db_escape_string() to properly escape the quotes and prevent this type of error.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.