• Alexander Nozdrin's avatar
    Patch for Bug#21818 (Return value of ROW_COUNT() is incorrect · 7752ccec
    Alexander Nozdrin authored
    for ALTER TABLE, LOAD DATA).
    
    ROW_COUNT is now assigned according to the following rules:
    
      - In my_ok():
        - for DML statements: to the number of affected rows;
        - for DDL statements: to 0.
    
      - In my_eof(): to -1 to indicate that there was a result set.
    
        We derive this semantics from the JDBC specification, where int
        java.sql.Statement.getUpdateCount() is defined to (sic) "return the
        current result as an update count; if the result is a ResultSet
        object or there are no more results, -1 is returned".
    
      - In my_error(): to -1 to be compatible with the MySQL C API and
        MySQL ODBC driver.
    
      - For SIGNAL statements: to 0 per WL#2110 specification. Zero is used
        since that's the "default" value of ROW_COUNT in the diagnostics area.
    7752ccec
row_count_func-master.opt 34 Bytes