summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <svoj@may.pils.ru>2006-10-08 15:14:53 +0500
committerunknown <svoj@may.pils.ru>2006-10-08 15:14:53 +0500
commitf43ee99c306f46285fbd6f2c253d85c3c02f0704 (patch)
treeb75dc089f294d6626c237df900b3c4a134c12c05
parent8f3322529520cd223c7d87318b4199e09d6ac2fc (diff)
parent12fb87ac28467fc112c87a8b7d437a4bd5dc6166 (diff)
downloadmariadb-git-f43ee99c306f46285fbd6f2c253d85c3c02f0704.tar.gz
Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.0
into may.pils.ru:/home/svoj/devel/bk/mysql-5.0-engines sql/sql_update.cc: Auto merged
-rw-r--r--mysql-test/r/merge.result8
-rw-r--r--sql/ha_myisammrg.cc15
-rw-r--r--sql/share/errmsg.txt2
-rw-r--r--sql/sql_update.cc6
4 files changed, 25 insertions, 6 deletions
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index d7eb7da939d..6a065bd7332 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -178,9 +178,9 @@ t3 CREATE TABLE `t3` (
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t1`,`t2`)
create table t4 (a int not null, b char(10), key(a)) engine=MERGE UNION=(t1,t2);
select * from t4;
-ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exists
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
alter table t4 add column c int;
-ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exists
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
create database mysqltest;
create table mysqltest.t6 (a int not null primary key auto_increment, message char(20));
create table t5 (a int not null, b char(20), key(a)) engine=MERGE UNION=(test.t1,mysqltest.t6);
@@ -777,11 +777,11 @@ DROP TABLE t1, t2;
CREATE TABLE t1(a INT) ENGINE=MEMORY;
CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t1);
SELECT * FROM t2;
-ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exists
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
DROP TABLE t1, t2;
CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t3);
SELECT * FROM t2;
-ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exists
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
DROP TABLE t2;
create table t1 (b bit(1));
create table t2 (b bit(1));
diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc
index cb11d9b0452..23af831cdf6 100644
--- a/sql/ha_myisammrg.cc
+++ b/sql/ha_myisammrg.cc
@@ -326,9 +326,22 @@ void ha_myisammrg::info(uint flag)
if (flag & HA_STATUS_CONST)
{
if (table->s->key_parts && info.rec_per_key)
+ {
+#ifdef HAVE_purify
+ /*
+ valgrind may be unhappy about it, because optimizer may access values
+ between file->keys and table->key_parts, that will be uninitialized.
+ It's safe though, because even if opimizer will decide to use a key
+ with such a number, it'll be an error later anyway.
+ */
+ bzero((char*) table->key_info[0].rec_per_key,
+ sizeof(table->key_info[0].rec_per_key) * table->key_parts);
+#endif
memcpy((char*) table->key_info[0].rec_per_key,
(char*) info.rec_per_key,
- sizeof(table->key_info[0].rec_per_key)*table->s->key_parts);
+ sizeof(table->key_info[0].rec_per_key) *
+ min(file->keys, table->s->key_parts));
+ }
}
}
diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt
index 5ed7466b0df..2b6d2b18f88 100644
--- a/sql/share/errmsg.txt
+++ b/sql/share/errmsg.txt
@@ -3813,7 +3813,7 @@ ER_WRONG_MRG_TABLE
cze "V-B¹echny tabulky v MERGE tabulce nejsou definovány stejnì"
dan "Tabellerne i MERGE er ikke defineret ens"
nla "Niet alle tabellen in de MERGE tabel hebben identieke gedefinities"
- eng "Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exists"
+ eng "Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist"
est "Kõik tabelid MERGE tabeli määratluses ei ole identsed"
fre "Toutes les tables de la table de type MERGE n'ont pas la même définition"
ger "Nicht alle Tabellen in der MERGE-Tabelle sind gleich definiert"
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index a4e05a96f9b..24577f63124 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -1095,6 +1095,8 @@ multi_update::initialize_tables(JOIN *join)
List<Item> temp_fields= *fields_for_table[cnt];
ORDER group;
+ if (ignore)
+ table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
if (table == main_table) // First table in join
{
if (safe_update_on_fly(join->join_tab, &temp_fields))
@@ -1210,7 +1212,11 @@ multi_update::~multi_update()
{
TABLE_LIST *table;
for (table= update_tables ; table; table= table->next_local)
+ {
table->table->no_keyread= table->table->no_cache= 0;
+ if (ignore)
+ table->table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
+ }
if (tmp_tables)
{