Below is the list of changes that have just been committed into a local
5.2 repository of msvensson. When msvensson 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.2158 06/02/24 10:08:55 msvensson@neptunus.(none) +5 -0
Merge bk-internal.mysql.com:/home/bk/mysql-5.2
into neptunus.(none):/home/msvensson/mysql/mysql-5.2
sql/sql_yacc.yy
1.461 06/02/24 10:08:48 msvensson@neptunus.(none) +0 -0
Auto merged
sql/share/errmsg.txt
1.83 06/02/24 10:08:48 msvensson@neptunus.(none) +0 -0
Auto merged
sql/handler.cc
1.218 06/02/24 10:08:47 msvensson@neptunus.(none) +0 -0
Auto merged
mysql-test/r/innodb.result
1.164 06/02/24 10:08:47 msvensson@neptunus.(none) +0 -0
Auto merged
configure.in
1.339 06/02/24 10:08:47 msvensson@neptunus.(none) +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: msvensson
# Host: neptunus.(none)
# Root: /home/msvensson/mysql/mysql-5.2/RESYNC
--- 1.338/configure.in 2006-02-15 12:05:29 +01:00
+++ 1.339/configure.in 2006-02-24 10:08:47 +01:00
@@ -1856,7 +1856,7 @@
pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
realpath rename rint rwlock_init setupterm \
shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
- sighold sigset sigthreadmask \
+ sighold sigset sigthreadmask sleep \
snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr strtol \
strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr \
posix_fallocate)
--- 1.217/sql/handler.cc 2006-02-15 12:05:29 +01:00
+++ 1.218/sql/handler.cc 2006-02-24 10:08:47 +01:00
@@ -359,6 +359,7 @@
SETMSG(HA_ERR_NO_CONNECTION, "Could not connect to storage engine");
SETMSG(HA_ERR_TABLE_DEF_CHANGED, ER(ER_TABLE_DEF_CHANGED));
SETMSG(HA_ERR_FOREIGN_DUPLICATE_KEY, "FK constraint would lead to duplicate key");
+ SETMSG(HA_ERR_TABLE_NEEDS_UPGRADE, ER(ER_TABLE_NEEDS_UPGRADE));
/* Register the error messages for use with my_error(). */
return my_error_register(errmsgs, HA_ERR_FIRST, HA_ERR_LAST);
@@ -1975,6 +1976,9 @@
my_error(ER_DROP_INDEX_FK, MYF(0), ptr);
DBUG_VOID_RETURN;
}
+ case HA_ERR_TABLE_NEEDS_UPGRADE:
+ textno=ER_TABLE_NEEDS_UPGRADE;
+ break;
default:
{
/* The error was "unknown" to this function.
@@ -2016,6 +2020,100 @@
}
+int handler::ha_check_for_upgrade(HA_CHECK_OPT *check_opt)
+{
+ KEY *keyinfo, *keyend;
+ KEY_PART_INFO *keypart, *keypartend;
+
+ if (!table->s->mysql_version)
+ {
+ /* check for blob-in-key error */
+ keyinfo= table->key_info;
+ keyend= table->key_info + table->s->keys;
+ for (; keyinfo < keyend; keyinfo++)
+ {
+ keypart= keyinfo->key_part;
+ keypartend= keypart + keyinfo->key_parts;
+ for (; keypart < keypartend; keypart++)
+ {
+ if (!keypart->fieldnr)
+ continue;
+ Field *field= table->field[keypart->fieldnr-1];
+ if (field->type() == FIELD_TYPE_BLOB)
+ {
+ if (check_opt->sql_flags & TT_FOR_UPGRADE)
+ check_opt->flags= T_MEDIUM;
+ return HA_ADMIN_NEEDS_CHECK;
+ }
+ }
+ }
+ }
+ return check_for_upgrade(check_opt);
+}
+
+
+int handler::check_old_types()
+{
+ Field** field;
+
+ if (!table->s->mysql_version)
+ {
+ /* check for bad DECIMAL field */
+ for (field= table->field; (*field); field++)
+ {
+ if ((*field)->type() == FIELD_TYPE_NEWDECIMAL)
+ {
+ return HA_ADMIN_NEEDS_ALTER;
+ }
+ }
+ }
+ return 0;
+}
+
+
+static bool update_frm_version(TABLE *table, bool needs_lock)
+{
+ char path[FN_REFLEN];
+ File file;
+ int result= 1;
+ DBUG_ENTER("update_frm_version");
+
+ if (table->s->mysql_version != MYSQL_VERSION_ID)
+ DBUG_RETURN(0);
+
+ strxmov(path, table->s->normalized_path.str, reg_ext, NullS);
+
+ if (needs_lock)
+ pthread_mutex_lock(&LOCK_open);
+
+ if ((file= my_open(path, O_RDWR|O_BINARY, MYF(MY_WME))) >= 0)
+ {
+ uchar version[4];
+ char *key= table->s->table_cache_key.str;
+ uint key_length= table->s->table_cache_key.length;
+ TABLE *entry;
+ HASH_SEARCH_STATE state;
+
+ int4store(version, MYSQL_VERSION_ID);
+
+ if ((result= my_pwrite(file,(byte*) version,4,51L,MYF_RW)))
+ goto err;
+
+ for (entry=(TABLE*) hash_first(&open_cache,(byte*) key,key_length, &state);
+ entry;
+ entry= (TABLE*) hash_next(&open_cache,(byte*) key,key_length, &state))
+ entry->s->mysql_version= MYSQL_VERSION_ID;
+ }
+err:
+ if (file >= 0)
+ VOID(my_close(file,MYF(MY_WME)));
+ if (needs_lock)
+ pthread_mutex_unlock(&LOCK_open);
+ DBUG_RETURN(result);
+}
+
+
+
/* Return key if error because of duplicated keys */
uint handler::get_dup_key(int error)
@@ -2089,6 +2187,56 @@
{
close();
delete_table(name);
+}
+
+
+/*
+ Performs checks upon the table.
+
+ SYNOPSIS
+ check()
+ thd thread doing CHECK TABLE operation
+ check_opt options from the parser
+
+ NOTES
+
+ RETURN
+ HA_ADMIN_OK Successful upgrade
+ HA_ADMIN_NEEDS_UPGRADE Table has structures requiring upgrade
+ HA_ADMIN_NEEDS_ALTER Table has structures requiring ALTER TABLE
+ HA_ADMIN_NOT_IMPLEMENTED
+*/
+
+int handler::ha_check(THD *thd, HA_CHECK_OPT *check_opt)
+{
+ int error;
+
+ if ((table->s->mysql_version >= MYSQL_VERSION_ID) &&
+ (check_opt->sql_flags & TT_FOR_UPGRADE))
+ return 0;
+
+ if (table->s->mysql_version < MYSQL_VERSION_ID)
+ {
+ if ((error= check_old_types()))
+ return error;
+ error= ha_check_for_upgrade(check_opt);
+ if (error && (error != HA_ADMIN_NEEDS_CHECK))
+ return error;
+ if (!error && (check_opt->sql_flags & TT_FOR_UPGRADE))
+ return 0;
+ }
+ if ((error= check(thd, check_opt)))
+ return error;
+ return update_frm_version(table, 0);
+}
+
+
+int handler::ha_repair(THD* thd, HA_CHECK_OPT* check_opt)
+{
+ int result;
+ if ((result= repair(thd, check_opt)))
+ return result;
+ return update_frm_version(table, 0);
}
--- 1.460/sql/sql_yacc.yy 2006-02-15 12:05:30 +01:00
+++ 1.461/sql/sql_yacc.yy 2006-02-24 10:08:48 +01:00
@@ -665,6 +665,7 @@
%token UNSIGNED
%token UNTIL_SYM
%token UPDATE_SYM
+%token UPGRADE_SYM
%token USAGE
%token USER
%token USE_FRM
@@ -1678,6 +1679,16 @@
LEX *lex= Lex;
sp_head *sp;
+ /*
+ First check if AGGREGATE was used, in that case it's a
+ syntax error.
+ */
+ if (lex->udf.type == UDFTYPE_AGGREGATE)
+ {
+ my_error(ER_SP_NO_AGGREGATE, MYF(0));
+ YYABORT;
+ }
+
if (lex->sphead)
{
my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "FUNCTION");
@@ -5349,6 +5360,11 @@
RESTORE_SYM table_or_tables
{
Lex->sql_command = SQLCOM_RESTORE_TABLE;
+ push_warning_printf(((THD *)yythd), MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARN_DEPRECATED_STATEMENT,
+ ER(ER_WARN_DEPRECATED_STATEMENT),
+ "RESTORE TABLE", "5.2",
+ "mysqldump, mysql, MySQL Administrator");
}
table_list FROM TEXT_STRING_sys
{
@@ -5359,6 +5375,11 @@
BACKUP_SYM table_or_tables
{
Lex->sql_command = SQLCOM_BACKUP_TABLE;
+ push_warning_printf(((THD *)yythd), MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARN_DEPRECATED_STATEMENT,
+ ER(ER_WARN_DEPRECATED_STATEMENT),
+ "BACKUP TABLE", "5.2",
+ "mysqldump, mysql, MySQL Administrator");
}
table_list TO_SYM TEXT_STRING_sys
{
@@ -5456,7 +5477,8 @@
| FAST_SYM { Lex->check_opt.flags|= T_FAST; }
| MEDIUM_SYM { Lex->check_opt.flags|= T_MEDIUM; }
| EXTENDED_SYM { Lex->check_opt.flags|= T_EXTEND; }
- | CHANGED { Lex->check_opt.flags|= T_CHECK_ONLY_CHANGED; };
+ | CHANGED { Lex->check_opt.flags|= T_CHECK_ONLY_CHANGED; }
+ | FOR_SYM UPGRADE_SYM { Lex->check_opt.sql_flags|= TT_FOR_UPGRADE; };
optimize:
OPTIMIZE opt_no_write_to_binlog table_or_tables
@@ -8664,7 +8686,12 @@
LOAD TABLE_SYM table_ident FROM MASTER_SYM
{
LEX *lex=Lex;
- if (lex->sphead)
+ push_warning_printf(((THD *)yythd), MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARN_DEPRECATED_STATEMENT,
+ ER(ER_WARN_DEPRECATED_STATEMENT),
+ "LOAD TABLE FROM MASTER", "5.2",
+ "mysqldump, mysql, MySQL Administrator");
+ if (lex->sphead)
{
my_error(ER_SP_BADSTATEMENT, MYF(0), "LOAD TABLE");
YYABORT;
@@ -9783,8 +9810,7 @@
| option_type TRANSACTION_SYM ISOLATION LEVEL_SYM isolation_types
{
LEX *lex=Lex;
- if ($1)
- lex->option_type= $1;
+ lex->option_type= $1;
lex->var_list.push_back(new set_var(lex->option_type,
find_sys_var("tx_isolation"),
&null_lex_str,
--- 1.82/sql/share/errmsg.txt 2006-02-15 12:05:30 +01:00
+++ 1.83/sql/share/errmsg.txt 2006-02-24 10:08:48 +01:00
@@ -5660,8 +5660,8 @@
eng "For the partitioned engine it is necessary to define all %-.64s"
ER_TOO_MANY_PARTITIONS_ERROR
- eng "Too many partitions were defined"
+ eng "Too many partitions (including subpartitions) were defined"
ER_SUBPARTITION_ERROR
eng "It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning"
@@ -5804,3 +5804,16 @@
eng "Upholding foreign key constraints for table '%.64s', entry '%-.64s', key %d would lead to a duplicate entry"
ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE
eng "Column count of mysql.%s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. Please use scripts/mysql_fix_privilege_tables"
+ER_TABLE_NEEDS_UPGRADE
+ eng "Table upgrade required. Please do \"REPAIR TABLE `%-.32s`\" to fix it!"
+ER_ILLEGAL_HA_CREATE_OPTION
+ eng "Table storage engine '%-.64s' does not support the create option '%.64s'"
+ER_CANT_CHANGE_TX_ISOLATION 25001
+ eng "Transaction isolation level can't be changed while a transaction is in progress"
+ER_WARN_DEPRECATED_STATEMENT
+ eng "The '%s' statement is deprecated and will be removed in MySQL %s. Please use client programs (e.g. %s) instead."
+
+ER_TABLE_NEEDS_UPGRADE
+ eng "Table upgrade required. Please do \"REPAIR TABLE `%-.32s`\" to fix it!"
+ER_SP_NO_AGGREGATE 42000
+ eng "AGGREGATE is not supported for stored functions"
| Thread |
|---|
| • bk commit into 5.2 tree (msvensson:1.2158) | msvensson | 24 Feb |