--- Comment #17 from Lionel Elie Mamane <> ---
It still seems the problem with Firebird-in-Libreoffice preparedstatement is
that the columns collection is constructed with duplicate column names, which
means duplicates are dropped.

This could be a Firebird bug. Julien, could you please confirm that by tracing
the call to the Firebird API in both cases, and see that it is the Firebird API
that returns something different? Then we can file a firebird bug for that.

To be clear, the two cases are (in Gerhard's code):

oResult = oPrepStatement.executeQuery
ccols = oPrepStatement.Columns


oResult = oPrepStatement.executeQuery
ccols = oResult.Columns

In all cases, what you want to trace is
It accesses

If in one case, several columns have the same name "CONSTANT" and in the other
case all columns have unique names like "CONSTANT", "CONSTANT1", "CONSTANT2",
etc, then  we have definitely found the problem, it is in Firebird.

For a simpler test than Gerhard's code, take his database, but execute this
basic code:

Sub Main
        Dim DBDocUI as Object
        on error resume next
        DBDocUI = ThisDatabaseDocument.currentController
        if not DBDocUI.isConnected then
        end if
        on error goto 0

        dim s as Object
        's = DBDocUI.ActiveConnection.createStatement()
        s = DBDocUI.ActiveConnection.prepareStatement("SELECT ""ID"" AS
""TID1"", ""ID"" AS ""TID2"" FROM ""MitgliederVerband""")
        dim r as Object
        'rs = s.executeQuery("SELECT ""ID"" AS ""TID1"", ""ID"" AS ""TID2""
FROM ""MitgliederVerband""")
        rs = s.executeQuery()
        dim i as integer
        for i=1 to rs.metadata.ColumnCount
                MsgBox i & ": " & rs.metadata.getColumnName(i) & " " & 
        next i
        XRay rs.columns.ElementNames
        XRay rs.columns.getByName("ID")
        XRay rs.columns.getByName("ID1")
End Sub

Using alternatively the two definitions of s and rs, which will be your two

Thanks in advance.

You are receiving this mail because:
You are the assignee for the bug.
Libreoffice-bugs mailing list

Reply via email to