https://bugs.documentfoundation.org/show_bug.cgi?id=148663

            Bug ID: 148663
           Summary: Unable to insert an array in embedded firebird
           Product: LibreOffice
           Version: 7.1.5.2 release
          Hardware: x86 (IA32)
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Base
          Assignee: [email protected]
          Reporter: [email protected]

Description:
Made a table in embedded firebird:

RECREATE TABLE USERTYPE
    (
      USER_IDS INTEGER NOT NULL PRIMARY KEY, 
      USER_TYPES VARCHAR(20),
      USER_ROLES INTEGER[5]
    )

my basic code is as follow:

Option Explicit
Sub Main
Dim stm as com.sun.star.sdbc.XPreparedStatement
Dim testVals(5) As Integer
Dim i As Integer
         getDbConnection(ThisdatabaseDocument)
         stm =fcon.preparestatement("DELETE FROM USERTYPE")
         stm.execute()
         stm =fcon.preparestatement("insert into USERTYPE
(USER_IDS,USER_TYPES,USER_ROLES) VALUES (?,?,?) ")
         stm.setInt(1,0)
         stm.setString(2,"test insert")
        For i = lbound(testVals) To ubound(testVals)
                testVals(i)=i
        Next i
         stm.setArray(3, testVals)
         stm.executeUpdate()
End Sub

The first two columns are populated, but the last column, which is an integer
array was not populated whatsoever.


Steps to Reproduce:
1. make the table:

RECREATE TABLE USERTYPE
    (
      USER_IDS INTEGER NOT NULL PRIMARY KEY, 
      USER_TYPES VARCHAR(20),
      USER_ROLES INTEGER[5]
    )




2. run the basic code to insert data in the table

Option Explicit
Sub Main
Dim stm as com.sun.star.sdbc.XPreparedStatement
Dim testVals(5) As Integer
Dim i As Integer
         getDbConnection(ThisdatabaseDocument)
         stm =fcon.preparestatement("DELETE FROM USERTYPE")
         stm.execute()
         stm =fcon.preparestatement("insert into USERTYPE
(USER_IDS,USER_TYPES,USER_ROLES) VALUES (?,?,?) ")
         stm.setInt(1,0)
         stm.setString(2,"test insert")
        For i = lbound(testVals) To ubound(testVals)
                testVals(i)=i
        Next i
         stm.setArray(3, testVals)
         stm.executeUpdate()
End Sub


3. run select * from USERTYPE

Actual Results:
returns a single row of values:
0,test_insert, ,


Expected Results:
the software should have inserted:
0 in the first column
test_insert in the second column
an array of integers in the last column 


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.1.5.2 (x86) / LibreOffice Community
Build ID: 85f04e9f809797b8199d13c421bd8a2b025d52b5
CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to