DDC-2607: [GH-753] JoinedSubclassPersister doesn't properly bind on some versions of php #3338

Closed
doctrinebot opened this Issue Aug 12, 2013 · 2 comments

2 participants

@doctrinebot

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of 51systems:

Url: #753

Message:

I ran into this bug after deploying an application to production:

 An exception occurred while executing 'INSERT INTO TextSprite (id, text, fontId) VALUES (?, ?, ?)' with params ["4"]:

    SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens

The parent table is being inserted properly (It's where the single param 4 comes from for the id), but the child table insert fails.

This was on a shared host with PHP version 5.3.24. On my development machine, everything works fine.

The issue is when the id is not a composite key, it's just a string (in this case), and for whatever reason !isset($id[$columnName]) fails to return a sane value on my production version of php.

By adding a check to see if the ID is an array we can determine if its a composite key, and not bother with the column checks if its not.

Not sure how to write unit tests for this one since it only affects certain versions of PHP (apparently). So advice on that is appreciated.

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-753] was closed:
#753

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.3.5 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment