1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug22584

into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.1-bug22584


mysql-test/r/view.result:
  Manual merge.
mysql-test/t/view.test:
  Manual merge.
sql/sql_parse.cc:
  Manual merge.
This commit is contained in:
unknown
2006-10-27 13:40:28 +04:00
3 changed files with 93 additions and 4 deletions

View File

@@ -3394,9 +3394,17 @@ end_with_restore_list:
res= mysql_insert(thd, all_tables, lex->field_list, lex->many_values,
lex->update_list, lex->value_list,
lex->duplicates, lex->ignore);
/* do not show last insert ID if VIEW does not have auto_inc */
/*
If we have inserted into a VIEW, and the base table has
AUTO_INCREMENT column, but this column is not accessible through
a view, then we should restore LAST_INSERT_ID to the value it
had before the statement.
*/
if (first_table->view && !first_table->contain_auto_increment)
thd->first_successful_insert_id_in_cur_stmt= 0;
thd->first_successful_insert_id_in_cur_stmt=
thd->first_successful_insert_id_in_prev_stmt;
break;
}
case SQLCOM_REPLACE_SELECT:
@@ -3456,9 +3464,17 @@ end_with_restore_list:
/* revert changes for SP */
select_lex->table_list.first= (byte*) first_table;
}
/* do not show last insert ID if VIEW does not have auto_inc */
/*
If we have inserted into a VIEW, and the base table has
AUTO_INCREMENT column, but this column is not accessible through
a view, then we should restore LAST_INSERT_ID to the value it
had before the statement.
*/
if (first_table->view && !first_table->contain_auto_increment)
thd->first_successful_insert_id_in_cur_stmt= 0;
thd->first_successful_insert_id_in_cur_stmt=
thd->first_successful_insert_id_in_prev_stmt;
break;
}
case SQLCOM_TRUNCATE: