Commit f37d5e57 authored by unknown's avatar unknown

resolve new updates group_concat


include/mysqld_error.h:
  resolve error message
sql/mysqld.cc:
  resolve option
sql/set_var.cc:
  resolve variable
sql/share/english/errmsg.txt:
  resolve error message
sql/sql_class.h:
  resolve
parent 994a9aba
...@@ -266,5 +266,9 @@ ...@@ -266,5 +266,9 @@
#define ER_SELECT_REDUCED 1247 #define ER_SELECT_REDUCED 1247
#define ER_TABLENAME_NOT_ALLOWED_HERE 1248 #define ER_TABLENAME_NOT_ALLOWED_HERE 1248
#define ER_NOT_SUPPORTED_AUTH_MODE 1249 #define ER_NOT_SUPPORTED_AUTH_MODE 1249
#define ER_CUT_VALUE_GROUP_CONCAT 1250 #define ER_SPATIAL_CANT_HAVE_NULL 1250
#define ER_ERROR_MESSAGES 251 #define ER_COLLATION_CHARSET_MISMATCH 1251
#define ER_SLAVE_WAS_RUNNING 1252
#define ER_SLAVE_WAS_NOT_RUNNING 1253
#define ER_CUT_VALUE_GROUP_CONCAT 1254
#define ER_ERROR_MESSAGES 255
...@@ -3485,6 +3485,7 @@ enum options ...@@ -3485,6 +3485,7 @@ enum options
OPT_OLD_PASSWORDS, OPT_OLD_PASSWORDS,
OPT_EXPIRE_LOGS_DAYS, OPT_EXPIRE_LOGS_DAYS,
OPT_DEFAULT_WEEK_FORMAT OPT_DEFAULT_WEEK_FORMAT
OPT_GROUP_CONCAT_MAX_LEN
}; };
...@@ -3600,6 +3601,11 @@ struct my_option my_long_options[] = ...@@ -3600,6 +3601,11 @@ struct my_option my_long_options[] =
GET_LONG, OPT_ARG, 0, 0, 0, 0, 0, 0}, GET_LONG, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"flush", OPT_FLUSH, "Flush tables to disk between SQL commands", 0, 0, 0, {"flush", OPT_FLUSH, "Flush tables to disk between SQL commands", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{ "group_concat_max_len", OPT_GROUP_CONCAT_MAX_LEN,
"The maximum length of the result of function group_concat.",
(gptr*) &global_system_variables.group_concat_max_len,
(gptr*) &max_system_variables.group_concat_max_len, 0, GET_ULONG,
REQUIRED_ARG, 1024, 4, (long) ~0, 0, 1, 0},
/* We must always support the next option to make scripts like mysqltest /* We must always support the next option to make scripts like mysqltest
easier to do */ easier to do */
{"init-rpl-role", OPT_INIT_RPL_ROLE, "Set the replication role", 0, 0, 0, {"init-rpl-role", OPT_INIT_RPL_ROLE, "Set the replication role", 0, 0, 0,
......
...@@ -323,6 +323,9 @@ static sys_var_rand_seed2 sys_rand_seed2("rand_seed2"); ...@@ -323,6 +323,9 @@ static sys_var_rand_seed2 sys_rand_seed2("rand_seed2");
static sys_var_thd_ulong sys_default_week_format("default_week_format", static sys_var_thd_ulong sys_default_week_format("default_week_format",
&SV::default_week_format); &SV::default_week_format);
sys_var_thd_ulong sys_group_concat_max_len("group_concat_max_len",
&SV::group_concat_max_len);
/* /*
List of all variables for initialisation and storage in hash List of all variables for initialisation and storage in hash
This is sorted in alphabetical order to make it easy to add new variables This is sorted in alphabetical order to make it easy to add new variables
...@@ -354,6 +357,7 @@ sys_var *sys_variables[]= ...@@ -354,6 +357,7 @@ sys_var *sys_variables[]=
&sys_flush, &sys_flush,
&sys_flush_time, &sys_flush_time,
&sys_foreign_key_checks, &sys_foreign_key_checks,
&sys_group_concat_max_len,
&sys_identity, &sys_identity,
&sys_insert_id, &sys_insert_id,
&sys_interactive_timeout, &sys_interactive_timeout,
......
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
"Result string is longer than max_allowed_packet", "Result string is longer than max_allowed_packet",
"The used table type doesn't support BLOB/TEXT columns", "The used table type doesn't support BLOB/TEXT columns",
"The used table type doesn't support AUTO_INCREMENT columns", "The used table type doesn't support AUTO_INCREMENT columns",
"INSERT DELAYED can't be used with table '%-.64s', because it is locked with LOCK TABLES", "INSERT DELAYED can't be used with table '%-.64s' because it is locked with LOCK TABLES",
"Incorrect column name '%-.100s'", "Incorrect column name '%-.100s'",
"The used table handler can't index column '%-.64s'", "The used table handler can't index column '%-.64s'",
"All tables in the MERGE table are not identically defined", "All tables in the MERGE table are not identically defined",
...@@ -198,7 +198,7 @@ ...@@ -198,7 +198,7 @@
"Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and should be repaired",
"Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed",
"Some non-transactional changed tables couldn't be rolled back", "Some non-transactional changed tables couldn't be rolled back",
"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again', "Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again",
"This operation cannot be performed with a running slave, run STOP SLAVE first", "This operation cannot be performed with a running slave, run STOP SLAVE first",
"This operation requires a running slave, configure slave and do START SLAVE", "This operation requires a running slave, configure slave and do START SLAVE",
"The server is not configured as slave, fix in config file or with CHANGE MASTER TO", "The server is not configured as slave, fix in config file or with CHANGE MASTER TO",
...@@ -250,5 +250,9 @@ ...@@ -250,5 +250,9 @@
"Every derived table must have it's own alias", "Every derived table must have it's own alias",
"Select %u was reduced during optimisation", "Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s" "Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client", "Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"All parts of a SPATIAL KEY must be NOT NULL"
"COLLATION '%s' is not valid for CHARACTER SET '%s'"
"The slave was already running"
"The slave was already stopped"
"%d line(s) was(were) cut by group_concat()" "%d line(s) was(were) cut by group_concat()"
...@@ -34,6 +34,8 @@ enum enum_log_type { LOG_CLOSED, LOG_NORMAL, LOG_NEW, LOG_BIN }; ...@@ -34,6 +34,8 @@ enum enum_log_type { LOG_CLOSED, LOG_NORMAL, LOG_NEW, LOG_BIN };
enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON, enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON,
DELAY_KEY_WRITE_ALL }; DELAY_KEY_WRITE_ALL };
extern char internal_table_name[2];
// log info errors // log info errors
#define LOG_INFO_EOF -1 #define LOG_INFO_EOF -1
#define LOG_INFO_IO -2 #define LOG_INFO_IO -2
...@@ -143,7 +145,9 @@ class MYSQL_LOG { ...@@ -143,7 +145,9 @@ class MYSQL_LOG {
int generate_new_name(char *new_name,const char *old_name); int generate_new_name(char *new_name,const char *old_name);
void make_log_name(char* buf, const char* log_ident); void make_log_name(char* buf, const char* log_ident);
bool is_active(const char* log_file_name); bool is_active(const char* log_file_name);
int update_log_index(LOG_INFO* linfo);
int purge_logs(THD* thd, const char* to_log); int purge_logs(THD* thd, const char* to_log);
int purge_logs_before_date(THD* thd, time_t purge_time);
int purge_first_log(struct st_relay_log_info* rli); int purge_first_log(struct st_relay_log_info* rli);
bool reset_logs(THD* thd); bool reset_logs(THD* thd);
// if we are exiting, we also want to close the index file // if we are exiting, we also want to close the index file
...@@ -170,32 +174,6 @@ class MYSQL_LOG { ...@@ -170,32 +174,6 @@ class MYSQL_LOG {
/* character conversion tables */ /* character conversion tables */
class CONVERT;
CONVERT *get_convert_set(const char *name_ptr);
class CONVERT
{
const uchar *from_map,*to_map;
void convert_array(const uchar *mapping,uchar *buff,uint length);
public:
const char *name;
uint numb;
CONVERT(const char *name_par,uchar *from_par,uchar *to_par, uint number)
:from_map(from_par),to_map(to_par),name(name_par),numb(number) {}
friend CONVERT *get_convert_set(const char *name_ptr);
inline void convert(char *a,uint length)
{
convert_array(from_map, (uchar*) a,length);
}
char *store_dest(char *to, const char *from, uint length)
{
for (const char *end=from+length ; from != end ; from++)
*to++= to_map[(uchar) *from];
return to;
}
bool store(String *, const char *,uint);
inline uint number() { return numb; }
};
typedef struct st_copy_info { typedef struct st_copy_info {
ha_rows records; ha_rows records;
...@@ -360,10 +338,6 @@ class select_result; ...@@ -360,10 +338,6 @@ class select_result;
#define THD_SENTRY_MAGIC 0xfeedd1ff #define THD_SENTRY_MAGIC 0xfeedd1ff
#define THD_SENTRY_GONE 0xdeadbeef #define THD_SENTRY_GONE 0xdeadbeef
#ifdef EMBEDDED_LIBRARY
typedef struct st_mysql;
#endif
#define THD_CHECK_SENTRY(thd) DBUG_ASSERT(thd->dbug_sentry == THD_SENTRY_MAGIC) #define THD_CHECK_SENTRY(thd) DBUG_ASSERT(thd->dbug_sentry == THD_SENTRY_MAGIC)
struct system_variables struct system_variables
...@@ -396,6 +370,7 @@ struct system_variables ...@@ -396,6 +370,7 @@ struct system_variables
ulong tmp_table_size; ulong tmp_table_size;
ulong tx_isolation; ulong tx_isolation;
ulong sql_mode; ulong sql_mode;
ulong default_week_format;
ulong group_concat_max_len; ulong group_concat_max_len;
/* /*
In slave thread we need to know in behalf of which In slave thread we need to know in behalf of which
...@@ -405,8 +380,9 @@ struct system_variables ...@@ -405,8 +380,9 @@ struct system_variables
my_bool log_warnings; my_bool log_warnings;
my_bool low_priority_updates; my_bool low_priority_updates;
my_bool new_mode;
my_bool convert_result_charset;
CONVERT *convert_set;
CHARSET_INFO *thd_charset; CHARSET_INFO *thd_charset;
}; };
...@@ -453,8 +429,9 @@ class THD :public ilink ...@@ -453,8 +429,9 @@ class THD :public ilink
db - currently selected database db - currently selected database
ip - client IP ip - client IP
*/ */
char *host,*user,*priv_user,*db,*ip; char *host,*user,*priv_user,*db,*ip;
/* remote (peer) port */
uint16 peer_port;
/* Points to info-string that will show in SHOW PROCESSLIST */ /* Points to info-string that will show in SHOW PROCESSLIST */
const char *proc_info; const char *proc_info;
/* points to host if host is available, otherwise points to ip */ /* points to host if host is available, otherwise points to ip */
...@@ -577,6 +554,7 @@ class THD :public ilink ...@@ -577,6 +554,7 @@ class THD :public ilink
void init(void); void init(void);
void change_user(void); void change_user(void);
void init_for_queries();
void cleanup(void); void cleanup(void);
bool store_globals(); bool store_globals();
#ifdef SIGNAL_WITH_VIO_CLOSE #ifdef SIGNAL_WITH_VIO_CLOSE
...@@ -684,7 +662,9 @@ class THD :public ilink ...@@ -684,7 +662,9 @@ class THD :public ilink
{ {
is_fatal_error= 1; is_fatal_error= 1;
net.report_error= 1; net.report_error= 1;
DBUG_PRINT("error",("Fatal error set"));
} }
inline CHARSET_INFO *charset() { return variables.thd_charset; }
}; };
/* /*
...@@ -910,10 +890,11 @@ class Table_ident :public Sql_alloc ...@@ -910,10 +890,11 @@ class Table_ident :public Sql_alloc
LEX_STRING db; LEX_STRING db;
LEX_STRING table; LEX_STRING table;
SELECT_LEX_UNIT *sel; SELECT_LEX_UNIT *sel;
inline Table_ident(LEX_STRING db_arg, LEX_STRING table_arg, bool force) inline Table_ident(THD *thd, LEX_STRING db_arg, LEX_STRING table_arg,
bool force)
:table(table_arg), sel((SELECT_LEX_UNIT *)0) :table(table_arg), sel((SELECT_LEX_UNIT *)0)
{ {
if (!force && (current_thd->client_capabilities & CLIENT_NO_SCHEMA)) if (!force && (thd->client_capabilities & CLIENT_NO_SCHEMA))
db.str=0; db.str=0;
else else
db= db_arg; db= db_arg;
...@@ -925,7 +906,8 @@ class Table_ident :public Sql_alloc ...@@ -925,7 +906,8 @@ class Table_ident :public Sql_alloc
} }
inline Table_ident(SELECT_LEX_UNIT *s) : sel(s) inline Table_ident(SELECT_LEX_UNIT *s) : sel(s)
{ {
db.str=0; table.str=(char *)""; table.length=0; /* We must have a table name here as this is used with add_table_to_list */
db.str=0; table.str= internal_table_name; table.length=1;
} }
inline void change_db(char *db_name) inline void change_db(char *db_name)
{ {
...@@ -942,6 +924,7 @@ class user_var_entry ...@@ -942,6 +924,7 @@ class user_var_entry
ulong length, update_query_id, used_query_id; ulong length, update_query_id, used_query_id;
Item_result type; Item_result type;
CHARSET_INFO *var_charset; CHARSET_INFO *var_charset;
enum Item::coercion var_coercibility;
}; };
/* Class for unique (removing of duplicates) */ /* Class for unique (removing of duplicates) */
...@@ -1000,7 +983,7 @@ class multi_update : public select_result ...@@ -1000,7 +983,7 @@ class multi_update : public select_result
{ {
TABLE_LIST *all_tables, *update_tables, *table_being_updated; TABLE_LIST *all_tables, *update_tables, *table_being_updated;
THD *thd; THD *thd;
TABLE **tmp_tables, *main_table; TABLE **tmp_tables, *main_table, *table_to_update;
TMP_TABLE_PARAM *tmp_table_param; TMP_TABLE_PARAM *tmp_table_param;
ha_rows updated, found; ha_rows updated, found;
List <Item> *fields, *values; List <Item> *fields, *values;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment