• unknown's avatar
    Bug#32265 Server returns different metadata if prepared statement is used · a399fefd
    unknown authored
    Executing a prepared statement associated with a materialized
    cursor yields to the client a metadata packet with wrong table
    and database names. The problem was occurring because the server
    was sending the the name of the temporary table used by the cursor
    instead of the table name of the original table. The same problem
    occurs when selecting from views, in which case the table name was
    being sent and not the name of the view.
      
    The solution is to fill the list item from the temporary table but
    preserving the table and database names of the original fields. This
    is achieved by tweaking the Select_materialize to accept a pointer to
    the Materialized_cursor class which contains the item list to be filled.
    
    
    sql/sql_cursor.cc:
      Fill the item list in the send_fields method and preserve
      the table and database name of the fields.
    tests/mysql_client_test.c:
      Add test case for Bug#32265
    a399fefd
sql_cursor.cc 20.6 KB