[MCOL-1290] php mysqli use vtable name in returned array rather than actual table Created: 2018-03-21  Updated: 2019-07-10  Resolved: 2019-07-10

Status: Closed
Project: MariaDB ColumnStore
Component/s: MariaDB Server
Affects Version/s: 1.1.3
Fix Version/s: Icebox

Type: Bug Priority: Major
Reporter: David Thompson (Inactive) Assignee: Andrew Hutchings (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

If you have a php application that uses the mysqli function mysqli_fetch_field_direct then the table name array element uses the vtable name rather than actual name.

This is more problematic in the case where you have a query with a join where you have a column with the same name from 2 different tables being projected.

Here is an example output, don't have an actual php test case at this point.

Array
(
    [0] => Array
        (
            [$vtable_482] => Array
                (
                    [a] => 6
                    [b] => 5
                )
 
        )
 
)



 Comments   
Comment by Allen M Herrera [ 2018-03-21 ]

Related to this issue is the fact that columnstore pushed all the joined tables into one v-table. So now I cannot see the origin of each value. In the example below (non-columnstore) you see the column 'lft' comes from the table company. After switching to columnstore the source is obscured. This could also be an issue if multiple tables contain the same column name. Example selecting the column 'id' from 4 different tables.

Before:

Array
(
    [0] => Array
        (
            [0] => Array
                (
                    [max_date] => 2015-10-01
                )
            [Company] => Array
                (
                    [lft] => 731
                )
        )
)

After:

Array
(
    [0] => Array
        (
            [$vtable_723] => Array
                (
                    [max_date] => 2013-05-01
                    [lft] => 29
                )
        )
)

Comment by Andrew Hutchings (Inactive) [ 2018-03-21 ]

The reason for this is at protocol level we are sending the final results from the vtable switch. This includes metadata for the vtable SELECT rather than the user's SELECT query.

Comment by Andrew Hutchings (Inactive) [ 2019-07-10 ]

Can't fix below 1.4. Will go away in 1.4

Generated at Thu Feb 08 02:27:38 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.