summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorGuilhem Bichot <guilhem@mysql.com>2009-08-12 15:44:34 +0200
committerGuilhem Bichot <guilhem@mysql.com>2009-08-12 15:44:34 +0200
commiteceba8912c9af415f9704bb671ddb4022eb8d9fc (patch)
tree5fdae14ec96fd61b574fe1c8b2d62d304114c53c /storage
parente44bda225abd5a736999b9c73ac88e059d823c2d (diff)
parent6e7de781d73b8967f1ab9e6c076795dd83429a80 (diff)
downloadmariadb-git-eceba8912c9af415f9704bb671ddb4022eb8d9fc.tar.gz
merge of 5.1-main into mysql-trunk.
Changes to ha_innodb.cc are not propagated to plugin, they will come back via Oracle/Innobase if needed.
Diffstat (limited to 'storage')
-rw-r--r--storage/myisam/ha_myisam.cc11
-rw-r--r--storage/myisammrg/ha_myisammrg.cc6
-rw-r--r--storage/myisammrg/ha_myisammrg.h3
-rw-r--r--storage/myisammrg/myrg_info.c18
-rw-r--r--storage/ndb/src/mgmsrv/Makefile.am2
5 files changed, 29 insertions, 11 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 6f1c712b7f7..1117a3d4e70 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -1613,10 +1613,8 @@ bool ha_myisam::check_and_repair(THD *thd)
old_query= thd->query;
old_query_length= thd->query_length;
- pthread_mutex_lock(&LOCK_thread_count);
- thd->query= table->s->table_name.str;
- thd->query_length= (uint) table->s->table_name.length;
- pthread_mutex_unlock(&LOCK_thread_count);
+ thd->set_query(table->s->table_name.str,
+ (uint) table->s->table_name.length);
if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt))
{
@@ -1629,10 +1627,7 @@ bool ha_myisam::check_and_repair(THD *thd)
if (repair(thd, &check_opt))
error=1;
}
- pthread_mutex_lock(&LOCK_thread_count);
- thd->query= old_query;
- thd->query_length= old_query_length;
- pthread_mutex_unlock(&LOCK_thread_count);
+ thd->set_query(old_query, old_query_length);
DBUG_RETURN(error);
}
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 40784e81760..83a46ca9f9f 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -907,7 +907,6 @@ int ha_myisammrg::info(uint flag)
*/
mrg_info.errkey= MAX_KEY;
}
- errkey= mrg_info.errkey;
table->s->keys_in_use.set_prefix(table->s->keys);
stats.mean_rec_length= mrg_info.reclength;
@@ -957,6 +956,11 @@ int ha_myisammrg::info(uint flag)
min(file->keys, table->s->key_parts));
}
}
+ if (flag & HA_STATUS_ERRKEY)
+ {
+ errkey= mrg_info.errkey;
+ my_store_ptr(dup_ref, ref_length, mrg_info.dupp_key_pos);
+ }
return 0;
}
diff --git a/storage/myisammrg/ha_myisammrg.h b/storage/myisammrg/ha_myisammrg.h
index 21d41c9d75a..790aa15e90a 100644
--- a/storage/myisammrg/ha_myisammrg.h
+++ b/storage/myisammrg/ha_myisammrg.h
@@ -44,7 +44,8 @@ class ha_myisammrg: public handler
HA_NULL_IN_KEY | HA_CAN_INDEX_BLOBS | HA_FILE_BASED |
HA_ANY_INDEX_MAY_BE_UNIQUE | HA_CAN_BIT_FIELD |
HA_HAS_RECORDS |
- HA_NO_COPY_ON_ALTER);
+ HA_NO_COPY_ON_ALTER |
+ HA_DUPLICATE_POS);
}
ulong index_flags(uint inx, uint part, bool all_parts) const
{
diff --git a/storage/myisammrg/myrg_info.c b/storage/myisammrg/myrg_info.c
index 7ea2dbf58e3..1930351ec8f 100644
--- a/storage/myisammrg/myrg_info.c
+++ b/storage/myisammrg/myrg_info.c
@@ -58,9 +58,27 @@ int myrg_status(MYRG_INFO *info,register MYMERGE_INFO *x,int flag)
x->reclength= info->reclength;
x->options= info->options;
if (current_table)
+ {
+ /*
+ errkey is set to the index number of the myisam tables. But
+ since the MERGE table can have less keys than the MyISAM
+ tables, errkey cannot be be used as an index into the key_info
+ on the server. This value will be overwritten with MAX_KEY by
+ the MERGE engine.
+ */
x->errkey= current_table->table->errkey;
+ /*
+ Calculate the position of the duplicate key to be the sum of the
+ offset of the myisam file and the offset into the file at which
+ the duplicate key is located.
+ */
+ x->dupp_key_pos= current_table->file_offset + current_table->table->dupp_key_pos;
+ }
else
+ {
x->errkey= 0;
+ x->dupp_key_pos= 0;
+ }
x->rec_per_key = info->rec_per_key_part;
}
DBUG_RETURN(0);
diff --git a/storage/ndb/src/mgmsrv/Makefile.am b/storage/ndb/src/mgmsrv/Makefile.am
index c19f885ae8d..3f37280d7a5 100644
--- a/storage/ndb/src/mgmsrv/Makefile.am
+++ b/storage/ndb/src/mgmsrv/Makefile.am
@@ -48,7 +48,7 @@ LDADD_LOC = $(top_builddir)/storage/ndb/src/mgmclient/CommandInterpreter.lo \
@TERMCAP_LIB@
DEFS_LOC = -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
- -DDATADIR="\"$(MYSQLDATAdir)\"" \
+ -DMYSQL_DATADIR="\"$(MYSQLDATAdir)\"" \
-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
-DMYSQLCLUSTERDIR="\"$(MYSQLCLUSTERdir)\""