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

Backport of bug#38719 from 6.0 to 5.1

handler::get_dup_key used the called handler for the
info call, but used table->file handler for errkey.
Fixed by using table->file->info instead.

mysql-test/r/partition_error.result:
  Bug#38719: Partitioning returns a different error code for
  a duplicate key error
  
  Added test for verification
mysql-test/t/partition_error.test:
  Bug#38719: Partitioning returns a different error code for
  a duplicate key error
  
  Added test for verification
This commit is contained in:
Mattias Jonsson
2009-02-18 21:29:30 +01:00
parent bf442fcaae
commit 830c42a06a
3 changed files with 24 additions and 2 deletions

View File

@@ -2932,7 +2932,7 @@ uint handler::get_dup_key(int error)
if (error == HA_ERR_FOUND_DUPP_KEY || error == HA_ERR_FOREIGN_DUPLICATE_KEY ||
error == HA_ERR_FOUND_DUPP_UNIQUE || error == HA_ERR_NULL_IN_SPATIAL ||
error == HA_ERR_DROP_INDEX_FK)
info(HA_STATUS_ERRKEY | HA_STATUS_NO_LOCK);
table->file->info(HA_STATUS_ERRKEY | HA_STATUS_NO_LOCK);
DBUG_RETURN(table->file->errkey);
}