summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-05-05 21:24:21 +0300
committerunknown <monty@mysql.com>2004-05-05 21:24:21 +0300
commit000f76cfb844eeda1c1c0092d4ab97f3f3acb6cb (patch)
tree7237dcd91649e057a85eb3caca141f3df5892db8 /sql
parentcd21f7ce40ac4c7d415544a5b2aa07b1278419ac (diff)
downloadmariadb-git-000f76cfb844eeda1c1c0092d4ab97f3f3acb6cb.tar.gz
after merge fixes
client/mysqldump.c: Fixed problem with multiple tables (--skip-quote didn't work properly for second table) myisam/myisamchk.c: after merge fix
Diffstat (limited to 'sql')
-rw-r--r--sql/item.cc2
-rw-r--r--sql/item_timefunc.cc5
-rw-r--r--sql/mysqld.cc4
-rw-r--r--sql/sql_acl.cc11
-rw-r--r--sql/sql_select.cc20
-rw-r--r--sql/sql_union.cc4
-rw-r--r--sql/sql_yacc.yy9
7 files changed, 37 insertions, 18 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 98e6f02efad..f1569b6dca6 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1355,7 +1355,7 @@ int Item::save_in_field(Field *field, bool no_conversions)
result=val_str(&str_value);
if (null_value)
{
- str_value.set_quick(0, 0);
+ str_value.set_quick(0, 0, cs);
return set_field_to_null_with_conversions(field, no_conversions);
}
field->set_notnull();
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index f22c14c925f..0c0b5265db7 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -635,7 +635,8 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time,
*/
static bool get_interval_info(const char *str,uint length,CHARSET_INFO *cs,
- uint count, long *values, bool transform_msec)
+ uint count, ulonglong *values,
+ bool transform_msec)
{
const char *end=str+length;
uint i;
@@ -1651,7 +1652,7 @@ bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date)
sec=((ltime->day-1)*3600*24L+ltime->hour*3600+ltime->minute*60+
ltime->second +
sign* (longlong) (interval.day*3600*24L +
- interval.hour*3600+interval.minute*60+
+ interval.hour*LL(3600)+interval.minute*LL(60)+
interval.second))+ extra_sec;
if (microseconds < 0)
{
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index c231ec0e024..2d2514b0017 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -2328,6 +2328,7 @@ Warning: you need to use --log-bin to make --log-slave-updates work. \
Now disabling --log-slave-updates.");
}
+#ifdef HAVE_REPLICATION
if (opt_log_slave_updates && replicate_same_server_id)
{
sql_print_error("\
@@ -2336,6 +2337,7 @@ Error: using --replicate-same-server-id in conjunction with \
server.");
unireg_abort(1);
}
+#endif
if (opt_error_log)
{
@@ -4099,6 +4101,7 @@ master-ssl",
{"replicate-rewrite-db", OPT_REPLICATE_REWRITE_DB,
"Updates to a database with a different name than the original. Example: replicate-rewrite-db=master_db_name->slave_db_name.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+#ifdef HAVE_REPLICATION
{"replicate-same-server-id", OPT_REPLICATE_SAME_SERVER_ID,
"In replication, if set to 1, do not skip events having our server id. \
Default value is 0 (to break infinite loops in circular replication). \
@@ -4106,6 +4109,7 @@ Can't be set to 1 if --log-slave-updates is used.",
(gptr*) &replicate_same_server_id,
(gptr*) &replicate_same_server_id,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+#endif
// In replication, we may need to tell the other servers how to connect
{"report-host", OPT_REPORT_HOST,
"Hostname or IP of the slave to be reported to to the master during slave registration. Will appear in the output of SHOW SLAVE HOSTS. Leave unset if you do not want the slave to register itself with the master. Note that it is not sufficient for the master to simply read the IP of the slave off the socket once the slave connects. Due to NAT and other routing issues, that IP may not be valid for connecting to the slave from the master or other hosts.",
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 625068e655c..27aaf06d872 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -3015,6 +3015,12 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables");
DBUG_RETURN(-1);
}
+
+ if (!lex_user->host.str)
+ {
+ lex_user->host.str= (char*) "%";
+ lex_user->host.length=1;
+ }
if (lex_user->host.length > HOSTNAME_LENGTH ||
lex_user->user.length > USERNAME_LENGTH)
{
@@ -3215,7 +3221,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
/* Add table & column access */
for (index=0 ; index < column_priv_hash.records ; index++)
{
- const char *user,*host;
+ const char *user;
GRANT_TABLE *grant_table= (GRANT_TABLE*) hash_element(&column_priv_hash,
index);
@@ -3223,7 +3229,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
user= "";
if (!strcmp(lex_user->user.str,user) &&
- !my_strcasecmp(&my_charset_latin1, lex_user->host.str, host))
+ !my_strcasecmp(&my_charset_latin1, lex_user->host.str,
+ grant_table->orig_host))
{
ulong table_access= grant_table->privs;
if ((table_access | grant_table->cols) != 0)
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index ffc52817322..2cfeb171153 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -256,15 +256,19 @@ inline int setup_without_group(THD *thd, Item **ref_pointer_array,
ORDER *order,
ORDER *group, bool *hidden_group_fields)
{
- bool save_allow_sum_func= thd->allow_sum_func;
+ bool save_allow_sum_func;
+ int res;
+ DBUG_ENTER("setup_without_group");
+
+ save_allow_sum_func= thd->allow_sum_func;
thd->allow_sum_func= 0;
- int res= (setup_conds(thd, tables, conds) ||
- setup_order(thd, ref_pointer_array, tables, fields, all_fields,
- order) ||
- setup_group(thd, ref_pointer_array, tables, fields, all_fields,
- group, hidden_group_fields));
+ res= (setup_conds(thd, tables, conds) ||
+ setup_order(thd, ref_pointer_array, tables, fields, all_fields,
+ order) ||
+ setup_group(thd, ref_pointer_array, tables, fields, all_fields,
+ group, hidden_group_fields));
thd->allow_sum_func= save_allow_sum_func;
- return res;
+ DBUG_RETURN(res);
}
/*****************************************************************************
@@ -273,7 +277,7 @@ inline int setup_without_group(THD *thd, Item **ref_pointer_array,
*****************************************************************************/
/*
- Prepare of whole select (including subselect in future).
+ Prepare of whole select (including sub queries in future).
return -1 on error
0 on success
*/
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 1b3995f30be..cffbece2f18 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -367,8 +367,6 @@ int st_select_lex_unit::exec()
optimized= 1;
/* Send result to 'result' */
-
-
res= -1;
{
List<Item_func_match> empty_list;
@@ -405,7 +403,7 @@ int st_select_lex_unit::exec()
if (!join)
{
/*
- allocate JOIN for fake select only once (privent
+ allocate JOIN for fake select only once (prevent
mysql_select automatic allocation)
*/
if (!(fake_select_lex->join= new JOIN(thd, item_list, thd->options,
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 86b4702d314..39a2e980094 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -603,7 +603,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%type <simple_string>
remember_name remember_end opt_ident opt_db text_or_password
- opt_escape opt_constraint
+ opt_escape opt_constraint constraint
%type <string>
text_string opt_gconcat_separator
@@ -1229,7 +1229,12 @@ check_constraint:
opt_constraint:
/* empty */ { $$=(char*) 0; }
- | CONSTRAINT opt_ident { $$=$2; };
+ | constraint { $$= $1; }
+ ;
+
+constraint:
+ CONSTRAINT opt_ident { $$=$2; }
+ ;
field_spec:
field_ident