Commit 3f6986ef authored by Michael Widenius's avatar Michael Widenius

Disable versioning (concurrent writes) if more than one unique key

The reason for this is that if we change one unique key and then get a failure on the second, we may not be able to rename the first one back before someone else writes the same key value.  In Maria 2.0, when we keep deleted key values in the tree, this will not be a problem anymore
Fixed typedisable concurrent insert/select for SQLCOM_LOAD as there are problems with concurrent threads during index recreation

KNOWN_BUGS.txt:
  More comments
storage/maria/ha_maria.cc:
  Fixed typo (REPLACE -> INSERT)
  Also disable concurrent insert/select for SQLCOM_LOAD as there are problems with concurrent threads during index recreation
storage/maria/ma_open.c:
  Disable versioning (concurrent writes) if more than one unique key
parent 213d518c
......@@ -29,6 +29,11 @@ Known bugs that we are working on and will be fixed shortly
the log handler doesn't start up after restart.
Most of this should now be fixed...
- INSERT on a duplicate key against a key inserted by another connection
that has not yet ended will give a duplicate key error instead of
waiting for the other statement to end.
Known bugs that are planned to be fixed before Gamma/RC
=======================================================
......@@ -56,14 +61,20 @@ this on a table:
wrong results if someone else is doing writes on the table during repair
or someone is doing selects during the repair index phase.
INSERT ... SELECT and REPLACE ... SELECT are blocking inserts and
SELECT for the table.
INSERT ... SELECT, REPLACE ... SELECT and LOAD DATA are blocking
inserts and SELECT for the table. They should only have to do this if
the destination is empty (as then we are using fast index rebuild).
Missing features that is planned to fix before Beta
===================================================
None
Features planned for future releases
====================================
Most notable is full transaction support and multiple reader/writers
in Maria 2.0
http://forge.mysql.com/worklog/
(you can enter "maria" in the "quick search" field there).
......@@ -2474,8 +2474,9 @@ THR_LOCK_DATA **ha_maria::store_lock(THD *thd,
mysql_bin_log.is_open())
lock_type= TL_READ_NO_INSERT;
else if (lock_type == TL_WRITE_CONCURRENT_INSERT &&
(thd->lex->sql_command == SQLCOM_REPLACE_SELECT ||
thd->lex->sql_command == SQLCOM_REPLACE_SELECT))
(thd->lex->sql_command == SQLCOM_INSERT_SELECT ||
thd->lex->sql_command == SQLCOM_REPLACE_SELECT ||
thd->lex->sql_command == SQLCOM_LOAD))
lock_type= TL_WRITE;
file->lock.type= lock_type;
}
......
......@@ -601,6 +601,15 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
pos->null_bit=0;
pos->flag=0; /* For purify */
pos++;
if ((share->keyinfo[i].flag & HA_NOSAME) && i != 0)
{
/*
We can't yet have versioning if there is more than one unique
key
*/
versioning= 0;
}
}
for (i=0 ; i < uniques ; i++)
{
......@@ -1345,11 +1354,12 @@ static uchar *_ma_state_info_read(uchar *ptr, MARIA_STATE_INFO *state)
@param state state which will be filled
*/
uint _ma_state_info_read_dsk(File file, MARIA_STATE_INFO *state)
uint _ma_state_info_read_dsk(File file __attribute__((unused)),
MARIA_STATE_INFO *state __attribute__((unused)))
{
#ifdef EXTERNAL_LOCKING
uchar buff[MARIA_STATE_INFO_SIZE + MARIA_STATE_EXTRA_SIZE];
#ifdef EXTERNAL_LOCKING
/* trick to detect transactional tables */
DBUG_ASSERT(state->create_rename_lsn == LSN_IMPOSSIBLE);
if (!maria_single_user)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment