summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/field.cc4
-rw-r--r--sql/item_cmpfunc.cc1
-rw-r--r--sql/sql_class.h1
-rw-r--r--sql/sql_insert.cc1
-rw-r--r--sql/sql_yacc.yy6
5 files changed, 9 insertions, 4 deletions
diff --git a/sql/field.cc b/sql/field.cc
index ff1b47441b0..ce30c5a4744 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -6426,8 +6426,8 @@ uint Field_string::get_key_image(uchar *buff, uint length, imagetype type_arg)
length / field_charset->mbmaxlen);
memcpy(buff, ptr, bytes);
if (bytes < length)
- field_charset->cset->fill(field_charset, buff + bytes, length - bytes,
- field_charset->pad_char);
+ field_charset->cset->fill(field_charset, (char*) buff + bytes,
+ length - bytes, field_charset->pad_char);
return bytes;
}
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 19809ed08c7..39ea5ae1236 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1772,6 +1772,7 @@ void Item_func_between::fix_length_and_dec()
int i;
bool datetime_found= FALSE;
compare_as_dates= TRUE;
+ THD *thd= current_thd;
/*
As some compare functions are generated after sql_yacc,
diff --git a/sql/sql_class.h b/sql/sql_class.h
index d9dc4117319..817a1e51e0e 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -73,6 +73,7 @@ typedef struct st_copy_info {
ha_rows updated;
ha_rows copied;
ha_rows error_count;
+ ha_rows touched; /* Number of touched records */
enum enum_duplicates handle_duplicates;
int escape_char, last_errno;
bool ignore;
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index a97af9225f0..4a5bcd55e89 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1429,6 +1429,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
}
goto err;
}
+ info->touched++;
if ((table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ) ||
compare_record(table))
{
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 523fd254d6c..9ed512bb5fb 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -7509,7 +7509,8 @@ select_derived2:
{
LEX *lex= Lex;
lex->derived_tables|= DERIVED_SUBQUERY;
- if (!lex->expr_allows_subselect)
+ if (!lex->expr_allows_subselect ||
+ lex->sql_command == (int)SQLCOM_PURGE)
{
my_parse_error(ER(ER_SYNTAX_ERROR));
MYSQL_YYABORT;
@@ -11231,7 +11232,8 @@ subselect_init:
subselect_start:
{
LEX *lex=Lex;
- if (!lex->expr_allows_subselect)
+ if (!lex->expr_allows_subselect ||
+ lex->sql_command == (int)SQLCOM_PURGE)
{
my_parse_error(ER(ER_SYNTAX_ERROR));
MYSQL_YYABORT;