Bug #80790 [Opn->Fbk]: PDO ODBC cannot insert BLOB records to Oracle database

From: Date: Tue, 23 Feb 2021 15:23:38 +0000
Subject: Bug #80790 [Opn->Fbk]: PDO ODBC cannot insert BLOB records to Oracle database
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232356@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80790&edit=1 ID: 80790 Updated by: cmb@php.net Reported by: horvath dot szabolcs at t-systems dot hu Summary: PDO ODBC cannot insert BLOB records to Oracle database -Status: Open +Status: Feedback Type: Bug Package: PDO ODBC Operating System: Red Hat Enterprise Linux Server PHP Version: 7.3.27 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: > Although 7.3.27 is out there, I read thoroughly the changelog > and haven't found similar bug between 7.3.20 and 7.3.27. Please note that we do no longer actively support PHP 7.3[1]. > INSERT INTO HSZ (ID, PDF) VALUES (SEQ_HSZ.NEXTVAL, ?) > INSERT INTO HSZ(ID, PDF) VALUES(SEQ_HSZ.NEXTVAL, EMPTY_BLOB()) RETURNING PDF INTO ? You are using rather different queries for ODBC and PDO_ODBC. What would happen, if you swapped the queries? [1] <https://www.php.net/supported-versions.php> Previous Comments: ------------------------------------------------------------------------ [2021-02-23 11:51:45] horvath dot szabolcs at t-systems dot hu pdo-3997.log (throws ORA-01461: can bind a LONG value only for insert into a LONG column) [ODBC][9790][1614079877.745882][SQLConnect.c][3721] Entry: Connection = 0x55e8d42ec7d0 Server Name = [ORACLETEST][length = 11 (SQL_NTS)] User Name = [eberjegyzek][length = 11 (SQL_NTS)] Authentication = [********][length = 8 (SQL_NTS)] UNICODE Using encoding ASCII 'UTF-8' and UNICODE 'UTF16LE' [ODBC][9790][1614079877.851569][SQLConnect.c][4299] Exit:[SQL_SUCCESS] [ODBC][9790][1614079877.851734][SQLAllocHandle.c][540] Entry: Handle Type = 3 Input Handle = 0x55e8d42ec7d0 [ODBC][9790][1614079877.851847][SQLAllocHandle.c][1085] Exit:[SQL_SUCCESS] Output Handle = 0x55e8d43a4ba0 [ODBC][9790][1614079877.851907][SQLPrepare.c][196] Entry: Statement = 0x55e8d43a4ba0 SQL = [INSERT INTO HSZ(ID, PDF) VALUES(SEQ_HSZ.NEXTVAL, EMPTY_BLOB()) RETURNING PDF INTO ?][length = 83 (SQL_NTS)] [ODBC][9790][1614079877.853683][SQLPrepare.c][377] Exit:[SQL_SUCCESS] [ODBC][9790][1614079877.854132][SQLDescribeParam.c][185] Entry: Statement = 0x55e8d43a4ba0 Parameter Number = 1 SQL Type = 0x7ffcaf547152 Param Def = 0x7ffcaf547158 Scale = 0x7ffcaf547154 Nullable = 0x7ffcaf547156 [ODBC][9790][1614079877.854193][SQLDescribeParam.c][338] Exit:[SQL_SUCCESS] SQL Type = 0x7ffcaf546c40 Param Def = 0x7ffcaf546d30 Scale = 0x7ffcaf546e20 Nullable = 0x7ffcaf546f10 [ODBC][9790][1614079877.854244][SQLBindParameter.c][217] Entry: Statement = 0x55e8d43a4ba0 Param Number = 1 Param Type = 1 C Type = 1 SQL_C_CHAR SQL Type = 12 SQL_VARCHAR Col Def = 999 Scale = 0 Rgb Value = 0x7f705200b230 Value Max = 0 StrLen Or Ind = 0x7f70520013e0 [ODBC][9790][1614079877.854293][SQLBindParameter.c][434] Exit:[SQL_SUCCESS] [ODBC][9790][1614079877.854349][SQLSetConnectAttr.c][399] Entry: Connection = 0x55e8d42ec7d0 Attribute = SQL_ATTR_AUTOCOMMIT Value = (nil) StrLen = -6 [ODBC][9790][1614079877.854398][SQLSetConnectAttr.c][862] Exit:[SQL_SUCCESS] [ODBC][9790][1614079877.854495][SQLExecute.c][187] Entry: Statement = 0x55e8d43a4ba0 [ODBC][9790][1614079877.854548][SQLExecute.c][357] Exit:[SQL_NEED_DATA] [ODBC][9790][1614079877.854594][SQLParamData.c][166] Entry: Statement = 0x55e8d43a4ba0 Value = 0x7ffcaf5472d0 [ODBC][9790][1614079877.854728][SQLParamData.c][362] Exit:[SQL_NEED_DATA] Value = 0x7f705200b230 [ODBC][9790][1614079877.854787][SQLPutData.c][148] Entry: Statement = 0x55e8d43a4ba0 Data = 0x7f7052085018 StrLen = 3997 [ODBC][9790][1614079877.854914][SQLPutData.c][315] Exit:[SQL_SUCCESS] [ODBC][9790][1614079877.854964][SQLParamData.c][166] Entry: Statement = 0x55e8d43a4ba0 Value = 0x7ffcaf5472d0 [ODBC][9790][1614079877.858501][SQLParamData.c][362] Exit:[SQL_ERROR] Value = 0x7f705200b230 DIAG [HY000] [Oracle][ODBC][Ora]ORA-01461: can bind a LONG value only for insert into a LONG column [ODBC][9790][1614079877.858707][SQLGetDiagRec.c][677] Entry: Statement = 0x55e8d43a4ba0 Rec Number = 1 SQLState = 0x7f705200c298 Native = 0x7f705200c4a0 Message Text = 0x7f705200c29e Buffer Length = 511 Text Len Ptr = 0x7ffcaf546e4a [ODBC][9790][1614079877.858789][SQLGetDiagRec.c][726] Exit:[SQL_SUCCESS] SQLState = HY000 Native = 0x7f705200c4a0 -> 1461 Message Text = [[Oracle][ODBC][Ora]ORA-01461: can bind a LONG value only for insert into a LONG column ] [ODBC][9790][1614079877.858839][SQLGetDiagRec.c][677] Entry: Statement = 0x55e8d43a4ba0 Rec Number = 2 SQLState = 0x7ffcaf546e50 Native = 0x7ffcaf546e4c Message Text = 0x7ffcaf546e60 Buffer Length = 1023 Text Len Ptr = 0x7ffcaf546e4a [ODBC][9790][1614079877.858885][SQLGetDiagRec.c][726] Exit:[SQL_NO_DATA] [ODBC][9790][1614079877.858957][SQLEndTran.c][417] Entry: Connection = 0x55e8d42ec7d0 Completion Type = 0 [ODBC][9790][1614079877.860414][SQLGetInfo.c][236] Entry: Connection = 0x55e8d42ec7d0 Info Type = SQL_CURSOR_COMMIT_BEHAVIOR (23) Info Value = 0x55e8d42edc48 Buffer Length = 2 StrLen = 0x7ffcaf547270 [ODBC][9790][1614079877.860489][SQLGetInfo.c][236] Entry: Connection = 0x55e8d42ec7d0 Info Type = SQL_CURSOR_ROLLBACK_BEHAVIOR (24) Info Value = 0x55e8d42edc4a Buffer Length = 2 StrLen = 0x7ffcaf547270 [ODBC][9790][1614079877.860541][SQLEndTran.c][566] Exit:[SQL_SUCCESS] [ODBC][9790][1614079877.860589][SQLSetConnectAttr.c][399] Entry: Connection = 0x55e8d42ec7d0 Attribute = SQL_ATTR_AUTOCOMMIT Value = 0x1 StrLen = -6 [ODBC][9790][1614079877.860636][SQLSetConnectAttr.c][862] Exit:[SQL_SUCCESS] [ODBC][9790][1614079877.860731][SQLFreeHandle.c][387] Entry: Handle Type = 3 Input Handle = 0x55e8d43a4ba0 [ODBC][9790][1614079877.860813][SQLFreeHandle.c][490] Exit:[SQL_SUCCESS] [ODBC][9790][1614079877.860869][SQLEndTran.c][417] Entry: Connection = 0x55e8d42ec7d0 Completion Type = 1 [ODBC][9790][1614079877.862398][SQLEndTran.c][566] Exit:[SQL_SUCCESS] [ODBC][9790][1614079877.862453][SQLDisconnect.c][208] Entry: Connection = 0x55e8d42ec7d0 [ODBC][9790][1614079878.832728][SQLDisconnect.c][379] Exit:[SQL_SUCCESS] [ODBC][9790][1614079878.832929][SQLFreeHandle.c][290] Entry: Handle Type = 2 Input Handle = 0x55e8d42ec7d0 [ODBC][9790][1614079878.832987][SQLFreeHandle.c][339] Exit:[SQL_SUCCESS] [ODBC][9790][1614079878.833025][SQLFreeHandle.c][220] Entry: Handle Type = 1 Input Handle = 0x55e8d42ec1d0 ------------------------------------------------------------------------ [2021-02-23 11:50:56] horvath dot szabolcs at t-systems dot hu pdo-100.log (BLOB column 0 bytes long after insert) [ODBC][9810][1614079785.407589][SQLConnect.c][3721] Entry: Connection = 0x55e8d4313ea0 Server Name = [ORACLETEST][length = 11 (SQL_NTS)] User Name = [eberjegyzek][length = 11 (SQL_NTS)] Authentication = [********][length = 8 (SQL_NTS)] UNICODE Using encoding ASCII 'UTF-8' and UNICODE 'UTF16LE' [ODBC][9810][1614079785.532017][SQLConnect.c][4299] Exit:[SQL_SUCCESS] [ODBC][9810][1614079785.532353][SQLAllocHandle.c][540] Entry: Handle Type = 3 Input Handle = 0x55e8d4313ea0 [ODBC][9810][1614079785.532611][SQLAllocHandle.c][1085] Exit:[SQL_SUCCESS] Output Handle = 0x55e8d442c780 [ODBC][9810][1614079785.532881][SQLPrepare.c][196] Entry: Statement = 0x55e8d442c780 SQL = [INSERT INTO HSZ(ID, PDF) VALUES(SEQ_HSZ.NEXTVAL, EMPTY_BLOB()) RETURNING PDF INTO ?][length = 83 (SQL_NTS)] [ODBC][9810][1614079785.534935][SQLPrepare.c][377] Exit:[SQL_SUCCESS] [ODBC][9810][1614079785.535794][SQLDescribeParam.c][185] Entry: Statement = 0x55e8d442c780 Parameter Number = 1 SQL Type = 0x7ffcaf547152 Param Def = 0x7ffcaf547158 Scale = 0x7ffcaf547154 Nullable = 0x7ffcaf547156 [ODBC][9810][1614079785.535949][SQLDescribeParam.c][338] Exit:[SQL_SUCCESS] SQL Type = 0x7ffcaf546c40 Param Def = 0x7ffcaf546d30 Scale = 0x7ffcaf546e20 Nullable = 0x7ffcaf546f10 [ODBC][9810][1614079785.536076][SQLBindParameter.c][217] Entry: Statement = 0x55e8d442c780 Param Number = 1 Param Type = 1 C Type = 1 SQL_C_CHAR SQL Type = 12 SQL_VARCHAR Col Def = 999 Scale = 0 Rgb Value = 0x7f705200b230 Value Max = 0 StrLen Or Ind = 0x7f70520013e0 [ODBC][9810][1614079785.536200][SQLBindParameter.c][434] Exit:[SQL_SUCCESS] [ODBC][9810][1614079785.536339][SQLSetConnectAttr.c][399] Entry: Connection = 0x55e8d4313ea0 Attribute = SQL_ATTR_AUTOCOMMIT Value = (nil) StrLen = -6 [ODBC][9810][1614079785.536461][SQLSetConnectAttr.c][862] Exit:[SQL_SUCCESS] [ODBC][9810][1614079785.536692][SQLExecute.c][187] Entry: Statement = 0x55e8d442c780 [ODBC][9810][1614079785.536850][SQLExecute.c][357] Exit:[SQL_NEED_DATA] [ODBC][9810][1614079785.536973][SQLParamData.c][166] Entry: Statement = 0x55e8d442c780 Value = 0x7ffcaf5472d0 [ODBC][9810][1614079785.537218][SQLParamData.c][362] Exit:[SQL_NEED_DATA] Value = 0x7f705200b230 [ODBC][9810][1614079785.537349][SQLPutData.c][148] Entry: Statement = 0x55e8d442c780 Data = 0x7f7052070098 StrLen = 100 [ODBC][9810][1614079785.537608][SQLPutData.c][315] Exit:[SQL_SUCCESS] [ODBC][9810][1614079785.537729][SQLParamData.c][166] Entry: Statement = 0x55e8d442c780 Value = 0x7ffcaf5472d0 [ODBC][9810][1614079785.539905][SQLParamData.c][362] Exit:[SQL_SUCCESS] Value = 0x7f705200b230 [ODBC][9810][1614079785.540037][SQLRowCount.c][173] Entry: Statement = 0x55e8d442c780 Row Count = 0x7ffcaf5472c8 [ODBC][9810][1614079785.540156][SQLRowCount.c][247] Exit:[SQL_SUCCESS] Row Count = 0x7ffcaf5472c8 -> 1 [ODBC][9810][1614079785.540272][SQLNumResultCols.c][156] Entry: Statement = 0x55e8d442c780 Column Count = 0x7ffcaf5472d0 [ODBC][9810][1614079785.540398][SQLNumResultCols.c][251] Exit:[SQL_SUCCESS] Count = 0x7ffcaf5472d0 -> 0 [ODBC][9810][1614079785.540571][SQLEndTran.c][417] Entry: Connection = 0x55e8d4313ea0 Completion Type = 0 [ODBC][9810][1614079785.543363][SQLGetInfo.c][236] Entry: Connection = 0x55e8d4313ea0 Info Type = SQL_CURSOR_COMMIT_BEHAVIOR (23) Info Value = 0x55e8d4315318 Buffer Length = 2 StrLen = 0x7ffcaf547270 [ODBC][9810][1614079785.543505][SQLGetInfo.c][236] Entry: Connection = 0x55e8d4313ea0 Info Type = SQL_CURSOR_ROLLBACK_BEHAVIOR (24) Info Value = 0x55e8d431531a Buffer Length = 2 StrLen = 0x7ffcaf547270 [ODBC][9810][1614079785.543625][SQLEndTran.c][566] Exit:[SQL_SUCCESS] [ODBC][9810][1614079785.543743][SQLSetConnectAttr.c][399] Entry: Connection = 0x55e8d4313ea0 Attribute = SQL_ATTR_AUTOCOMMIT Value = 0x1 StrLen = -6 [ODBC][9810][1614079785.543895][SQLSetConnectAttr.c][862] Exit:[SQL_SUCCESS] [ODBC][9810][1614079785.544108][SQLCloseCursor.c][139] Entry: Statement = 0x55e8d442c780 [ODBC][9810][1614079785.544302][SQLCloseCursor.c][234] Exit:[SQL_ERROR] [ODBC][9810][1614079785.544428][SQLFreeHandle.c][387] Entry: Handle Type = 3 Input Handle = 0x55e8d442c780 [ODBC][9810][1614079785.544591][SQLFreeHandle.c][490] Exit:[SQL_SUCCESS] [ODBC][9810][1614079785.544720][SQLEndTran.c][417] Entry: Connection = 0x55e8d4313ea0 Completion Type = 1 [ODBC][9810][1614079785.546258][SQLEndTran.c][566] Exit:[SQL_SUCCESS] [ODBC][9810][1614079785.546390][SQLDisconnect.c][208] Entry: Connection = 0x55e8d4313ea0 [ODBC][9810][1614079786.515560][SQLDisconnect.c][379] Exit:[SQL_SUCCESS] [ODBC][9810][1614079786.515803][SQLFreeHandle.c][290] Entry: Handle Type = 2 Input Handle = 0x55e8d4313ea0 [ODBC][9810][1614079786.515925][SQLFreeHandle.c][339] Exit:[SQL_SUCCESS] [ODBC][9810][1614079786.516044][SQLFreeHandle.c][220] Entry: Handle Type = 1 Input Handle = 0x55e8d43138a0 pdo-3996.log (BLOB column 0 bytes long after insert) [ODBC][9789][1614079850.559366][SQLConnect.c][3721] Entry: Connection = 0x55e8d43da090 Server Name = [ORACLETEST][length = 11 (SQL_NTS)] User Name = [eberjegyzek][length = 11 (SQL_NTS)] Authentication = [********][length = 8 (SQL_NTS)] UNICODE Using encoding ASCII 'UTF-8' and UNICODE 'UTF16LE' [ODBC][9789][1614079850.657020][SQLConnect.c][4299] Exit:[SQL_SUCCESS] [ODBC][9789][1614079850.657240][SQLAllocHandle.c][540] Entry: Handle Type = 3 Input Handle = 0x55e8d43da090 [ODBC][9789][1614079850.657334][SQLAllocHandle.c][1085] Exit:[SQL_SUCCESS] Output Handle = 0x55e8d43cd4c0 [ODBC][9789][1614079850.657399][SQLPrepare.c][196] Entry: Statement = 0x55e8d43cd4c0 SQL = [INSERT INTO HSZ(ID, PDF) VALUES(SEQ_HSZ.NEXTVAL, EMPTY_BLOB()) RETURNING PDF INTO ?][length = 83 (SQL_NTS)] [ODBC][9789][1614079850.658933][SQLPrepare.c][377] Exit:[SQL_SUCCESS] [ODBC][9789][1614079850.659389][SQLDescribeParam.c][185] Entry: Statement = 0x55e8d43cd4c0 Parameter Number = 1 SQL Type = 0x7ffcaf547152 Param Def = 0x7ffcaf547158 Scale = 0x7ffcaf547154 Nullable = 0x7ffcaf547156 [ODBC][9789][1614079850.659458][SQLDescribeParam.c][338] Exit:[SQL_SUCCESS] SQL Type = 0x7ffcaf546c40 Param Def = 0x7ffcaf546d30 Scale = 0x7ffcaf546e20 Nullable = 0x7ffcaf546f10 [ODBC][9789][1614079850.659517][SQLBindParameter.c][217] Entry: Statement = 0x55e8d43cd4c0 Param Number = 1 Param Type = 1 C Type = 1 SQL_C_CHAR SQL Type = 12 SQL_VARCHAR Col Def = 999 Scale = 0 Rgb Value = 0x7f705200b230 Value Max = 0 StrLen Or Ind = 0x7f70520013e0 [ODBC][9789][1614079850.659575][SQLBindParameter.c][434] Exit:[SQL_SUCCESS] [ODBC][9789][1614079850.659639][SQLSetConnectAttr.c][399] Entry: Connection = 0x55e8d43da090 Attribute = SQL_ATTR_AUTOCOMMIT Value = (nil) StrLen = -6 [ODBC][9789][1614079850.659701][SQLSetConnectAttr.c][862] Exit:[SQL_SUCCESS] [ODBC][9789][1614079850.659816][SQLExecute.c][187] Entry: Statement = 0x55e8d43cd4c0 [ODBC][9789][1614079850.659877][SQLExecute.c][357] Exit:[SQL_NEED_DATA] [ODBC][9789][1614079850.659931][SQLParamData.c][166] Entry: Statement = 0x55e8d43cd4c0 Value = 0x7ffcaf5472d0 [ODBC][9789][1614079850.660068][SQLParamData.c][362] Exit:[SQL_NEED_DATA] Value = 0x7f705200b230 [ODBC][9789][1614079850.660129][SQLPutData.c][148] Entry: Statement = 0x55e8d43cd4c0 Data = 0x7f7052085018 StrLen = 3996 [ODBC][9789][1614079850.660251][SQLPutData.c][315] Exit:[SQL_SUCCESS] [ODBC][9789][1614079850.660294][SQLParamData.c][166] Entry: Statement = 0x55e8d43cd4c0 Value = 0x7ffcaf5472d0 [ODBC][9789][1614079850.662195][SQLParamData.c][362] Exit:[SQL_SUCCESS] Value = 0x7f705200b230 [ODBC][9789][1614079850.662266][SQLRowCount.c][173] Entry: Statement = 0x55e8d43cd4c0 Row Count = 0x7ffcaf5472c8 [ODBC][9789][1614079850.662324][SQLRowCount.c][247] Exit:[SQL_SUCCESS] Row Count = 0x7ffcaf5472c8 -> 1 [ODBC][9789][1614079850.662368][SQLNumResultCols.c][156] Entry: Statement = 0x55e8d43cd4c0 Column Count = 0x7ffcaf5472d0 [ODBC][9789][1614079850.662414][SQLNumResultCols.c][251] Exit:[SQL_SUCCESS] Count = 0x7ffcaf5472d0 -> 0 [ODBC][9789][1614079850.662499][SQLEndTran.c][417] Entry: Connection = 0x55e8d43da090 Completion Type = 0 [ODBC][9789][1614079850.665256][SQLGetInfo.c][236] Entry: Connection = 0x55e8d43da090 Info Type = SQL_CURSOR_COMMIT_BEHAVIOR (23) Info Value = 0x55e8d43db508 Buffer Length = 2 StrLen = 0x7ffcaf547270 [ODBC][9789][1614079850.665345][SQLGetInfo.c][236] Entry: Connection = 0x55e8d43da090 Info Type = SQL_CURSOR_ROLLBACK_BEHAVIOR (24) Info Value = 0x55e8d43db50a Buffer Length = 2 StrLen = 0x7ffcaf547270 [ODBC][9789][1614079850.665406][SQLEndTran.c][566] Exit:[SQL_SUCCESS] [ODBC][9789][1614079850.665486][SQLSetConnectAttr.c][399] Entry: Connection = 0x55e8d43da090 Attribute = SQL_ATTR_AUTOCOMMIT Value = 0x1 StrLen = -6 [ODBC][9789][1614079850.665542][SQLSetConnectAttr.c][862] Exit:[SQL_SUCCESS] [ODBC][9789][1614079850.665666][SQLCloseCursor.c][139] Entry: Statement = 0x55e8d43cd4c0 [ODBC][9789][1614079850.665779][SQLCloseCursor.c][234] Exit:[SQL_ERROR] [ODBC][9789][1614079850.665837][SQLFreeHandle.c][387] Entry: Handle Type = 3 Input Handle = 0x55e8d43cd4c0 [ODBC][9789][1614079850.665937][SQLFreeHandle.c][490] Exit:[SQL_SUCCESS] [ODBC][9789][1614079850.665999][SQLEndTran.c][417] Entry: Connection = 0x55e8d43da090 Completion Type = 1 [ODBC][9789][1614079850.667235][SQLEndTran.c][566] Exit:[SQL_SUCCESS] [ODBC][9789][1614079850.667298][SQLDisconnect.c][208] Entry: Connection = 0x55e8d43da090 [ODBC][9789][1614079851.642822][SQLDisconnect.c][379] Exit:[SQL_SUCCESS] [ODBC][9789][1614079851.642968][SQLFreeHandle.c][290] Entry: Handle Type = 2 Input Handle = 0x55e8d43da090 [ODBC][9789][1614079851.643038][SQLFreeHandle.c][339] Exit:[SQL_SUCCESS] [ODBC][9789][1614079851.643100][SQLFreeHandle.c][220] Entry: Handle Type = 1 Input Handle = 0x55e8d43d9a90 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=80790 -- Edit this bug report at https://bugs.php.net/bug.php?id=80790&edit=1

« previous php.bugs (#232356) next »