|
|||||||||||
|
How to report duplicate key values in handler::add_index()?
From: Marko Mäkelä <marko.makela(at)oracle.com>
Date: Wed Aug 15 2007 - 06:03:27 EDT
I have a problem with reporting duplicate key errors in CREATE UNIQUE INDEX. How can the storage engine return a duplicate key value in handler::add_index()? As far as I understand, the key value that MySQL reports to the client is read from the TABLE::key_info array by key_unpack(), in sql/key.cc. But it is not obvious to me how this information could be updated. Perhaps something like restore_record() followed by something that copies table->record[0] to table->key_info[]? Furthermore, is there any better documentation for TABLE than this in table.h:
struct st_table {
uchar *record[2]; /* Pointer to records */ uchar *write_row_record; /* Used as optimisation in THD::write_row */ ... }; I don't see any method THD::write_row(). Is the comment supposed to refer to THD::binlog_write_row()? What are the possible values of "status"? What can there be in record[1]? Best regards, Marko Mäkelä Innobase Oy/Oracle Corp. -- MySQL Internals Mailing List For list archives: http://lists.mysql.com/internals To unsubscribe: http://lists.mysql.com/internals?unsub=lists@pantek.comReceived on Wed Aug 15 06:04:27 2007 This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 07:59:13 EDT |
||||||||||
|
|||||||||||