When trying to update the module from 7.x-1.0-beta25 to 7.x-1.0-beta27, I get the following error

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your     [error]
MySQL server version for the right syntax to use near '))' at line 2

This seems to relate to either the db_update or db_delete command in election_vote_update_7003.

election_vote_update_7002 seems to run correctly.

CommentFileSizeAuthor
#2 election-2621342-2.patch879 bytespjcdawkins

Comments

yeebot created an issue. See original summary.

pjcdawkins’s picture

Status: Active » Needs review
StatusFileSize
new879 bytes

Silly me of 1 year ago... please check this patch

Status: Needs review » Needs work

The last submitted patch, 2: election-2621342-2.patch, failed testing.

pjcdawkins’s picture

Version: 7.x-1.0-beta27 » 7.x-1.x-dev
Status: Needs work » Needs review

yeebot’s picture

Thanks very much for your swift response Patrick! That patch seems to have done the trick.

  • pjcdawkins committed dd591d0 on 7.x-1.x
    Issue #2621342 by yeebot: Update from 7.x-1.0-beta25 to 7.x-1.0-beta27...
pjcdawkins’s picture

Category: Task » Bug report
Status: Needs review » Fixed

Thanks for the report - committed

liam morland’s picture

Is the error that the following code fails when $ballot_ids is an empty array?

->condition('ballot_id', $ballot_ids, 'IN')

If so, that sounds like it is also a bug in the DB abstraction layer. If given an invalid query, it should return false, raise an exception, or something like that, not query the DB server and thereby return a confusing error message.

pjcdawkins’s picture

Yes, this:
->condition('column', array(), 'IN')
translates as:
column IN ()
and that is a syntax error in MySQL

It's possible the abstraction layer doesn't throw an exception when you construct a query like that because some DBs would accept column IN () as valid SQL (and presumably the condition would never match). I'm not sure.

Status: Fixed » Closed (fixed)

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