Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
400bfb92
Commit
400bfb92
authored
Jun 02, 2007
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge moonbone.local:/mnt/gentoo64/work/test-5.0-opt-mysql
into moonbone.local:/mnt/gentoo64/work/test-5.1-opt-mysql
parents
ad18c4b9
49346467
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
5 deletions
+52
-5
mysql-test/r/user_var.result
mysql-test/r/user_var.result
+11
-3
mysql-test/t/user_var.test
mysql-test/t/user_var.test
+3
-2
sql/item_func.cc
sql/item_func.cc
+34
-0
sql/item_func.h
sql/item_func.h
+4
-0
No files found.
mysql-test/r/user_var.result
View file @
400bfb92
...
@@ -318,9 +318,17 @@ SHOW COUNT(*) ERRORS;
...
@@ -318,9 +318,17 @@ SHOW COUNT(*) ERRORS;
@@session.error_count
@@session.error_count
1
1
create table t1(f1 int);
create table t1(f1 int);
insert into t1 values(1),(1),(2);
insert into t1 values(1),(1),(2)
,(3),(4),(1),(3),(1)
;
select @a:=f1, count(f1) from t1 group by 1
order by 1
;
select @a:=f1, count(f1) from t1 group by 1
desc
;
@a:=f1 count(f1)
@a:=f1 count(f1)
1 2
4 1
3 2
2 1
2 1
1 4
select @a:=f1, count(f1) from t1 group by 1 asc;
@a:=f1 count(f1)
1 4
2 1
3 2
4 1
drop table t1;
drop table t1;
mysql-test/t/user_var.test
View file @
400bfb92
...
@@ -227,6 +227,7 @@ SHOW COUNT(*) ERRORS;
...
@@ -227,6 +227,7 @@ SHOW COUNT(*) ERRORS;
# Bug#28494: Grouping by Item_func_set_user_var produces incorrect result.
# Bug#28494: Grouping by Item_func_set_user_var produces incorrect result.
#
#
create
table
t1
(
f1
int
);
create
table
t1
(
f1
int
);
insert
into
t1
values
(
1
),(
1
),(
2
);
insert
into
t1
values
(
1
),(
1
),(
2
),(
3
),(
4
),(
1
),(
3
),(
1
);
select
@
a
:=
f1
,
count
(
f1
)
from
t1
group
by
1
order
by
1
;
select
@
a
:=
f1
,
count
(
f1
)
from
t1
group
by
1
desc
;
select
@
a
:=
f1
,
count
(
f1
)
from
t1
group
by
1
asc
;
drop
table
t1
;
drop
table
t1
;
sql/item_func.cc
View file @
400bfb92
...
@@ -4179,6 +4179,40 @@ my_decimal *Item_func_set_user_var::val_decimal(my_decimal *val)
...
@@ -4179,6 +4179,40 @@ my_decimal *Item_func_set_user_var::val_decimal(my_decimal *val)
}
}
double
Item_func_set_user_var
::
val_real_result
()
{
DBUG_ASSERT
(
fixed
==
1
);
check
(
TRUE
);
update
();
// Store expression
return
entry
->
val_real
(
&
null_value
);
}
longlong
Item_func_set_user_var
::
val_int_result
()
{
DBUG_ASSERT
(
fixed
==
1
);
check
(
TRUE
);
update
();
// Store expression
return
entry
->
val_int
(
&
null_value
);
}
String
*
Item_func_set_user_var
::
val_str_result
(
String
*
str
)
{
DBUG_ASSERT
(
fixed
==
1
);
check
(
TRUE
);
update
();
// Store expression
return
entry
->
val_str
(
&
null_value
,
str
,
decimals
);
}
my_decimal
*
Item_func_set_user_var
::
val_decimal_result
(
my_decimal
*
val
)
{
DBUG_ASSERT
(
fixed
==
1
);
check
(
TRUE
);
update
();
// Store expression
return
entry
->
val_decimal
(
&
null_value
,
val
);
}
void
Item_func_set_user_var
::
print
(
String
*
str
)
void
Item_func_set_user_var
::
print
(
String
*
str
)
{
{
str
->
append
(
STRING_WITH_LEN
(
"(@"
));
str
->
append
(
STRING_WITH_LEN
(
"(@"
));
...
...
sql/item_func.h
View file @
400bfb92
...
@@ -1236,6 +1236,10 @@ class Item_func_set_user_var :public Item_func
...
@@ -1236,6 +1236,10 @@ class Item_func_set_user_var :public Item_func
longlong
val_int
();
longlong
val_int
();
String
*
val_str
(
String
*
str
);
String
*
val_str
(
String
*
str
);
my_decimal
*
val_decimal
(
my_decimal
*
);
my_decimal
*
val_decimal
(
my_decimal
*
);
double
val_real_result
();
longlong
val_int_result
();
String
*
val_str_result
(
String
*
str
);
my_decimal
*
val_decimal_result
(
my_decimal
*
);
bool
update_hash
(
void
*
ptr
,
uint
length
,
enum
Item_result
type
,
bool
update_hash
(
void
*
ptr
,
uint
length
,
enum
Item_result
type
,
CHARSET_INFO
*
cs
,
Derivation
dv
,
bool
unsigned_arg
);
CHARSET_INFO
*
cs
,
Derivation
dv
,
bool
unsigned_arg
);
bool
send
(
Protocol
*
protocol
,
String
*
str_arg
);
bool
send
(
Protocol
*
protocol
,
String
*
str_arg
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment