• unknown's avatar
    A fix and test case for bug#6059 "mysql_stmt_field_count returns · 506f648b
    unknown authored
    positive numbers when no resultset is available": when sending
    result set metadata we need to use virtual select_result::send_fields, 
    and not address protocol directly, because select_result descendents may 
    intercept result set (it's the case for example for SELECT INTO OUTFILE).
    
    
    sql/sql_class.h:
      A fix for bug#6059 "mysql_stmt_field_count returns positive numbers 
      when no resultset is available": introducing select_result::field_count()
      method to report actual number of fields in a result set, if any result
      set is sent to client.
    sql/sql_prepare.cc:
      A fix for bug#6059 "mysql_stmt_field_count returns 
      positive numbers when no resultset is available": when sending
      result set metadata we need to use virtual select_result::send_fields, 
      and not address protocol directly, because select_result descendents may 
      intercept result set (it's the case for example for SELECT INTO OUTFILE).
      Now we need to always have lex->result set if we're in prepared statements.
    tests/client_test.c:
      A test case for Bug#6059 "mysql_stmt_field_count returns positive 
      numbers when no resultset is available"
    506f648b
client_test.c 281 KB