summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2005-03-09 14:09:06 +0100
committerunknown <serg@serg.mylan>2005-03-09 14:09:06 +0100
commit48577bb59f5ab34bd01fba50cddc6c00ceb65d41 (patch)
tree4625d7f51e27bb495a5f571cfcad95a20d34e4a9 /sql
parent3b214ab3e82a0de322ebdcbb4175613a3916b5b3 (diff)
parentad019543e601a4d60453efce29603a12ead35fe9 (diff)
downloadmariadb-git-48577bb59f5ab34bd01fba50cddc6c00ceb65d41.tar.gz
merged
BitKeeper/etc/ignore: auto-union BitKeeper/etc/logging_ok: auto-union Build-tools/Do-compile: Auto merged client/mysql.cc: Auto merged client/mysqldump.c: Auto merged include/my_sys.h: Auto merged innobase/buf/buf0lru.c: Auto merged innobase/dict/dict0dict.c: Auto merged innobase/include/page0page.ic: Auto merged innobase/include/srv0srv.h: Auto merged innobase/os/os0thread.c: Auto merged innobase/rem/rem0cmp.c: Auto merged innobase/row/row0mysql.c: Auto merged innobase/row/row0sel.c: Auto merged innobase/srv/srv0srv.c: Auto merged innobase/trx/trx0sys.c: Auto merged innobase/trx/trx0trx.c: Auto merged innobase/ut/ut0ut.c: Auto merged myisam/ft_parser.c: Auto merged myisam/mi_create.c: Auto merged mysql-test/Makefile.am: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/mysqldump.result: Auto merged mysql-test/r/ndb_alter_table.result: Auto merged mysql-test/t/mysqldump.test: Auto merged mysql-test/t/ndb_alter_table.test: Auto merged mysys/hash.c: Auto merged mysys/my_bitmap.c: Auto merged ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: Auto merged scripts/make_binary_distribution.sh: Auto merged scripts/make_win_src_distribution.sh: Auto merged sql/net_serv.cc: Auto merged sql/sql_select.cc: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_ndbcluster.cc39
-rw-r--r--sql/ha_ndbcluster.h1
-rw-r--r--sql/item_strfunc.cc7
-rw-r--r--sql/mysqld.cc5
-rw-r--r--sql/protocol.cc5
-rw-r--r--sql/sql_select.cc2
6 files changed, 42 insertions, 17 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 35bbeca9cc0..03235190cb3 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -411,6 +411,35 @@ void ha_ndbcluster::no_uncommitted_rows_reset(THD *thd)
# The mapped error code
*/
+void ha_ndbcluster::invalidateDictionaryCache()
+{
+ NDBDICT *dict= get_ndb()->getDictionary();
+ DBUG_PRINT("info", ("invalidating %s", m_tabname));
+ dict->invalidateTable(m_tabname);
+ table->version=0L; /* Free when thread is ready */
+ /* Invalidate indexes */
+ for (uint i= 0; i < table->keys; i++)
+ {
+ NDBINDEX *index = (NDBINDEX *) m_index[i].index;
+ NDBINDEX *unique_index = (NDBINDEX *) m_index[i].unique_index;
+ NDB_INDEX_TYPE idx_type= m_index[i].type;
+
+ switch(idx_type) {
+ case(PRIMARY_KEY_ORDERED_INDEX):
+ case(ORDERED_INDEX):
+ dict->invalidateIndex(index->getName(), m_tabname);
+ break;
+ case(UNIQUE_ORDERED_INDEX):
+ dict->invalidateIndex(index->getName(), m_tabname);
+ case(UNIQUE_INDEX):
+ dict->invalidateIndex(unique_index->getName(), m_tabname);
+ break;
+ case(PRIMARY_KEY_INDEX):
+ case(UNDEFINED_INDEX):
+ break;
+ }
+ }
+}
int ha_ndbcluster::ndb_err(NdbTransaction *trans)
{
@@ -421,14 +450,8 @@ int ha_ndbcluster::ndb_err(NdbTransaction *trans)
ERR_PRINT(err);
switch (err.classification) {
case NdbError::SchemaError:
- {
- Ndb *ndb= get_ndb();
- NDBDICT *dict= ndb->getDictionary();
- DBUG_PRINT("info", ("invalidateTable %s", m_tabname));
- dict->invalidateTable(m_tabname);
- table->s->version= 0L; /* Free when thread is ready */
+ invalidateDictionaryCache();
break;
- }
default:
break;
}
@@ -855,7 +878,7 @@ int ha_ndbcluster::get_metadata(const char *path)
if (!invalidating_ndb_table)
{
DBUG_PRINT("info", ("Invalidating table"));
- dict->invalidateTable(m_tabname);
+ invalidateDictionaryCache();
invalidating_ndb_table= TRUE;
}
else
diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h
index 7c4a19c6ec4..d12ff5bcdce 100644
--- a/sql/ha_ndbcluster.h
+++ b/sql/ha_ndbcluster.h
@@ -554,6 +554,7 @@ private:
void print_results();
ulonglong get_auto_increment();
+ void invalidateDictionaryCache();
int ndb_err(NdbTransaction*);
bool uses_blob_value(bool all_fields);
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 03aa56128ca..298418e1574 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1669,9 +1669,8 @@ String *Item_func_format::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
double nr= args[0]->val_real();
+ uint32 length,str_length,dec;
int diff;
- uint32 length, str_length;
- uint dec;
if ((null_value=args[0]->null_value))
return 0; /* purecov: inspected */
dec= decimals ? decimals+1 : 0;
@@ -1687,12 +1686,12 @@ String *Item_func_format::val_str(String *str)
if (str_length >= dec+4)
{
char *tmp,*pos;
- length= str->length()+(diff=(str_length- dec-1)/3);
+ length= str->length()+(diff=((int)(str_length- dec-1))/3);
str= copy_if_not_alloced(&tmp_str,str,length);
str->length(length);
tmp= (char*) str->ptr()+length - dec-1;
for (pos= (char*) str->ptr()+length-1; pos != tmp; pos--)
- pos[0]= pos[-(int) diff];
+ pos[0]= pos[-diff];
while (diff)
{
*pos= *(pos - diff);
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 2c1451a95a4..4b56154cf64 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1462,6 +1462,7 @@ void close_connection(THD *thd, uint errcode, bool lock)
errcode ? ER(errcode) : ""));
if (lock)
(void) pthread_mutex_lock(&LOCK_thread_count);
+ thd->killed=1;
if ((vio=thd->net.vio) != 0)
{
if (errcode)
@@ -3148,9 +3149,9 @@ we force server id to 2, but this MySQL server will not act as a slave.");
create_maintenance_thread();
sql_print_information(ER(ER_READY),my_progname,server_version,
- ((unix_sock == INVALID_SOCKET) ? (char*) ""
+ ((unix_sock == INVALID_SOCKET) ? (char*) ""
: mysqld_unix_port),
- mysqld_port,
+ mysqld_port,
MYSQL_COMPILATION_COMMENT);
#if defined(__NT__) || defined(HAVE_SMEM)
diff --git a/sql/protocol.cc b/sql/protocol.cc
index a05f4c6079b..f84be5b1947 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -252,8 +252,9 @@ net_printf_error(THD *thd, uint errcode, ...)
strmake(net->last_error, text_pos, length);
strmake(net->sqlstate, mysql_errno_to_sqlstate(errcode), SQLSTATE_LENGTH);
#endif
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, errcode,
- text_pos ? text_pos : ER(errcode));
+ if (!thd->killed)
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, errcode,
+ text_pos ? text_pos : ER(errcode));
thd->is_fatal_error=0; // Error message is given
DBUG_VOID_RETURN;
}
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 76d8ec1740a..169e990e879 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -10421,7 +10421,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
{
ref_key= tab->ref.key;
ref_key_parts= tab->ref.key_parts;
- if (tab->type == JT_REF_OR_NULL)
+ if (tab->type == JT_REF_OR_NULL || tab->type == JT_FT)
DBUG_RETURN(0);
}
else if (select && select->quick) // Range found by opt_range