Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
3.2.4
-
None
-
Windows 11, Database on Ubuntu
Description
I use ADO and call a stored procedure which returns a recordset. Now I open another recordset to write a text with more than 4001 characters to a mediumtext (or longtext) field. The moment the command is sent the application fails:
Event viewer reports:
Application: EXCEL.EXE, Version: 16.0.18324.20194, Timestamp: 0x6787785b
Module: maodbc.dll, Version: 3.2.4.0, Timestamp: 0x6731f3cb
Exception code: 0xc0000409
Error offset: 0x0000000000276831
The error can be reproduced by creating a simple database:
CREATE OR REPLACE DATABASE my_test_db; |
|
USE my_test_db; |
|
CREATE OR REPLACE TABLE testdata( |
my_text_field MEDIUMTEXT
|
);
|
|
CREATE PROCEDURE my_test_proc() |
SELECT 1 FROM DUAL; |
|
Create an Excel sheet (see attached sheet) and place this macro into it:
Sub WriteMediumtextAfterStoredProcedure()
|
Dim conn As New adodb.Connection
|
Dim rs2 As adodb.Recordset
|
Dim rs1 As adodb.Recordset, cmd As adodb.Command
|
|
conn.Open "DSN=my_test_db"
|
|
Set rs1 = New adodb.Recordset
|
rs1.CursorLocation = adUseClient
|
rs1.Open "CALL my_test_proc", conn, adOpenKeyset, adLockBatchOptimistic
|
rs1.Close
|
Set rs1 = Nothing
|
|
Set rs2 = New adodb.Recordset
|
rs2.CursorLocation = adUseClient
|
rs2.Open "SELECT * FROM testdata", conn, adOpenKeyset, adLockPessimistic
|
rs2.AddNew
|
rs2!my_text_field = String(4002, "A")
|
rs2.Update
|
|
Debug.Print "done."
|
End Sub
|
The application error occurs as long as you place 4002 or more bytes into my_text_field.
It is reproducable as MS Access code as well.
With ODBC drivers of version 3.1 the error cannot be reproduced.