From 5187087309d6e8c11e80e56737b91765e510c68f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Apr 2006 13:25:28 +0200 Subject: [PATCH 01/11] Fix for bug#18133: Adding index to unsigned int causes on-line add index not to be used --- sql/field.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/field.cc b/sql/field.cc index 708b239b494..85562ef0b8a 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -5970,7 +5970,7 @@ int Field_str::store(double nr) uint Field::is_equal(create_field *new_field) { - return (new_field->sql_type == type()); + return (new_field->sql_type == real_type()); } @@ -5982,7 +5982,7 @@ uint Field_str::is_equal(create_field *new_field) (flags & (BINCMP_FLAG | BINARY_FLAG)))) return 0; /* One of the fields is binary and the other one isn't */ - return ((new_field->sql_type == type()) && + return ((new_field->sql_type == real_type()) && new_field->charset == field_charset && new_field->length == max_length()); } @@ -6779,7 +6779,7 @@ Field *Field_varstring::new_key_field(MEM_ROOT *root, uint Field_varstring::is_equal(create_field *new_field) { - if (new_field->sql_type == type() && + if (new_field->sql_type == real_type() && new_field->charset == field_charset) { if (new_field->length == max_length()) @@ -7938,12 +7938,12 @@ bool Field_num::eq_def(Field *field) uint Field_num::is_equal(create_field *new_field) { - return ((new_field->sql_type == type()) && + return ((new_field->sql_type == real_type()) && ((new_field->flags & UNSIGNED_FLAG) == (uint) (flags & UNSIGNED_FLAG)) && ((new_field->flags & AUTO_INCREMENT_FLAG) == (uint) (flags & AUTO_INCREMENT_FLAG)) && - (new_field->length >= max_length())); + (new_field->length <= max_length())); } From 2bd5f57981009f9e56b4e520482c7840e01815bd Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Apr 2006 10:47:48 +0200 Subject: [PATCH 02/11] Fix for bug#16445 schema version error 241 after mysqld restart, always invalidate dictionary cache when receiving changed schema events drop table or alter table, regardless if done remotely or not (also includes cluster failures, but refreshing cache is a safe operation) --- mysql-test/t/ndb_basic.test | 11 ---- sql/ha_ndbcluster_binlog.cc | 117 ++++++++++++++++++------------------ 2 files changed, 59 insertions(+), 69 deletions(-) diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test index df94545abea..ab62e3dd13a 100644 --- a/mysql-test/t/ndb_basic.test +++ b/mysql-test/t/ndb_basic.test @@ -6,17 +6,6 @@ DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; drop database if exists mysqltest; --enable_warnings -# workaround for bug#16445 -# remove to reproduce bug and run tests drom ndb start -# and with ndb_autodiscover disabled -CREATE TABLE t1 ( - pk1 INT NOT NULL PRIMARY KEY, - attr1 INT NOT NULL, - attr2 INT, - attr3 VARCHAR(10) -) ENGINE=ndbcluster; -drop table t1; - # # Basic test to show that the NDB # table handler is working diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index ca3dcf605b0..1f416e1816d 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -1372,6 +1372,9 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp, NDB_SHARE *share) { DBUG_ENTER("ndb_handle_schema_change"); + TABLE* table= share->table; + TABLE_SHARE *table_share= table->s; + const char *dbname= table_share->db.str; bool do_close_cached_tables= FALSE; bool is_online_alter_table= FALSE; bool is_rename_table= FALSE; @@ -1391,70 +1394,68 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp, } } - if (is_remote_change) /* includes CLUSTER_FAILURE */ + /* + Refresh local dictionary cache by + invalidating table and all it's indexes + */ + ndb->setDatabaseName(dbname); + Thd_ndb *thd_ndb= get_thd_ndb(thd); + DBUG_ASSERT(thd_ndb != NULL); + Ndb* old_ndb= thd_ndb->ndb; + thd_ndb->ndb= ndb; + ha_ndbcluster table_handler(table_share); + table_handler.set_dbname(share->key); + table_handler.set_tabname(share->key); + table_handler.open_indexes(ndb, table, TRUE); + table_handler.invalidate_dictionary_cache(TRUE); + thd_ndb->ndb= old_ndb; + + /* + Refresh local frm file and dictionary cache if + remote on-line alter table + */ + if (is_remote_change && is_online_alter_table) { - TABLE* table= share->table; - TABLE_SHARE *table_share= table->s; - const char *dbname= table_share->db.str; + const char *tabname= table_share->table_name.str; + char key[FN_REFLEN]; + const void *data= 0, *pack_data= 0; + uint length, pack_length; + int error; + NDBDICT *dict= ndb->getDictionary(); + const NDBTAB *altered_table= pOp->getTable(); - /* - Invalidate table and all it's indexes + DBUG_PRINT("info", ("Detected frm change of table %s.%s", + dbname, tabname)); + build_table_filename(key, FN_LEN-1, dbname, tabname, NullS); + /* + If the frm of the altered table is different than the one on + disk then overwrite it with the new table definition */ - ndb->setDatabaseName(dbname); - Thd_ndb *thd_ndb= get_thd_ndb(thd); - DBUG_ASSERT(thd_ndb != NULL); - Ndb* old_ndb= thd_ndb->ndb; - thd_ndb->ndb= ndb; - ha_ndbcluster table_handler(table_share); - table_handler.set_dbname(share->key); - table_handler.set_tabname(share->key); - table_handler.open_indexes(ndb, table, TRUE); - table_handler.invalidate_dictionary_cache(TRUE); - thd_ndb->ndb= old_ndb; - - if (is_online_alter_table) + if (readfrm(key, &data, &length) == 0 && + packfrm(data, length, &pack_data, &pack_length) == 0 && + cmp_frm(altered_table, pack_data, pack_length)) { - const char *tabname= table_share->table_name.str; - char key[FN_REFLEN]; - const void *data= 0, *pack_data= 0; - uint length, pack_length; - int error; - NDBDICT *dict= ndb->getDictionary(); - const NDBTAB *altered_table= pOp->getTable(); - - DBUG_PRINT("info", ("Detected frm change of table %s.%s", - dbname, tabname)); - build_table_filename(key, FN_LEN-1, dbname, tabname, NullS); - /* - If the frm of the altered table is different than the one on - disk then overwrite it with the new table definition - */ - if (readfrm(key, &data, &length) == 0 && - packfrm(data, length, &pack_data, &pack_length) == 0 && - cmp_frm(altered_table, pack_data, pack_length)) + DBUG_DUMP("frm", (char*)altered_table->getFrmData(), + altered_table->getFrmLength()); + pthread_mutex_lock(&LOCK_open); + const NDBTAB *old= dict->getTable(tabname); + if (!old && + old->getObjectVersion() != altered_table->getObjectVersion()) + dict->putTable(altered_table); + + if ((error= unpackfrm(&data, &length, altered_table->getFrmData())) || + (error= writefrm(key, data, length))) { - DBUG_DUMP("frm", (char*)altered_table->getFrmData(), - altered_table->getFrmLength()); - pthread_mutex_lock(&LOCK_open); - const NDBTAB *old= dict->getTable(tabname); - if (!old && - old->getObjectVersion() != altered_table->getObjectVersion()) - dict->putTable(altered_table); - - if ((error= unpackfrm(&data, &length, altered_table->getFrmData())) || - (error= writefrm(key, data, length))) - { - sql_print_information("NDB: Failed write frm for %s.%s, error %d", - dbname, tabname, error); - } - ndbcluster_binlog_close_table(thd, share); - close_cached_tables((THD*) 0, 0, (TABLE_LIST*) 0, TRUE); - if ((error= ndbcluster_binlog_open_table(thd, share, - table_share, table))) - sql_print_information("NDB: Failed to re-open table %s.%s", - dbname, tabname); - pthread_mutex_unlock(&LOCK_open); + sql_print_information("NDB: Failed write frm for %s.%s, error %d", + dbname, tabname, error); } + ndbcluster_binlog_close_table(thd, share); + close_cached_tables((THD*) 0, 0, (TABLE_LIST*) 0, TRUE); + if ((error= ndbcluster_binlog_open_table(thd, share, + table_share, table))) + sql_print_information("NDB: Failed to re-open table %s.%s", + dbname, tabname); + pthread_mutex_unlock(&LOCK_open); } } From 2cf34e52a65c69c6a333bf539b5ab4f5eae1956f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Apr 2006 20:01:07 -0700 Subject: [PATCH 03/11] Delete unused (and unmaintained) scripts. BitKeeper/deleted/.del-watchdog_mysqld~279cf39e994b36e2: Delete: sql/watchdog_mysqld BitKeeper/deleted/.del-mysqld_safe-watch.sh~37cbc9a97ffd2555: Delete: scripts/mysqld_safe-watch.sh BitKeeper/deleted/.del-mysql_prepare_privilege_tables_for_5.sql~76ea3c82bdbbead4: Delete: scripts/mysql_prepare_privilege_tables_for_5.sql --- .../mysql_prepare_privilege_tables_for_5.sql | 53 ------- scripts/mysqld_safe-watch.sh | 150 ------------------ sql/watchdog_mysqld | 126 --------------- 3 files changed, 329 deletions(-) delete mode 100644 scripts/mysql_prepare_privilege_tables_for_5.sql delete mode 100644 scripts/mysqld_safe-watch.sh delete mode 100755 sql/watchdog_mysqld diff --git a/scripts/mysql_prepare_privilege_tables_for_5.sql b/scripts/mysql_prepare_privilege_tables_for_5.sql deleted file mode 100644 index a9b6d43aee0..00000000000 --- a/scripts/mysql_prepare_privilege_tables_for_5.sql +++ /dev/null @@ -1,53 +0,0 @@ - -use mysql; - --- --- merging `host` table and `db` --- - -UPDATE IGNORE host SET Host='%' WHERE Host=''; -DELETE FROM host WHERE Host=''; - -INSERT IGNORE INTO db (User, Host, Select_priv, Insert_priv, Update_priv, - Delete_priv, Create_priv, Drop_priv, Grant_priv, References_priv, - Index_priv, Alter_priv, Create_tmp_table_priv, Lock_tables_priv) - SELECT d.User, h.Host, - (d.Select_priv = 'Y' || h.Select_priv = 'Y') + 1, - (d.Insert_priv = 'Y' || h.Select_priv = 'Y') + 1, - (d.Update_priv = 'Y' || h.Update_priv = 'Y') + 1, - (d.Delete_priv = 'Y' || h.Delete_priv = 'Y') + 1, - (d.Create_priv = 'Y' || h.Create_priv = 'Y') + 1, - (d.Drop_priv = 'Y' || h.Drop_priv = 'Y') + 1, - (d.Grant_priv = 'Y' || h.Grant_priv = 'Y') + 1, - (d.References_priv = 'Y' || h.References_priv = 'Y') + 1, - (d.Index_priv = 'Y' || h.Index_priv = 'Y') + 1, - (d.Alter_priv = 'Y' || h.Alter_priv = 'Y') + 1, - (d.Create_tmp_table_priv = 'Y' || h.Create_tmp_table_priv = 'Y') + 1, - (d.Lock_tables_priv = 'Y' || h.Lock_tables_priv = 'Y') + 1 - FROM db d, host h WHERE d.Host = ''; - -UPDATE IGNORE db SET Host='%' WHERE Host = ''; -DELETE FROM db WHERE Host=''; - -TRUNCATE TABLE host; - --- --- Adding missing users to `user` table --- --- note that invalid password causes the user to be skipped during the --- load of grand tables (at mysqld startup) thus three following inserts --- do not affect anything - -INSERT IGNORE user (User, Host, Password) SELECT User, Host, "*" FROM db; -INSERT IGNORE user (User, Host, Password) SELECT User, Host, "*" FROM tables_priv; -INSERT IGNORE user (User, Host, Password) SELECT User, Host, "*" FROM columns_priv; - -SELECT DISTINCT -"There are user accounts with the username 'PUBLIC'. In the SQL-1999 -(or later) standard this name is reserved for PUBLIC role and can -not be used as a valid user name. Consider renaming these accounts before -upgrading to MySQL-5.0. -These accounts are:" x -FROM user WHERE user='PUBLIC'; -SELECT CONCAT(user,'@',host) FROM user WHERE user='PUBLIC'; - diff --git a/scripts/mysqld_safe-watch.sh b/scripts/mysqld_safe-watch.sh deleted file mode 100644 index c59b3b2614d..00000000000 --- a/scripts/mysqld_safe-watch.sh +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh -# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB -# This file is public domain and comes with NO WARRANTY of any kind -# -# scripts to start the MySQL demon and restart it if it dies unexpectedly -# -# This should be executed in the MySQL base directory if you are using a -# binary installation that has other paths than you are using. -# -# mysql.server works by first doing a cd to the base directory and from there -# executing mysqld_safe - -# Check if we are starting this relative (for the binary release) -if test -f ./data/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ - -x ./bin/mysqld -then - MY_BASEDIR_VERSION=`pwd` # Where bin, share and data is - DATADIR=$MY_BASEDIR_VERSION/data # Where the databases are - ledir=$MY_BASEDIR_VERSION/bin # Where mysqld are -# Check if this is a 'moved install directory' -elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ - -x ./libexec/mysqld -then - MY_BASEDIR_VERSION=`pwd` # Where libexec, share and var is - DATADIR=$MY_BASEDIR_VERSION/var # Where the databases are - ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld are -else - MY_BASEDIR_VERSION=/usr/local/mysql - DATADIR=/usr/local/mysql/var - ledir=/usr/local/mysql/libexec -fi - -hostname=`@HOSTNAME@` -pidfile=$DATADIR/$hostname.pid -log=$DATADIR/$hostname.log -err=$DATADIR/$hostname.err -lockfile=$DATADIR/$hostname.lock - -# -# If there exists an old pid file, check if the demon is already running -# Note: The switches to 'ps' may depend on your operating system - -if test -f $pidfile -then - PID=`cat $pidfile` - if /bin/kill -0 $PID - then - if /bin/ps -p $PID | grep mysqld > /dev/null - then # The pid contains a mysqld process - echo "A mysqld process already exists" - echo "A mysqld process already exists at " `date` >> $log - exit 1; - fi - fi - rm -f $pidfile - if test -f $pidfile - then - echo "Fatal error: Can't remove the pid file: $pidfile" - echo "Fatal error: Can't remove the pid file: $pidfile at " `date` >> $log - echo "Please remove it manually and start $0 again" - echo "mysqld demon not started" - exit 1; - fi -fi - -echo "Starting mysqld demon with databases from $DATADIR" - -#Default communication ports -#MYSQL_TCP_PORT=3306 -if test -z "$MYSQL_UNIX_PORT" -then - MYSQL_UNIX_PORT="/tmp/mysql.sock" - export MYSQL_UNIX_PORT -fi -#export MYSQL_TCP_PORT - -# Does this work on all systems? -#if type ulimit | grep "shell builtin" > /dev/null -#then -# ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems -#fi - -echo "mysqld started on " `date` >> $log -bin/zap -f $lockfile < /dev/null > /dev/null 2>&1 -rm -f $lockfile -$MY_BASEDIR_VERSION/bin/watchdog_mysqld $lockfile $pidfile $MY_BASEDIR_VERSION/bin $DATADIR 3 10 >> $err 2>&1 & -restart_pid=$! - -while true -do - rm -f $MYSQL_UNIX_PORT $pidfile # Some extra safety - lockfile -1 -r10 $lockfile >/dev/null 2>&1 - if test "$#" -eq 0 - then - nohup $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR \ - --skip-locking >> $err 2>&1 & - else - nohup $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR \ - --skip-locking "$@" >> $err 2>&1 & - fi - pid=$! - rm -f $lockfile - wait $pid; - - lockfile -1 -r10 $lockfile >/dev/null 2>&1 - rm -f $lockfile - if test ! -f $pidfile # This is removed if normal shutdown - then - break; - fi - if true - then - # Test if one proces was hanging. - # This is only a fix for Linux (running as base 3 mysqld processes) - # but should work for the rest of the servers. - # The only thing is ps x => redhat 5 gives warnings when using ps -x. - # kill -9 is used or the proces won't react on the kill. - numofproces=`ps x | grep -v "grep" | grep -c $ledir/mysqld` - echo -e "\nNumber of processes running now: $numofproces" | tee -a $log - I=1 - while test "$I" -le "$numofproces" - do - PROC=`ps x | grep $ledir/mysqld | grep -v "grep" | tail -1` - for T in $PROC - do - break - done - # echo "TEST $I - $T **" - if kill -9 $T - then - echo "mysqld proces hanging, pid $T - killed" | tee -a $log - else - break - fi - I=`expr $I + 1` - done - fi - echo "mysqld restarted" | tee -a $log - # Check all tables and repair any wrong tables. - $MY_BASEDIR_VERSION/bin/isamchk -sf $DATADIR/*/*.ISM >> $err 2>&1 -done -if test $restart_pid -gt 0 -then - kill $restart_pid > /dev/null 2>&1 - sleep 1; - kill -9 $restart_pid > /dev/null 2>&1 -fi - -echo -n "mysqld ended on " `date` >> $log -echo "mysqld demon ended" diff --git a/sql/watchdog_mysqld b/sql/watchdog_mysqld deleted file mode 100755 index 0b26bb15acd..00000000000 --- a/sql/watchdog_mysqld +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/perl -# Copyright (C) 1979-1998 TcX AB & Monty Program KB & Detron HB -# -# This software is distributed with NO WARRANTY OF ANY KIND. No author or -# distributor accepts any responsibility for the consequences of using it, or -# for whether it serves any particular purpose or works at all, unless he or -# she says so in writing. Refer to the Free Public License (the "License") -# for full details. -# -# Every copy of this file must include a copy of the License, normally in a -# plain ASCII text file named PUBLIC. The License grants you the right to -# copy, modify and redistribute this file, but only under certain conditions -# described in the License. Among other things, the License requires that -# the copyright notice and this notice be preserved on all copies. */ - -# -# This scripts is started by safe_mysqld. It checks that MySQL is alive and -# working ( = answering to ping). If not, force mysqld down, check all -# tables and let safe_mysqld restart the server. -# -# For this to work, you should have procmail installed as the commands -# 'lockfile' and is used to sync with safe_mysqld -# -# NOTE: You should only use this script as a last resort if mysqld locks -# up unexpectedly in a critical application and you have to get it to -# work temporarily while waiting for a solution from mysql@tcx.se or -# mysql-support@tcx.se - - -use POSIX "waitpid"; - -# Arguments from safe_mysqld - -if ($#ARGV != 4) -{ - print "$0: Wrong number of arguments. Aborting\n"; - exit 1; -} - -$lock_file=shift; # File to lock to sync with safe_mysqld -$pid_file=shift; # Pid file used by mysqld -$bin_dir=shift; # Directory where mysqladmin is -$test_timeout=shift; # Time between testing if mysqld is alive -$wait_timeout=shift; # How long time to wait for ping - -$|=1; # autoflush - -# Check that mysqld has started properly - -for ($i=1 ; $i < 10 ; $i ++) -{ - last if (-e $pid_file); -} -sleep(1); # If server has just created the file -if (($mysqld_pid=`cat $pid_file`) <= 0) -{ - print "$0: Error: Invalid pidfile (contains '$mysqld_pid'). Aborting\n"; -} - -# Start pinging mysqld - -for (;;) -{ - sleep($test_timeout); # Time between tests - `lockfile $lock_file > /dev/null 2>&1`; # Sync with safe_mysqld - if (($pid=fork()) == 0) - { - setpgrp(0,0); - exit(int(system("$bin_dir/mysqladmin -w status > /dev/null")/256)); - } - for ($i=0; ($res=waitpid(-1,&POSIX::WNOHANG)) == 0 && $i < $wait_timeout ; $i++) - { - sleep(1); - } - if ($res == 0) - { - print "$0: Warning: mysqld hanged; Killing it so that safe_mysqld can restart it!\n"; - $mysqld_pid= `cat $pid_file`; - if ($mysqld_pid <= 0) - { - print "$0: Error: Invalid pidfile (contains '$mysqld_pid'). Aborting\n"; - system("rm -f $lock_file"); - kill(-9,$pid); - exit 1; - } - print "$0: Sending signal 15 to $mysqld_pid\n"; - kill(-15, $pid,$mysqld_pid); # Give it a last change to die nicely - for ($i=0 ; $i < 5 ; $i++) { sleep(1); } # Wait 5 seconds (signal safe) - waitpid(-1,&POSIX::WNOHANG); - if (kill(0,$pid,$mysqld_pid) != 0) - { - print "$0: Sending signal 9 to $mysqld_pid\n"; - kill(-9,$pid,$mysqld_pid); # No time to be nice anymore - sleep(2); # Give system time to clean up - waitpid(-1,&POSIX::WNOHANG); - if (kill(0,$mysqld_pid) != 0) - { - print "$0: Warning: mysqld don't want to die. Aborting\n"; - system("rm -f $lock_file"); - exit 1; - } - } - # safe_mysqld will not restart mysqld if the pid file doesn't exists - system("rm $pid_file"); - system("touch $pid_file"); - } - elsif ($res == -1) - { - print "$0: Error: waitpid returned $res when wating for pid $pid\nPlease verify that $0 is correct for your system\n"; - system("rm -f $lock_file"); - exit 1; - } - else - { - $exit_code=int($?/256); - if ($exit_code != 0) - { - print "$0: Warning: mysqladmin returned exit code $exit_code\n"; - } - else - { - #print "mysqld is alive and feeling well\n"; - } - } - system("rm -f $lock_file"); # safemysqld will now take over -} From c17b103ae7cf5c72c0d4479bec1ab2c71995480a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Apr 2006 08:57:37 +0200 Subject: [PATCH 04/11] Invalidate old table at rename --- sql/ha_ndbcluster_binlog.cc | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index cfa22617093..ace6eeb5db0 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -1376,6 +1376,7 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp, TABLE* table= share->table; TABLE_SHARE *table_share= table->s; const char *dbname= table_share->db.str; + const char *tabname= table_share->table_name.str; bool do_close_cached_tables= FALSE; bool is_online_alter_table= FALSE; bool is_rename_table= FALSE; @@ -1405,8 +1406,8 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp, Ndb* old_ndb= thd_ndb->ndb; thd_ndb->ndb= ndb; ha_ndbcluster table_handler(table_share); - table_handler.set_dbname(share->key); - table_handler.set_tabname(share->key); + (void)strxmov(table_handler.m_dbname, dbname, NullS); + (void)strxmov(table_handler.m_tabname, tabname, NullS); table_handler.open_indexes(ndb, table, TRUE); table_handler.invalidate_dictionary_cache(TRUE); thd_ndb->ndb= old_ndb; @@ -1484,6 +1485,21 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp, share->table->s->db.length= strlen(share->db); share->table->s->table_name.str= share->table_name; share->table->s->table_name.length= strlen(share->table_name); + /* + Refresh local dictionary cache by invalidating any + old table with same name and all it's indexes + */ + ndb->setDatabaseName(dbname); + Thd_ndb *thd_ndb= get_thd_ndb(thd); + DBUG_ASSERT(thd_ndb != NULL); + Ndb* old_ndb= thd_ndb->ndb; + thd_ndb->ndb= ndb; + ha_ndbcluster table_handler(table_share); + table_handler.set_dbname(share->key); + table_handler.set_tabname(share->key); + table_handler.open_indexes(ndb, table, TRUE); + table_handler.invalidate_dictionary_cache(TRUE); + thd_ndb->ndb= old_ndb; } DBUG_ASSERT(share->op == pOp || share->op_old == pOp); if (share->op_old == pOp) From ce79bd5220e24bd41b0012df1a3e4590d9ac2ad1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Apr 2006 12:16:27 +0200 Subject: [PATCH 05/11] Updated result file --- mysql-test/r/ndb_basic.result | 7 ------- 1 file changed, 7 deletions(-) diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result index 9477caf97ab..4a1f5f587df 100644 --- a/mysql-test/r/ndb_basic.result +++ b/mysql-test/r/ndb_basic.result @@ -6,13 +6,6 @@ attr1 INT NOT NULL, attr2 INT, attr3 VARCHAR(10) ) ENGINE=ndbcluster; -drop table t1; -CREATE TABLE t1 ( -pk1 INT NOT NULL PRIMARY KEY, -attr1 INT NOT NULL, -attr2 INT, -attr3 VARCHAR(10) -) ENGINE=ndbcluster; SHOW INDEX FROM t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 0 PRIMARY 1 pk1 A 0 NULL NULL BTREE From b538c3522a4166bb291d3ef179628032e2bdd8ec Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Apr 2006 19:53:17 +0200 Subject: [PATCH 06/11] Disabling test that fails. There is already a bug for the failure. mysql-test/t/disabled.def: Disabling failing test. --- mysql-test/t/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 0558e701344..2a9feec91c1 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -48,6 +48,7 @@ udf : BUG#18564 2006-03-27 ian (Permission by Brian) #ndb_load : BUG#17233 2006-02-16 jmiller failed load data from infile causes mysqld dbug_assert, binlog not flushed #rpl_ndb_basic : BUG#18592 2006-03-28 brian rpl_ndb_basic failure #rpl_ndb_dd_advance : BUG#18924 2006-04-09 brian rpl_ndb_dd_advance failure +rpl_ndb_dd_partitions : BUG#18094 2006-04-19 mats Slave caches invalid table definition... #rpl_ndb_dd_basic : BUG#18569 2006-03-28 brian rpl_ndb_dd_basic failure #rpl_ndb_insert_ignore : BUG#18567 2006-03-28 brian rpl_ndb_insert_ignore failure #rpl_ndb_multi_update2 : BUG#18928 2006-04-09 brian rpl_ndb_multi_update2 failed From 1f4dd29c005ed4621c4d00e9ce20f619b3c6951a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Apr 2006 14:09:49 -0700 Subject: [PATCH 07/11] Turn on test timing in mysql-test-run.pl by default, and clean up usage docs. mysql-test/mysql-test-run.pl: Turn on test timing by default, but make it so it can be turned off with --notimer. Also clean up the mysql-test-run.pl usage information a little bit, and add --benchdir to it. --- mysql-test/mysql-test-run.pl | 50 ++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 40b3954b533..a9a1d46079c 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -284,7 +284,7 @@ our $opt_start_from; our $opt_strace_client; -our $opt_timer; +our $opt_timer= 1; our $opt_user; our $opt_user_test; @@ -682,7 +682,7 @@ sub command_line_setup () { 'socket=s' => \$opt_socket, 'start-dirty' => \$opt_start_dirty, 'start-and-exit' => \$opt_start_and_exit, - 'timer' => \$opt_timer, + 'timer!' => \$opt_timer, 'unified-diff|udiff' => \$opt_udiff, 'user-test=s' => \$opt_user_test, 'user=s' => \$opt_user, @@ -3595,15 +3595,17 @@ Options to control what engine/variation to run compress Use the compressed protocol between client and server ssl Use ssl protocol between client and server skip-ssl Dont start server with support for ssl connections - bench Run the benchmark suite FIXME - small-bench FIXME + bench Run the benchmark suite + small-bench Run the benchmarks with --small-tests --small-tables Options to control directories to use - vardir=DIR The directory where files generated from the test run - is stored(default: ./var). Specifying a ramdisk or tmpfs - will speed up tests. + benchdir=DIR The directory where the benchmark suite is stored + (default: ../../mysql-bench) tmpdir=DIR The directory where temporary files are stored (default: ./var/tmp). + vardir=DIR The directory where files generated from the test run + is stored (default: ./var). Specifying a ramdisk or + tmpfs will speed up tests. Options to control what test suites or cases to run @@ -3618,8 +3620,9 @@ Options to control what test suites or cases to run skip-rpl Skip the replication test cases. skip-im Don't start IM, and skip the IM test cases skip-test=PREFIX Skip test cases which name are prefixed with PREFIX - big-test Pass "--big-test" to mysqltest which will set the environment - variable BIG_TEST, which can be checked from test cases. + big-test Pass "--big-test" to mysqltest which will set the + environment variable BIG_TEST, which can be checked + from test cases. Options that specify ports @@ -3645,25 +3648,29 @@ Options to run test on running server Options for debugging the product - gdb Start the mysqld(s) in gdb - manual-gdb Let user manually start mysqld in gdb, before running test(s) - manual-debug Let user manually start mysqld in debugger, before running test(s) + client-ddd Start mysqltest client in ddd + client-debugger=NAME Start mysqltest in the selected debugger client-gdb Start mysqltest client in gdb ddd Start mysqld in ddd - client-ddd Start mysqltest client in ddd + debug Dump trace output for all servers and client programs debugger=NAME Start mysqld in the selected debugger - client-debugger=NAME Start mysqltest in the selected debugger - strace-client FIXME + gdb Start the mysqld(s) in gdb + manual-debug Let user manually start mysqld in debugger, before + running test(s) + manual-gdb Let user manually start mysqld in gdb, before running + test(s) master-binary=PATH Specify the master "mysqld" to use slave-binary=PATH Specify the slave "mysqld" to use + strace-client Create strace output for mysqltest client Options for coverage, profiling etc gcov FIXME gprof FIXME - valgrind Run the "mysqltest" and "mysqld" executables using valgrind - valgrind-all Same as "valgrind" but will also add "verbose" and "--show-reachable" - flags to valgrind + valgrind Run the "mysqltest" and "mysqld" executables using + valgrind + valgrind-all Same as "valgrind" but will also add "verbose" and + "--show-reachable" flags to valgrind valgrind-mysqltest Run the "mysqltest" executable with valgrind valgrind-mysqld Run the "mysqld" executable with valgrind valgrind-options=ARGS Extra options to give valgrind @@ -3672,10 +3679,10 @@ Options for coverage, profiling etc Misc options comment=STR Write STR to the output + notimer Don't show test case execution time script-debug Debug this script itself - timer Show test case execution time - start-and-exit Only initiate and start the "mysqld" servers, use the startup - settings for the specified test case if any + start-and-exit Only initiate and start the "mysqld" servers, use + the startup settings for the specified test case if any start-dirty Only start the "mysqld" servers without initiation fast Don't try to cleanup from earlier runs reorder Reorder tests to get less server restarts @@ -3690,7 +3697,6 @@ Deprecated options Options not yet described, or that I want to look into more - debug local local-master netware From e0127921c67b63f976ee7dab8ed161da8ef2e407 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Apr 2006 08:56:47 +0200 Subject: [PATCH 08/11] Bug#16993 (ALTER TABLE ADD col AUTO_INCREMENT does not replicate): Removed rpl_ndb_relay_space test since it does not make sense (in its current form) for NDB. BitKeeper/deleted/.del-rpl_ndb_relay_space.test~55e5e4b13d3936d0: Delete: mysql-test/t/rpl_ndb_relay_space.test BitKeeper/deleted/.del-rpl_ndb_relay_space.result~a44835cdd2210d18: Delete: mysql-test/r/rpl_ndb_relay_space.result --- mysql-test/r/rpl_ndb_relay_space.result | 25 ------------------------- mysql-test/t/rpl_ndb_relay_space.test | 21 --------------------- 2 files changed, 46 deletions(-) delete mode 100644 mysql-test/r/rpl_ndb_relay_space.result delete mode 100644 mysql-test/t/rpl_ndb_relay_space.test diff --git a/mysql-test/r/rpl_ndb_relay_space.result b/mysql-test/r/rpl_ndb_relay_space.result deleted file mode 100644 index 930a8cae927..00000000000 --- a/mysql-test/r/rpl_ndb_relay_space.result +++ /dev/null @@ -1,25 +0,0 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; -SHOW VARIABLES LIKE 'relay_log_space_limit'; -Variable_name Value -relay_log_space_limit 0 -CREATE TABLE t1 (name varchar(64), age smallint(3))ENGINE=NDB; -INSERT INTO t1 SET name='Andy', age=31; -INSERT INTO t1 SET name='Jacob', age=2; -INSERT INTO t1 SET name='Caleb', age=1; -ALTER TABLE t1 ADD id int(8) ZEROFILL AUTO_INCREMENT PRIMARY KEY; -SELECT * FROM t1 ORDER BY id; -name age id -Andy 31 00000001 -Caleb 1 00000002 -Jacob 2 00000003 -SELECT * FROM t1 ORDER BY id; -name age id -Andy 31 00000001 -Caleb 1 00000002 -Jacob 2 00000003 -DROP TABLE t1; diff --git a/mysql-test/t/rpl_ndb_relay_space.test b/mysql-test/t/rpl_ndb_relay_space.test deleted file mode 100644 index 0484d807996..00000000000 --- a/mysql-test/t/rpl_ndb_relay_space.test +++ /dev/null @@ -1,21 +0,0 @@ -################################### -# Wrapper rpl_sv_relay_space.test # -# This test has to be wrapped as # -# It tests ndb, innodb and MyISAM.# -# By Wrapping we are saving some # -# space and making the test more # -# Maintainable by only having one # -# test file and reusing the code # -# In Addition, INNODB has to have # -# Option files during this test # -# to force innodb on the slave # -# else the test will fail # -################################### -#Change Author: JBM # -#Change Date: 2006-02-03 # -#Change: Added Comments # -################################### ---source include/have_ndb.inc -let $engine_type=NDB; --- source extra/rpl_tests/rpl_sv_relay_space.test - From d4e3ca7862caed516b2e0941cb137bf7fe227a08 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Apr 2006 11:59:12 +0200 Subject: [PATCH 09/11] Fix build of taocrypt. Don't mention /GX or /EHsc as that will turn ON exception handling and not off as we want. extra/yassl/taocrypt/cmakelists.txt: Don't write anything about /GX or /EHsc as cmake will detect that and turn exception handling ON. Since it's off by default, that is what we want. --- extra/yassl/taocrypt/cmakelists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/extra/yassl/taocrypt/cmakelists.txt b/extra/yassl/taocrypt/cmakelists.txt index 6f4d0395ff6..3ad9195b372 100644 --- a/extra/yassl/taocrypt/cmakelists.txt +++ b/extra/yassl/taocrypt/cmakelists.txt @@ -1,8 +1,5 @@ INCLUDE_DIRECTORIES(../mySTL include) -SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /GX-") -SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GX-") - ADD_LIBRARY(taocrypt src/aes.cpp src/aestables.cpp src/algebra.cpp src/arc4.cpp src/asn.cpp src/coding.cpp src/des.cpp src/dh.cpp src/dsa.cpp src/file.cpp src/hash.cpp src/integer.cpp src/md2.cpp src/md5.cpp src/misc.cpp src/random.cpp src/ripemd.cpp src/rsa.cpp src/sha.cpp From 316c96fa81adeae15533e5eeba25ee64a47467ee Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Apr 2006 12:06:22 +0200 Subject: [PATCH 10/11] Fix for bug#19196: Attempt to create index on usupported field type gives wrong error code --- mysql-test/r/ndb_bitfield.result | 4 +- ndb/include/kernel/signaldata/TupFrag.hpp | 3 +- ndb/include/util/NdbSqlUtil.hpp | 6 +-- ndb/src/common/util/NdbSqlUtil.cpp | 52 ++++++++++++----------- ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp | 5 ++- ndb/src/ndbapi/NdbDictionaryImpl.cpp | 18 +++++--- 6 files changed, 49 insertions(+), 39 deletions(-) diff --git a/mysql-test/r/ndb_bitfield.result b/mysql-test/r/ndb_bitfield.result index 9a941862854..389e19f2893 100644 --- a/mysql-test/r/ndb_bitfield.result +++ b/mysql-test/r/ndb_bitfield.result @@ -201,13 +201,13 @@ create table t1 ( pk1 bit(9) not null primary key, b int ) engine=ndbcluster; -ERROR HY000: Can't create table './test/t1.frm' (errno: 739) +ERROR HY000: Can't create table './test/t1.frm' (errno: 906) create table t1 ( pk1 int not null primary key, b bit(9), key(b) ) engine=ndbcluster; -ERROR HY000: Can't create table './test/t1.frm' (errno: 743) +ERROR HY000: Can't create table './test/t1.frm' (errno: 906) create table t1 ( pk1 int primary key, b bit(32) not null diff --git a/ndb/include/kernel/signaldata/TupFrag.hpp b/ndb/include/kernel/signaldata/TupFrag.hpp index 8acb3d28bd6..5fb9d7bcf42 100644 --- a/ndb/include/kernel/signaldata/TupFrag.hpp +++ b/ndb/include/kernel/signaldata/TupFrag.hpp @@ -146,7 +146,8 @@ public: enum ErrorCode { NoError = 0, InvalidCharset = 743, - TooManyBitsUsed = 831 + TooManyBitsUsed = 831, + UnsupportedType = 906 }; private: Uint32 userPtr; diff --git a/ndb/include/util/NdbSqlUtil.hpp b/ndb/include/util/NdbSqlUtil.hpp index 3e98dcd1805..36a75136c45 100644 --- a/ndb/include/util/NdbSqlUtil.hpp +++ b/ndb/include/util/NdbSqlUtil.hpp @@ -117,9 +117,9 @@ public: /** * Check character set. */ - static bool usable_in_pk(Uint32 typeId, const void* info); - static bool usable_in_hash_index(Uint32 typeId, const void* info); - static bool usable_in_ordered_index(Uint32 typeId, const void* info); + static uint check_column_for_pk(Uint32 typeId, const void* info); + static uint check_column_for_hash_index(Uint32 typeId, const void* info); + static uint check_column_for_ordered_index(Uint32 typeId, const void* info); /** * Get number of length bytes and length from variable length string. diff --git a/ndb/src/common/util/NdbSqlUtil.cpp b/ndb/src/common/util/NdbSqlUtil.cpp index 09e150dbacf..f2506eda6d4 100644 --- a/ndb/src/common/util/NdbSqlUtil.cpp +++ b/ndb/src/common/util/NdbSqlUtil.cpp @@ -872,8 +872,8 @@ NdbSqlUtil::likeLongvarbinary(const void* info, const void* p1, unsigned n1, con // check charset -bool -NdbSqlUtil::usable_in_pk(Uint32 typeId, const void* info) +uint +NdbSqlUtil::check_column_for_pk(Uint32 typeId, const void* info) { const Type& type = getType(typeId); switch (type.m_typeId) { @@ -882,12 +882,14 @@ NdbSqlUtil::usable_in_pk(Uint32 typeId, const void* info) case Type::Longvarchar: { const CHARSET_INFO *cs = (const CHARSET_INFO*)info; - return - cs != 0 && - cs->cset != 0 && - cs->coll != 0 && - cs->coll->strnxfrm != 0 && - cs->strxfrm_multiply <= MAX_XFRM_MULTIPLY; + if(cs != 0 && + cs->cset != 0 && + cs->coll != 0 && + cs->coll->strnxfrm != 0 && + cs->strxfrm_multiply <= MAX_XFRM_MULTIPLY) + return 0; + else + return 743; } break; case Type::Undefined: @@ -896,19 +898,19 @@ NdbSqlUtil::usable_in_pk(Uint32 typeId, const void* info) case Type::Bit: break; default: - return true; + return 0; } - return false; + return 906; } -bool -NdbSqlUtil::usable_in_hash_index(Uint32 typeId, const void* info) +uint +NdbSqlUtil::check_column_for_hash_index(Uint32 typeId, const void* info) { - return usable_in_pk(typeId, info); + return check_column_for_pk(typeId, info); } -bool -NdbSqlUtil::usable_in_ordered_index(Uint32 typeId, const void* info) +uint +NdbSqlUtil::check_column_for_ordered_index(Uint32 typeId, const void* info) { const Type& type = getType(typeId); if (type.m_cmp == NULL) @@ -919,13 +921,15 @@ NdbSqlUtil::usable_in_ordered_index(Uint32 typeId, const void* info) case Type::Longvarchar: { const CHARSET_INFO *cs = (const CHARSET_INFO*)info; - return - cs != 0 && - cs->cset != 0 && - cs->coll != 0 && - cs->coll->strnxfrm != 0 && - cs->coll->strnncollsp != 0 && - cs->strxfrm_multiply <= MAX_XFRM_MULTIPLY; + if (cs != 0 && + cs->cset != 0 && + cs->coll != 0 && + cs->coll->strnxfrm != 0 && + cs->coll->strnncollsp != 0 && + cs->strxfrm_multiply <= MAX_XFRM_MULTIPLY) + return 0; + else + return 743; } break; case Type::Undefined: @@ -934,9 +938,9 @@ NdbSqlUtil::usable_in_ordered_index(Uint32 typeId, const void* info) case Type::Bit: // can be fixed break; default: - return true; + return 0; } - return false; + return 906; } // utilities diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp index 93c4a583624..c85c8384081 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp @@ -217,11 +217,12 @@ Dbtux::execTUX_ADD_ATTRREQ(Signal* signal) break; } if (descAttr.m_charset != 0) { + uint err; CHARSET_INFO *cs = all_charsets[descAttr.m_charset]; ndbrequire(cs != 0); - if (! NdbSqlUtil::usable_in_ordered_index(descAttr.m_typeId, cs)) { + if ((err = NdbSqlUtil::check_column_for_ordered_index(descAttr.m_typeId, cs))) { jam(); - errorCode = TuxAddAttrRef::InvalidCharset; + errorCode = (TuxAddAttrRef::ErrorCode) err; break; } } diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index f7a28eb989c..6cb8e1f9a24 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -1573,7 +1573,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, bool alter) { DBUG_ENTER("NdbDictInterface::createOrAlterTable"); - unsigned i; + unsigned i, err; if((unsigned)impl.getNoOfPrimaryKeys() > NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY){ m_error.code= 4317; DBUG_RETURN(-1); @@ -1683,8 +1683,10 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, DBUG_RETURN(-1); } // primary key type check - if (col->m_pk && ! NdbSqlUtil::usable_in_pk(col->m_type, col->m_cs)) { - m_error.code= (col->m_cs != 0 ? 743 : 739); + if (col->m_pk && + (err = NdbSqlUtil::check_column_for_pk(col->m_type, col->m_cs))) + { + m_error.code= err; DBUG_RETURN(-1); } // distribution key not supported for Char attribute @@ -2157,7 +2159,7 @@ NdbDictInterface::createIndex(Ndb & ndb, { //validate(); //aggregate(); - unsigned i; + unsigned i, err; UtilBufferWriter w(m_buffer); const size_t len = strlen(impl.m_externalName.c_str()) + 1; if(len > MAX_TAB_NAME_SIZE) { @@ -2208,10 +2210,12 @@ NdbDictInterface::createIndex(Ndb & ndb, // index key type check if (it == DictTabInfo::UniqueHashIndex && - ! NdbSqlUtil::usable_in_hash_index(col->m_type, col->m_cs) || + (err = NdbSqlUtil::check_column_for_hash_index(col->m_type, col->m_cs)) + || it == DictTabInfo::OrderedIndex && - ! NdbSqlUtil::usable_in_ordered_index(col->m_type, col->m_cs)) { - m_error.code = 743; + (err = NdbSqlUtil::check_column_for_ordered_index(col->m_type, col->m_cs))) + { + m_error.code = err; return -1; } attributeList.id[i] = col->m_attrId; From f9d56ce8efdd6824c540657e9f88537ce4593c92 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Apr 2006 13:32:41 +0200 Subject: [PATCH 11/11] Fix for bug#19196: Attempt to create index on usupported field type gives wrong error code: updated with new expected error codes --- mysql-test/r/ndb_bitfield.result | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/ndb_bitfield.result b/mysql-test/r/ndb_bitfield.result index 13fd31d7e88..9a8c571cfba 100644 --- a/mysql-test/r/ndb_bitfield.result +++ b/mysql-test/r/ndb_bitfield.result @@ -201,21 +201,21 @@ create table t1 ( pk1 bit(9) not null primary key, b int ) engine=ndbcluster; -ERROR HY000: Can't create table 'test.t1' (errno: 140) +ERROR HY000: Can't create table 'test.t1' (errno: 906) show warnings; Level Code Message -Error 1296 Got error 739 'Unsupported primary key length' from NDB -Error 1005 Can't create table 'test.t1' (errno: 140) +Error 1296 Got error 906 'Unsupported attribute type in index' from NDB +Error 1005 Can't create table 'test.t1' (errno: 906) create table t1 ( pk1 int not null primary key, b bit(9), key(b) ) engine=ndbcluster; -ERROR HY000: Can't create table 'test.t1' (errno: 140) +ERROR HY000: Can't create table 'test.t1' (errno: 906) show warnings; Level Code Message -Error 1296 Got error 743 'Unsupported character set in table or index' from NDB -Error 1005 Can't create table 'test.t1' (errno: 140) +Error 1296 Got error 906 'Unsupported attribute type in index' from NDB +Error 1005 Can't create table 'test.t1' (errno: 906) create table t1 ( pk1 int primary key, b bit(32) not null