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
e7e5cb29
Commit
e7e5cb29
authored
Jun 21, 2005
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into moonbone.local:/work/mysql-5.0-bug-7422
parents
8cff472a
e94f16a1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
5 deletions
+31
-5
mysql-test/r/view.result
mysql-test/r/view.result
+14
-0
mysql-test/t/view.test
mysql-test/t/view.test
+12
-0
sql/filesort.cc
sql/filesort.cc
+5
-5
No files found.
mysql-test/r/view.result
View file @
e7e5cb29
...
...
@@ -1726,6 +1726,20 @@ sum(a)
drop procedure p1;
drop view v1;
drop table t1;
CREATE TABLE t1(a char(2) primary key, b char(2));
CREATE TABLE t2(a char(2), b char(2), index i(a));
INSERT INTO t1 VALUES ('a','1'), ('b','2');
INSERT INTO t2 VALUES ('a','5'), ('a','6'), ('b','5'), ('b','6');
CREATE VIEW v1 AS
SELECT t1.b as c, t2.b as d FROM t1,t2 WHERE t1.a=t2.a;
SELECT d, c FROM v1 ORDER BY d;
d c
5 1
5 2
6 1
6 2
DROP VIEW v1;
DROP TABLE t1, t2;
create table t1 (s1 int);
create view v1 as select sum(distinct s1) from t1;
select * from v1;
...
...
mysql-test/t/view.test
View file @
e7e5cb29
...
...
@@ -1569,6 +1569,18 @@ drop procedure p1;
drop
view
v1
;
drop
table
t1
;
#
# Bug#7422 "order by" doesn't work
#
CREATE
TABLE
t1
(
a
char
(
2
)
primary
key
,
b
char
(
2
));
CREATE
TABLE
t2
(
a
char
(
2
),
b
char
(
2
),
index
i
(
a
));
INSERT
INTO
t1
VALUES
(
'a'
,
'1'
),
(
'b'
,
'2'
);
INSERT
INTO
t2
VALUES
(
'a'
,
'5'
),
(
'a'
,
'6'
),
(
'b'
,
'5'
),
(
'b'
,
'6'
);
CREATE
VIEW
v1
AS
SELECT
t1
.
b
as
c
,
t2
.
b
as
d
FROM
t1
,
t2
WHERE
t1
.
a
=
t2
.
a
;
SELECT
d
,
c
FROM
v1
ORDER
BY
d
;
DROP
VIEW
v1
;
DROP
TABLE
t1
,
t2
;
#
# using sum(distinct ) & avg(distinct ) in views (BUG#7015)
#
...
...
sql/filesort.cc
View file @
e7e5cb29
...
...
@@ -631,7 +631,7 @@ static void make_sortkey(register SORTPARAM *param,
*
to
++=
1
;
/* All item->str() to use some extra byte for end null.. */
String
tmp
((
char
*
)
to
,
sort_field
->
length
+
4
,
cs
);
String
*
res
=
item
->
val_str
(
&
tmp
);
String
*
res
=
item
->
str_result
(
&
tmp
);
if
(
!
res
)
{
if
(
maybe_null
)
...
...
@@ -673,8 +673,8 @@ static void make_sortkey(register SORTPARAM *param,
}
case
INT_RESULT
:
{
longlong
value
=
item
->
val_in
t
();
if
(
maybe_null
)
longlong
value
=
item
->
val_int_resul
t
();
if
(
maybe_null
)
{
*
to
++=
1
;
/* purecov: inspected */
if
(
item
->
null_value
)
...
...
@@ -715,7 +715,7 @@ static void make_sortkey(register SORTPARAM *param,
}
case
DECIMAL_RESULT
:
{
my_decimal
dec_buf
,
*
dec_val
=
item
->
val_decimal
(
&
dec_buf
);
my_decimal
dec_buf
,
*
dec_val
=
item
->
val_decimal
_result
(
&
dec_buf
);
if
(
maybe_null
)
{
if
(
item
->
null_value
)
...
...
@@ -733,7 +733,7 @@ static void make_sortkey(register SORTPARAM *param,
}
case
REAL_RESULT
:
{
double
value
=
item
->
val_real
();
double
value
=
item
->
val_result
();
if
(
maybe_null
)
{
if
(
item
->
null_value
)
...
...
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