Below is the list of changes that have just been committed into a local
5.0 repository of jimw. When jimw does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1839 05/04/15 12:46:42 jimw@stripped +5 -0
Merge from 4.1
sql/handler.h
1.137 05/04/15 12:46:39 jimw@stripped +1 -1
Manually resolve changes
sql/ha_ndbcluster.cc
1.172 05/04/15 12:46:39 jimw@stripped +5 -8
Manually resolve changes
support-files/mysql.server.sh
1.42 05/04/15 12:42:09 jimw@stripped +0 -0
Auto merged
sql/mysqld.cc
1.455 05/04/15 12:42:09 jimw@stripped +0 -0
Auto merged
sql/handler.cc
1.161 05/04/15 12:42:09 jimw@stripped +0 -0
Auto merged
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jimw
# Host: rama.(none)
# Root: /home/jimw/my/mysql-5.0-clean/RESYNC
--- 1.160/sql/handler.cc 2005-04-12 08:22:02 -07:00
+++ 1.161/sql/handler.cc 2005-04-15 12:42:09 -07:00
@@ -149,6 +149,20 @@
return "none";
}
+
+my_bool ha_storage_engine_is_enabled(enum db_type database_type)
+{
+ show_table_type_st *types;
+ for (types= sys_table_types; types->type; types++)
+ {
+ if ((database_type == types->db_type) &&
+ (*types->value == SHOW_OPTION_YES))
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
/* Use other database handler if databasehandler is not incompiled */
enum db_type ha_checktype(enum db_type database_type)
--- 1.136/sql/handler.h 2005-04-11 03:08:58 -07:00
+++ 1.137/sql/handler.h 2005-04-15 12:46:39 -07:00
@@ -812,6 +812,7 @@
const char *ha_get_storage_engine(enum db_type db_type);
handler *get_new_handler(TABLE *table, enum db_type db_type);
enum db_type ha_checktype(enum db_type database_type);
+my_bool ha_storage_engine_is_enabled(enum db_type database_type);
/* basic stuff */
int ha_init(void);
--- 1.454/sql/mysqld.cc 2005-04-13 08:30:08 -07:00
+++ 1.455/sql/mysqld.cc 2005-04-15 12:42:09 -07:00
@@ -1185,6 +1185,7 @@
err:
sql_print_error("Fatal error: Can't change to run as user '%s' ; Please check that the user exists!\n",user);
+ unireg_abort(1);
#endif
return NULL;
}
@@ -6645,6 +6646,18 @@
if (opt_bdb)
sql_print_warning("this binary does not contain BDB storage engine");
#endif
+
+ /*
+ Check that the default storage engine is actually available.
+ */
+ if (!ha_storage_engine_is_enabled((enum db_type)
+ global_system_variables.table_type))
+ {
+ sql_print_error("Default storage engine (%s) is not available",
+ ha_get_storage_engine((enum db_type)
+ global_system_variables.table_type));
+ exit(1);
+ }
if (argc > 0)
{
--- 1.41/support-files/mysql.server.sh 2005-04-01 00:13:28 -08:00
+++ 1.42/support-files/mysql.server.sh 2005-04-15 12:42:09 -07:00
@@ -66,8 +66,14 @@
if test -f $lsb_functions ; then
source $lsb_functions
else
- alias log_success_msg="echo \ SUCCESS! "
- alias log_failure_msg="echo \ ERROR! "
+ log_success_msg()
+ {
+ echo " SUCCESS! $@"
+ }
+ log_failure_msg()
+ {
+ echo " ERROR! $@"
+ }
fi
PATH=/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin
--- 1.171/sql/ha_ndbcluster.cc 2005-04-13 08:30:08 -07:00
+++ 1.172/sql/ha_ndbcluster.cc 2005-04-15 12:46:39 -07:00
@@ -67,6 +67,8 @@
#define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8
+#define NDB_FAILED_AUTO_INCREMENT ~(Uint64)0
+#define NDB_AUTO_INCREMENT_RETRIES 10
#define ERR_PRINT(err) \
DBUG_PRINT("error", ("%d message: %s", err.code, err.message))
@@ -1928,7 +1930,15 @@
{
// Table has hidden primary key
Ndb *ndb= get_ndb();
- Uint64 auto_value= ndb->getAutoIncrementValue((const NDBTAB *) m_table);
+ Uint64 auto_value= NDB_FAILED_AUTO_INCREMENT;
+ uint retries= NDB_AUTO_INCREMENT_RETRIES;
+ do {
+ auto_value= ndb->getAutoIncrementValue((const NDBTAB *) m_table);
+ } while (auto_value == NDB_FAILED_AUTO_INCREMENT &&
+ --retries &&
+ ndb->getNdbError().status == NdbError::TemporaryError);
+ if (auto_value == NDB_FAILED_AUTO_INCREMENT)
+ ERR_RETURN(ndb->getNdbError());
if (set_hidden_key(op, table->s->fields, (const byte*)&auto_value))
ERR_RETURN(op->getNdbError());
}
@@ -4105,6 +4115,7 @@
{
int cache_size;
Uint64 auto_value;
+ uint retries;
DBUG_ENTER("get_auto_increment");
DBUG_PRINT("enter", ("m_tabname: %s", m_tabname));
Ndb *ndb= get_ndb();
@@ -4119,10 +4130,18 @@
: (m_rows_to_insert > m_autoincrement_prefetch) ?
m_rows_to_insert
: m_autoincrement_prefetch;
- auto_value=
- (m_skip_auto_increment) ?
- ndb->readAutoIncrementValue((const NDBTAB *) m_table)
- : ndb->getAutoIncrementValue((const NDBTAB *) m_table, cache_size);
+ auto_value= NDB_FAILED_AUTO_INCREMENT;
+ retries= NDB_AUTO_INCREMENT_RETRIES;
+ do {
+ auto_value=
+ (m_skip_auto_increment) ?
+ ndb->readAutoIncrementValue((const NDBTAB *) m_table)
+ : ndb->getAutoIncrementValue((const NDBTAB *) m_table, cache_size);
+ } while (auto_value == NDB_FAILED_AUTO_INCREMENT &&
+ --retries &&
+ ndb->getNdbError().status == NdbError::TemporaryError);
+ if (auto_value == NDB_FAILED_AUTO_INCREMENT)
+ ERR_RETURN(ndb->getNdbError());
DBUG_RETURN((longlong)auto_value);
}
| Thread |
|---|
| • bk commit into 5.0 tree (jimw:1.1839) | Jim Winstead | 15 Apr |