summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-06-05 09:51:17 +0200
committerSergei Golubchik <serg@mariadb.org>2015-06-05 09:51:17 +0200
commit9a3b975da677e77d63f72f0e6bf0450161b4672d (patch)
tree2cdec174526a799e6e294365befc82533500f64b /sql
parentae0c576d461d751703bf86315740226aaa54c62a (diff)
parenta2bb9d263993783923ba8fc83d5b9ddd36dbe09d (diff)
downloadmariadb-git-9a3b975da677e77d63f72f0e6bf0450161b4672d.tar.gz
Merge branch '5.5' into bb-5.5-serg
Diffstat (limited to 'sql')
-rw-r--r--sql/field.cc2
-rw-r--r--sql/item_strfunc.cc10
-rw-r--r--sql/log_event.cc6
-rw-r--r--sql/sql_partition_admin.cc11
-rw-r--r--sql/sql_view.cc2
-rw-r--r--sql/sql_yacc.yy2
-rw-r--r--sql/table.h2
-rw-r--r--sql/tztime.cc3
8 files changed, 32 insertions, 6 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 52a490921b8..68daba3922d 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -2483,7 +2483,7 @@ void Field_decimal::sql_type(String &res) const
if (dec)
tmp--;
res.length(cs->cset->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
- "decimal(%d,%d)",tmp,dec));
+ "decimal(%d,%d)/*old*/",tmp,dec));
add_zerofill_and_unsigned(res);
}
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index eedf1499403..aca66fc29e0 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -4467,6 +4467,16 @@ null:
void Item_dyncol_get::print(String *str, enum_query_type query_type)
{
+ /*
+ Parent cast doesn't exist yet, only print dynamic column name. This happens
+ when called from create_func_cast() / wrong_precision_error().
+ */
+ if (!str->length())
+ {
+ args[1]->print(str, query_type);
+ return;
+ }
+
/* see create_func_dyncol_get */
DBUG_ASSERT(str->length() >= 5);
DBUG_ASSERT(strncmp(str->ptr() + str->length() - 5, "cast(", 5) == 0);
diff --git a/sql/log_event.cc b/sql/log_event.cc
index d04ac1e1a44..e63884eaeab 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -2192,6 +2192,12 @@ log_event_print_value(IO_CACHE *file, const uchar *ptr,
my_snprintf(typestr, typestr_length, "STRING(%d)", length);
return my_b_write_quoted_with_length(file, ptr, length);
+ case MYSQL_TYPE_DECIMAL:
+ my_b_printf(file,
+ "!! Old DECIMAL (mysql-4.1 or earlier). "
+ "Not enough metadata to display the value. ");
+ break;
+
default:
{
char tmp[5];
diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc
index a03dcc5c16e..a104676a3ff 100644
--- a/sql/sql_partition_admin.cc
+++ b/sql/sql_partition_admin.cc
@@ -174,9 +174,16 @@ bool Alter_table_truncate_partition_statement::execute(THD *thd)
log. The exception is a unimplemented truncate method or failure
before any call to handler::truncate() is done.
Also, it is logged in statement format, regardless of the binlog format.
+
+ Since we've changed data within the table, we also have to invalidate
+ the query cache for it.
*/
- if (error != HA_ERR_WRONG_COMMAND && binlog_stmt)
- error|= write_bin_log(thd, !error, thd->query(), thd->query_length());
+ if (error != HA_ERR_WRONG_COMMAND)
+ {
+ query_cache_invalidate3(thd, first_table, FALSE);
+ if (binlog_stmt)
+ error|= write_bin_log(thd, !error, thd->query(), thd->query_length());
+ }
/*
A locked table ticket was upgraded to a exclusive lock. After the
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 47b238715ac..255f876e02a 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -228,7 +228,7 @@ fill_defined_view_parts (THD *thd, TABLE_LIST *view)
view->definer.user= decoy.definer.user;
lex->definer= &view->definer;
}
- if (lex->create_view_algorithm == DTYPE_ALGORITHM_UNDEFINED)
+ if (lex->create_view_algorithm == VIEW_ALGORITHM_INHERIT)
lex->create_view_algorithm= (uint8) decoy.algorithm;
if (lex->create_view_suid == VIEW_SUID_DEFAULT)
lex->create_view_suid= decoy.view_suid ?
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 5b2f10b278c..ec246ae8079 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -6552,7 +6552,7 @@ alter:
my_error(ER_SP_BADSTATEMENT, MYF(0), "ALTER VIEW");
MYSQL_YYABORT;
}
- lex->create_view_algorithm= DTYPE_ALGORITHM_UNDEFINED;
+ lex->create_view_algorithm= VIEW_ALGORITHM_INHERIT;
lex->create_view_mode= VIEW_ALTER;
}
view_tail
diff --git a/sql/table.h b/sql/table.h
index 832445486ab..17fdd4aba15 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -1446,6 +1446,8 @@ typedef struct st_schema_table
#define DT_PHASES_MATERIALIZE (DT_COMMON | DT_MATERIALIZE)
#define VIEW_ALGORITHM_UNDEFINED 0
+/* Special value for ALTER VIEW: inherit original algorithm. */
+#define VIEW_ALGORITHM_INHERIT DTYPE_VIEW
#define VIEW_ALGORITHM_MERGE (DTYPE_VIEW | DTYPE_MERGE)
#define VIEW_ALGORITHM_TMPTABLE (DTYPE_VIEW | DTYPE_MATERIALIZE)
diff --git a/sql/tztime.cc b/sql/tztime.cc
index da23d6fc8c2..079611504cc 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -2521,7 +2521,8 @@ scan_tz_dir(char * name_end, uint symlink_recursion_level, uint verbose)
for (i= 0; i < cur_dir->number_off_files; i++)
{
- if (cur_dir->dir_entry[i].name[0] != '.')
+ if (cur_dir->dir_entry[i].name[0] != '.' &&
+ strcmp(cur_dir->dir_entry[i].name, "Factory"))
{
name_end_tmp= strmake(name_end, cur_dir->dir_entry[i].name,
FN_REFLEN - (name_end - fullname));