mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into mysql.com:/home/jimw/my/mysql-5.0-clean
This commit is contained in:
@ -152,3 +152,6 @@ ceil(0.09)
|
|||||||
select ceil(0.000000000000000009);
|
select ceil(0.000000000000000009);
|
||||||
ceil(0.000000000000000009)
|
ceil(0.000000000000000009)
|
||||||
1
|
1
|
||||||
|
select abs(-2) * -2;
|
||||||
|
abs(-2) * -2
|
||||||
|
-4
|
||||||
|
@ -23,13 +23,13 @@ SELECT @@global.default.key_buffer_size;
|
|||||||
@@global.default.key_buffer_size
|
@@global.default.key_buffer_size
|
||||||
16777216
|
16777216
|
||||||
SELECT @@global.default.`key_buffer_size`;
|
SELECT @@global.default.`key_buffer_size`;
|
||||||
@@global.default.key_buffer_size
|
@@global.default.`key_buffer_size`
|
||||||
16777216
|
16777216
|
||||||
SELECT @@global.`default`.`key_buffer_size`;
|
SELECT @@global.`default`.`key_buffer_size`;
|
||||||
@@global.default.key_buffer_size
|
@@global.`default`.`key_buffer_size`
|
||||||
16777216
|
16777216
|
||||||
SELECT @@`default`.key_buffer_size;
|
SELECT @@`default`.key_buffer_size;
|
||||||
@@default.key_buffer_size
|
@@`default`.key_buffer_size
|
||||||
16777216
|
16777216
|
||||||
SELECT @@small.key_buffer_size;
|
SELECT @@small.key_buffer_size;
|
||||||
@@small.key_buffer_size
|
@@small.key_buffer_size
|
||||||
|
@ -349,7 +349,7 @@ execute stmt1 ;
|
|||||||
ERROR 42S02: Unknown table 't5'
|
ERROR 42S02: Unknown table 't5'
|
||||||
prepare stmt1 from ' SELECT @@version ' ;
|
prepare stmt1 from ' SELECT @@version ' ;
|
||||||
execute stmt1 ;
|
execute stmt1 ;
|
||||||
@@VERSION
|
@@version
|
||||||
<version>
|
<version>
|
||||||
prepare stmt_do from ' do @var:= (1 in (select a from t1)) ' ;
|
prepare stmt_do from ' do @var:= (1 in (select a from t1)) ' ;
|
||||||
prepare stmt_set from ' set @var= (1 in (select a from t1)) ' ;
|
prepare stmt_set from ' set @var= (1 in (select a from t1)) ' ;
|
||||||
|
@ -224,3 +224,27 @@ t1 CREATE TABLE `t1` (
|
|||||||
`@first_var` longtext
|
`@first_var` longtext
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
select @@local.max_allowed_packet;
|
||||||
|
@@local.max_allowed_packet
|
||||||
|
#
|
||||||
|
select @@session.max_allowed_packet;
|
||||||
|
@@session.max_allowed_packet
|
||||||
|
#
|
||||||
|
select @@global.max_allowed_packet;
|
||||||
|
@@global.max_allowed_packet
|
||||||
|
#
|
||||||
|
select @@max_allowed_packet;
|
||||||
|
@@max_allowed_packet
|
||||||
|
#
|
||||||
|
select @@Max_Allowed_Packet;
|
||||||
|
@@Max_Allowed_Packet
|
||||||
|
#
|
||||||
|
select @@version;
|
||||||
|
@@version
|
||||||
|
#
|
||||||
|
select @@global.version;
|
||||||
|
@@global.version
|
||||||
|
#
|
||||||
|
select @@session.VERSION;
|
||||||
|
@@session.VERSION
|
||||||
|
#
|
||||||
|
@ -92,7 +92,7 @@ Variable_name Value
|
|||||||
max_join_size HA_POS_ERROR
|
max_join_size HA_POS_ERROR
|
||||||
set @@max_join_size=1000, @@global.max_join_size=2000;
|
set @@max_join_size=1000, @@global.max_join_size=2000;
|
||||||
select @@local.max_join_size, @@global.max_join_size;
|
select @@local.max_join_size, @@global.max_join_size;
|
||||||
@@session.max_join_size @@global.max_join_size
|
@@local.max_join_size @@global.max_join_size
|
||||||
1000 2000
|
1000 2000
|
||||||
select @@identity, length(@@version)>0;
|
select @@identity, length(@@version)>0;
|
||||||
@@identity length(@@version)>0
|
@@identity length(@@version)>0
|
||||||
@ -428,23 +428,23 @@ Variable_name Value
|
|||||||
myisam_max_sort_file_size MAX_FILE_SIZE
|
myisam_max_sort_file_size MAX_FILE_SIZE
|
||||||
set global myisam_max_sort_file_size=default;
|
set global myisam_max_sort_file_size=default;
|
||||||
select @@global.max_user_connections,@@local.max_join_size;
|
select @@global.max_user_connections,@@local.max_join_size;
|
||||||
@@global.max_user_connections @@session.max_join_size
|
@@global.max_user_connections @@local.max_join_size
|
||||||
100 200
|
100 200
|
||||||
set @svc=@@global.max_user_connections, @svj=@@local.max_join_size;
|
set @svc=@@global.max_user_connections, @svj=@@local.max_join_size;
|
||||||
select @@global.max_user_connections,@@local.max_join_size;
|
select @@global.max_user_connections,@@local.max_join_size;
|
||||||
@@global.max_user_connections @@session.max_join_size
|
@@global.max_user_connections @@local.max_join_size
|
||||||
100 200
|
100 200
|
||||||
set @@global.max_user_connections=111,@@local.max_join_size=222;
|
set @@global.max_user_connections=111,@@local.max_join_size=222;
|
||||||
select @@global.max_user_connections,@@local.max_join_size;
|
select @@global.max_user_connections,@@local.max_join_size;
|
||||||
@@global.max_user_connections @@session.max_join_size
|
@@global.max_user_connections @@local.max_join_size
|
||||||
111 222
|
111 222
|
||||||
set @@global.max_user_connections=@@local.max_join_size,@@local.max_join_size=@@global.max_user_connections;
|
set @@global.max_user_connections=@@local.max_join_size,@@local.max_join_size=@@global.max_user_connections;
|
||||||
select @@global.max_user_connections,@@local.max_join_size;
|
select @@global.max_user_connections,@@local.max_join_size;
|
||||||
@@global.max_user_connections @@session.max_join_size
|
@@global.max_user_connections @@local.max_join_size
|
||||||
222 111
|
222 111
|
||||||
set @@global.max_user_connections=@svc, @@local.max_join_size=@svj;
|
set @@global.max_user_connections=@svc, @@local.max_join_size=@svj;
|
||||||
select @@global.max_user_connections,@@local.max_join_size;
|
select @@global.max_user_connections,@@local.max_join_size;
|
||||||
@@global.max_user_connections @@session.max_join_size
|
@@global.max_user_connections @@local.max_join_size
|
||||||
100 200
|
100 200
|
||||||
set @a=1, @b=2;
|
set @a=1, @b=2;
|
||||||
set @a=@b, @b=@a;
|
set @a=@b, @b=@a;
|
||||||
|
@ -93,3 +93,18 @@ select round(150, 2);
|
|||||||
select ceil(0.09);
|
select ceil(0.09);
|
||||||
select ceil(0.000000000000000009);
|
select ceil(0.000000000000000009);
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #9837: problem with round()
|
||||||
|
#
|
||||||
|
|
||||||
|
create table t1 select round(1, 6);
|
||||||
|
show create table t1;
|
||||||
|
select * from t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #11402: abs() forces rest of calculation to unsigned
|
||||||
|
#
|
||||||
|
select abs(-2) * -2;
|
||||||
|
|
||||||
|
# End of 4.1 tests
|
||||||
|
@ -121,6 +121,27 @@ set session @honk=99;
|
|||||||
--error 1382
|
--error 1382
|
||||||
set one_shot @honk=99;
|
set one_shot @honk=99;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #10724 @@local not preserved in column name of select
|
||||||
|
#
|
||||||
|
# The value doesn't actually matter, we just care about the column name
|
||||||
|
--replace_column 1 #
|
||||||
|
select @@local.max_allowed_packet;
|
||||||
|
--replace_column 1 #
|
||||||
|
select @@session.max_allowed_packet;
|
||||||
|
--replace_column 1 #
|
||||||
|
select @@global.max_allowed_packet;
|
||||||
|
--replace_column 1 #
|
||||||
|
select @@max_allowed_packet;
|
||||||
|
--replace_column 1 #
|
||||||
|
select @@Max_Allowed_Packet;
|
||||||
|
--replace_column 1 #
|
||||||
|
select @@version;
|
||||||
|
--replace_column 1 #
|
||||||
|
select @@global.version;
|
||||||
|
--replace_column 1 #
|
||||||
|
select @@session.VERSION;
|
||||||
|
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -1368,8 +1368,6 @@ my_decimal *Item_func_abs::decimal_op(my_decimal *decimal_value)
|
|||||||
void Item_func_abs::fix_length_and_dec()
|
void Item_func_abs::fix_length_and_dec()
|
||||||
{
|
{
|
||||||
Item_func_num1::fix_length_and_dec();
|
Item_func_num1::fix_length_and_dec();
|
||||||
if (hybrid_type == INT_RESULT)
|
|
||||||
unsigned_flag= 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -4437,7 +4435,7 @@ Item *get_system_var(THD *thd, enum_var_type var_type, LEX_STRING name,
|
|||||||
|
|
||||||
if (component.str == 0 &&
|
if (component.str == 0 &&
|
||||||
!my_strcasecmp(system_charset_info, name.str, "VERSION"))
|
!my_strcasecmp(system_charset_info, name.str, "VERSION"))
|
||||||
return new Item_string("@@VERSION", server_version,
|
return new Item_string(NULL, server_version,
|
||||||
(uint) strlen(server_version),
|
(uint) strlen(server_version),
|
||||||
system_charset_info, DERIVATION_SYSCONST);
|
system_charset_info, DERIVATION_SYSCONST);
|
||||||
|
|
||||||
@ -4464,28 +4462,10 @@ Item *get_system_var(THD *thd, enum_var_type var_type, LEX_STRING name,
|
|||||||
}
|
}
|
||||||
thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
|
thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
|
||||||
|
|
||||||
buff[0]='@';
|
|
||||||
buff[1]='@';
|
|
||||||
pos=buff+2;
|
|
||||||
if (var_type == OPT_SESSION)
|
|
||||||
pos=strmov(pos,"session.");
|
|
||||||
else if (var_type == OPT_GLOBAL)
|
|
||||||
pos=strmov(pos,"global.");
|
|
||||||
|
|
||||||
set_if_smaller(component_name->length, MAX_SYS_VAR_LENGTH);
|
set_if_smaller(component_name->length, MAX_SYS_VAR_LENGTH);
|
||||||
set_if_smaller(base_name->length, MAX_SYS_VAR_LENGTH);
|
|
||||||
|
|
||||||
if (component_name->str)
|
|
||||||
{
|
|
||||||
memcpy(pos, component_name->str, component_name->length);
|
|
||||||
pos+= component_name->length;
|
|
||||||
*pos++= '.';
|
|
||||||
}
|
|
||||||
memcpy(pos, base_name->str, base_name->length);
|
|
||||||
pos+= base_name->length;
|
|
||||||
|
|
||||||
return new Item_func_get_system_var(var, var_type, component_name,
|
return new Item_func_get_system_var(var, var_type, component_name,
|
||||||
buff, pos - buff);
|
NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ static int get_or_create_user_conn(THD *thd, const char *user,
|
|||||||
const char *host,
|
const char *host,
|
||||||
USER_RESOURCES *mqh)
|
USER_RESOURCES *mqh)
|
||||||
{
|
{
|
||||||
int return_val=0;
|
int return_val= 0;
|
||||||
uint temp_len, user_len;
|
uint temp_len, user_len;
|
||||||
char temp_user[USERNAME_LENGTH+HOSTNAME_LENGTH+2];
|
char temp_user[USERNAME_LENGTH+HOSTNAME_LENGTH+2];
|
||||||
struct user_conn *uc;
|
struct user_conn *uc;
|
||||||
@ -201,7 +201,7 @@ static int get_or_create_user_conn(THD *thd, const char *user,
|
|||||||
DBUG_ASSERT(user != 0);
|
DBUG_ASSERT(user != 0);
|
||||||
DBUG_ASSERT(host != 0);
|
DBUG_ASSERT(host != 0);
|
||||||
|
|
||||||
user_len=strlen(user);
|
user_len= strlen(user);
|
||||||
temp_len= (strmov(strmov(temp_user, user)+1, host) - temp_user)+1;
|
temp_len= (strmov(strmov(temp_user, user)+1, host) - temp_user)+1;
|
||||||
(void) pthread_mutex_lock(&LOCK_user_conn);
|
(void) pthread_mutex_lock(&LOCK_user_conn);
|
||||||
if (!(uc = (struct user_conn *) hash_search(&hash_user_connections,
|
if (!(uc = (struct user_conn *) hash_search(&hash_user_connections,
|
||||||
@ -213,21 +213,21 @@ static int get_or_create_user_conn(THD *thd, const char *user,
|
|||||||
MYF(MY_WME)))))
|
MYF(MY_WME)))))
|
||||||
{
|
{
|
||||||
net_send_error(thd, 0, NullS); // Out of memory
|
net_send_error(thd, 0, NullS); // Out of memory
|
||||||
return_val=1;
|
return_val= 1;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
uc->user=(char*) (uc+1);
|
uc->user=(char*) (uc+1);
|
||||||
memcpy(uc->user,temp_user,temp_len+1);
|
memcpy(uc->user,temp_user,temp_len+1);
|
||||||
uc->host= uc->user + user_len + 1;
|
uc->host= uc->user + user_len + 1;
|
||||||
uc->len = temp_len;
|
uc->len= temp_len;
|
||||||
uc->connections= uc->questions= uc->updates= uc->conn_per_hour= 0;
|
uc->connections= uc->questions= uc->updates= uc->conn_per_hour= 0;
|
||||||
uc->user_resources=*mqh;
|
uc->user_resources= *mqh;
|
||||||
uc->intime=thd->thr_create_time;
|
uc->intime= thd->thr_create_time;
|
||||||
if (my_hash_insert(&hash_user_connections, (byte*) uc))
|
if (my_hash_insert(&hash_user_connections, (byte*) uc))
|
||||||
{
|
{
|
||||||
my_free((char*) uc,0);
|
my_free((char*) uc,0);
|
||||||
net_send_error(thd, 0, NullS); // Out of memory
|
net_send_error(thd, 0, NullS); // Out of memory
|
||||||
return_val=1;
|
return_val= 1;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5305,6 +5305,8 @@ void create_select_for_variable(const char *var_name)
|
|||||||
THD *thd;
|
THD *thd;
|
||||||
LEX *lex;
|
LEX *lex;
|
||||||
LEX_STRING tmp, null_lex_string;
|
LEX_STRING tmp, null_lex_string;
|
||||||
|
Item *var;
|
||||||
|
char buff[MAX_SYS_VAR_LENGTH*2+4+8], *end;
|
||||||
DBUG_ENTER("create_select_for_variable");
|
DBUG_ENTER("create_select_for_variable");
|
||||||
|
|
||||||
thd= current_thd;
|
thd= current_thd;
|
||||||
@ -5314,8 +5316,14 @@ void create_select_for_variable(const char *var_name)
|
|||||||
tmp.str= (char*) var_name;
|
tmp.str= (char*) var_name;
|
||||||
tmp.length=strlen(var_name);
|
tmp.length=strlen(var_name);
|
||||||
bzero((char*) &null_lex_string.str, sizeof(null_lex_string));
|
bzero((char*) &null_lex_string.str, sizeof(null_lex_string));
|
||||||
add_item_to_list(thd, get_system_var(thd, OPT_SESSION, tmp,
|
/*
|
||||||
null_lex_string));
|
We set the name of Item to @@session.var_name because that then is used
|
||||||
|
as the column name in the output.
|
||||||
|
*/
|
||||||
|
var= get_system_var(thd, OPT_SESSION, tmp, null_lex_string);
|
||||||
|
end= strxmov(buff, "@@session.", var_name, NullS);
|
||||||
|
var->set_name(buff, end-buff, system_charset_info);
|
||||||
|
add_item_to_list(thd, var);
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user