Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Nonvalid literal value for the boolean type, PDO #4490

Merged
merged 2 commits into from
Nov 22, 2013
Merged

Nonvalid literal value for the boolean type, PDO #4490

merged 2 commits into from
Nov 22, 2013

Conversation

AgentCoop
Copy link
Contributor

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

@ghost ghost assigned ralphschindler May 23, 2013
@ralphschindler
Copy link
Member

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

@edsonhoraciojunior
Copy link

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.

@ralphschindler
Copy link
Member

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?)

@edsonhoraciojunior
Copy link

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'.

@ralphschindler
Copy link
Member

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

ralphschindler pushed a commit that referenced this pull request Nov 22, 2013
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 pushed a commit that referenced this pull request Nov 22, 2013
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
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
Merge branch 'samsonasik-cs/4490' into develop

* samsonasik-cs/4490:
  fix cs of #4490 : eof_ending
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants