|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-08-29 14:33 UTC] rod at zend dot com
[2016-08-29 18:11 UTC] steven at excelsystems dot com
[2016-08-31 22:08 UTC] rod at zend dot com
[2016-10-12 17:53 UTC] rod at zend dot com
[2018-03-29 02:08 UTC] jdlkramer at gmail dot com
[2018-06-05 20:26 UTC] webart dot video at gmail dot com
[2020-12-11 16:14 UTC] calvinb@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: calvinb
[2020-12-11 16:14 UTC] calvinb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 19:00:01 2025 UTC |
Description: ------------ Environment Information: System: IBM i w/ i5/OS V7R1 PHP Version: 5.6.22 ZendServer Version: 8.5.0 pdo_ibm Version: 1.3.3-sg3 When running PHP 5.6.22 via FastCGI on i5/OS V7R1 with "SetEnv="CCSID=1208"" in the FastCGI config, the following error is thrown when trying to do an UPDATE or INSERT statement that has an empty string as the value for a character field: -191 - Mixed data or UTF-8 data not properly formed. (SQLExecute[-191] at /patched-php-src-5.6.22/php-5.6.22/ext/pdo_ibm/ibm_statement.c:974) This error is thrown when $statement->execute() is called. This same error doesn't occur when the environment CCSID is set to 819 in the FastCGI config. SQL Trace: 00000010:721696 SQL CLI: SQLAllocHandle ( <Allocate Handle Type> , <Associated Handle> , <Generated Handle> ) 00000010:721696 SQL CLI: SQLAllocHandle INPUT: Allocate Handle Type: SQL_HANDLE_STMT 00000010:721696 SQL CLI: SQLAllocHandle INPUT: Associated Handle (CONN): 2 00000010:721696 SQL CLI: SQLAllocHandle OUTPUT: Generated Handle: 3 00000010:721696 SQL CLI: SQLAllocHandle DEBUG: MESSAGE: HANDLE ALLOCATED 00000010:721712 SQL CLI: SQLPrepare ( 3 , <SQL statement> , <statement len> ) 00000010:721712 SQL CLI: SQLPrepare INPUT: SQL statement: INSERT INTO QTEMP.PDOTEST VALUES (?) WITH NC 00000010:721712 SQL CLI: SQLPrepare INPUT: Statement len: 44 00000010:740288 SQL CLI: SQLNumResultCols ( 3 , SQLSMALLINT* ) 00000010:740296 SQL CLI: SQLGetInfo ( 2 , 18 , <Buffer val> , 30 , <Buffer len> ) 00000010:740304 SQL CLI: SQLGetInfo OUTPUT: Buffer val: 00000010:740304 SQL CLI: SQLGetInfo OUTPUT: Buffer len: 5 00000010:740368 SQL CLI: SQLDescribeParam ( 3 , 1 , SQLSMALLINT* , SQLINTEGER* , SQLSMALLINT* , SQLSMALLINT* ) 00000010:740376 SQL CLI: SQLBindParameter ( 3 , 1 , 1 , 1 , 1 , 10 , 0 , SQLPOINTER, 0 , SQLINTEGER* ) 00000010:751120 SQL CLI: SQLExecute ( 3 ) *SQL ERROR* 00000010:751136 SQL CLI: SQLGetDiagRec ( 3 , 3 , 1 , SQLCHAR* , SQLINTEGER* , SQLCHAR* , 512 , SQLSMALLINT* ) 00000010:751176 SQL CLI: SQLGetDiagField ( 3 , 3 , 1 , 13 , SQLPOINTER , 518 , SQLSMALLINT* ) 00000010:751176 SQL CLI: SQLCancel ( 3 ) 00000010:751368 SQL CLI: SQLFreeStmt ( 3 , 1 ) 00000010:751384 SQL CLI: SQLDisconnect ( 2 ) 00000010:751424 SQL CLI: SQLFreeHandle ( 2 , 2 ) 00000010:751568 SQL CLI: SQLFreeHandle ( 1 , 1 ) Test script: --------------- <?php // Connect, create temp table $dbConnection = new PDO('ibm:', NULL, NULL); $createSql = 'CREATE TABLE QTEMP.PDOTEST (VAL CHAR(10) NOT NULL)'; $result = $dbConnection->exec($createSql); // Try to insert blank value $insertSql = 'INSERT INTO QTEMP.PDOTEST VALUES (:VAL) WITH NC'; $statement = $dbConnection->prepare($insertSql); $statement->bindValue(':VAL', ''); $result = $statement->execute(); if ($result === false) { $error = $dbConnection->errorInfo(); die('<b>Error executing insert statement. Err#' . $error[1] . ' - ' . $error[2] . '</b>'); } echo "Made it past all the SQL"; ?> Expected result: ---------------- Expected screen output is "Made it past all the SQL" Actual result: -------------- Error executing insert statement. Err#-191 - Mixed data or UTF-8 data not properly formed. (SQLExecute[-191] at /patched-php-src-5.6.22/php-5.6.22/ext/pdo_ibm/ibm_statement.c:974)