summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <dlenev@mysql.com>2004-02-11 12:09:48 +0300
committerunknown <dlenev@mysql.com>2004-02-11 12:09:48 +0300
commit662510b907fae3fbf208e5c46a7d1915664be4f2 (patch)
treec82cdc4b7c92eedd6514e630187386817b5bcf6f
parent8f5ad02a93f05d10cada2a21daab26293e9880fc (diff)
parent6b86e0ebc606f52c38eeb98c580e7a9b2c43f0f6 (diff)
downloadmariadb-git-662510b907fae3fbf208e5c46a7d1915664be4f2.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/dlenev/src/mysql-4.1-bg2248
-rw-r--r--sql/item.cc2
-rw-r--r--sql/protocol.cc9
-rw-r--r--sql/set_var.cc1
-rw-r--r--sql/sql_lex.cc51
4 files changed, 28 insertions, 35 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 4d06d0d7765..850d5a3cad3 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -568,6 +568,8 @@ void Item_param::set_time(TIME *tm, timestamp_type type)
ltime.second_part= tm->second_part;
+ ltime.neg= tm->neg;
+
ltime.time_type= type;
item_is_time= true;
diff --git a/sql/protocol.cc b/sql/protocol.cc
index bef567ad346..40adc9e8961 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -313,6 +313,7 @@ send_ok(THD *thd, ha_rows affected_rows, ulonglong id, const char *message)
DBUG_VOID_RETURN;
}
+static char eof_buff[1]= { (char) 254 }; /* Marker for end of fields */
/*
Send eof (= end of result set) to the client
@@ -339,12 +340,11 @@ send_ok(THD *thd, ha_rows affected_rows, ulonglong id, const char *message)
void
send_eof(THD *thd, bool no_flush)
{
- static char eof_buff[1]= { (char) 254 }; /* Marker for end of fields */
NET *net= &thd->net;
DBUG_ENTER("send_eof");
if (net->vio != 0)
{
- if (!no_flush && (thd->client_capabilities & CLIENT_PROTOCOL_41))
+ if (thd->client_capabilities & CLIENT_PROTOCOL_41)
{
uchar buff[5];
uint tmp= min(thd->total_warn_count, 65535);
@@ -384,9 +384,8 @@ send_eof(THD *thd, bool no_flush)
bool send_old_password_request(THD *thd)
{
- static char buff[1]= { (char) 254 };
NET *net= &thd->net;
- return my_net_write(net, buff, 1) || net_flush(net);
+ return my_net_write(net, eof_buff, 1) || net_flush(net);
}
#endif /* EMBEDDED_LIBRARY */
@@ -585,7 +584,7 @@ bool Protocol::send_fields(List<Item> *list, uint flag)
#endif
}
- send_eof(thd, 1);
+ my_net_write(&thd->net, eof_buff, 1);
DBUG_RETURN(prepare_for_send(list));
err:
diff --git a/sql/set_var.cc b/sql/set_var.cc
index ecb85440068..073330e06be 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -695,7 +695,6 @@ struct show_var_st init_vars[]= {
{"port", (char*) &mysqld_port, SHOW_INT},
{"protocol_version", (char*) &protocol_version, SHOW_INT},
{sys_preload_buff_size.name, (char*) &sys_preload_buff_size, SHOW_SYS},
- {sys_pseudo_thread_id.name, (char*) &sys_pseudo_thread_id, SHOW_SYS},
{sys_query_alloc_block_size.name, (char*) &sys_query_alloc_block_size,
SHOW_SYS},
#ifdef HAVE_QUERY_CACHE
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 2484ff0e30f..70c69bb7389 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -193,6 +193,13 @@ static LEX_STRING get_token(LEX *lex,uint length)
return tmp;
}
+/*
+ todo:
+ There are no dangerous charsets in mysql for function
+ get_quoted_token yet. But it should be fixed in the
+ future to operate multichar strings (like ucs2)
+*/
+
static LEX_STRING get_quoted_token(LEX *lex,uint length, char quote)
{
LEX_STRING tmp;
@@ -670,37 +677,14 @@ int yylex(void *arg, void *yythd)
uint double_quotes= 0;
char quote_char= c; // Used char
lex->tok_start=lex->ptr; // Skip first `
+ while ((c=yyGet()))
+ {
#ifdef USE_MB
- if (use_mb(cs))
- {
- while ((c= yyGet()))
- {
- if (c == quote_char)
- {
- if (yyPeek() != quote_char)
- break;
- c= yyGet();
- double_quotes++;
- continue;
- }
- if (c == (uchar) NAMES_SEP_CHAR)
- break;
- if (my_mbcharlen(cs, c) > 1)
- {
- int l;
- if ((l = my_ismbchar(cs,
- (const char *)lex->ptr-1,
- (const char *)lex->end_of_query)) == 0)
- break;
- lex->ptr += l-1;
- }
- }
- }
- else
+ if (my_mbcharlen(cs, c) == 1)
#endif
- {
- while ((c=yyGet()))
{
+ if (c == (uchar) NAMES_SEP_CHAR)
+ break; /* Old .frm format can't handle this char */
if (c == quote_char)
{
if (yyPeek() != quote_char)
@@ -709,9 +693,18 @@ int yylex(void *arg, void *yythd)
double_quotes++;
continue;
}
- if (c == (uchar) NAMES_SEP_CHAR)
+ }
+#ifdef USE_MB
+ else
+ {
+ int l;
+ if ((l = my_ismbchar(cs,
+ (const char *)lex->ptr-1,
+ (const char *)lex->end_of_query)) == 0)
break;
+ lex->ptr += l-1;
}
+#endif
}
if (double_quotes)
yylval->lex_str=get_quoted_token(lex,yyLength() - double_quotes,