Nonvalid literal value for the boolean type, PDO #4490

Merged
merged 2 commits into from Nov 22, 2013

Conversation

Projects
None yet
4 participants
Contributor

AgentCoop commented May 16, 2013

SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type boolean: ""' error has been fixed

@ghost ghost assigned ralphschindler May 23, 2013

Member

ralphschindler commented Nov 18, 2013

Can you show me some reproduction code, also what database platform is this against?

I'm having this same problem, I'm using Postgre Driver.

It happens in a statement with boolean columns. $type remains with \PDO::PARAM_STR's value instead of the correct \PDO::PARAM_BOOL. Therefore if the value is false, SQL tries to insert/update an empty string in a boolean column, causing that error.

Member

ralphschindler commented Nov 22, 2013

I guess what I'm getting at is, did you pass in the bool yourself? And what if you were to pass in bool to the ParameterContainer (also, should we add boolean as a type to the ParameterContainer?)

Actually other components of my application pass the value as a bool, i didn't try creating a PDO Statement from start just to test it. ParameterContainer already has that boolean value inside the property 'data'.

Member

ralphschindler commented Nov 22, 2013

Since this is a bugfix, I think it can go into master.

ralphschindler added a commit that referenced this pull request Nov 22, 2013

PR #4490
Merge branch 'AgentCoop-master'

* AgentCoop-master:
  Added unit tests for PDO bool behavior, added stub for StatementTest
  Empty string is a nonvalid literal value for the PostgreSQL boolean type. Fixed

ralphschindler added a commit that referenced this pull request Nov 22, 2013

Forward #4490
Merge branch 'AgentCoop-master' into develop

* AgentCoop-master:
  Added unit tests for PDO bool behavior, added stub for StatementTest
  Empty string is a nonvalid literal value for the PostgreSQL boolean type. Fixed

@ralphschindler ralphschindler merged commit 0db5aa2 into zendframework:develop Nov 22, 2013

1 check passed

default The Travis CI build passed
Details

samsonasik added a commit to samsonasik/zf2 that referenced this pull request Nov 23, 2013

ralphschindler added a commit that referenced this pull request Nov 23, 2013

Forward #5529
Merge branch 'samsonasik-cs/4490' into develop

* samsonasik-cs/4490:
  fix cs of #4490 : eof_ending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment