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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
61cd864b
Commit
61cd864b
authored
Jan 10, 2007
by
igor@olga.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge olga.mysql.com:/home/igor/mysql-4.1-opt
into olga.mysql.com:/home/igor/mysql-5.0-opt
parents
4a3fe2b6
578fae9d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
3 deletions
+28
-3
mysql-test/r/order_by.result
mysql-test/r/order_by.result
+10
-2
mysql-test/t/order_by.test
mysql-test/t/order_by.test
+16
-1
sql/item.cc
sql/item.cc
+2
-0
No files found.
mysql-test/r/order_by.result
View file @
61cd864b
...
...
@@ -29,14 +29,14 @@ INSERT INTO t2 VALUES (7,'Liste des t2','t2_liste_form.phtml',51060,'link.gif');
INSERT INTO t2 VALUES (8,'Consulter les soumissions','consulter_soumissions.phtml',200,'link.gif');
INSERT INTO t2 VALUES (9,'Ajouter un type de materiel','typeMateriel_ajoute_form.phtml',51000,'link.gif');
INSERT INTO t2 VALUES (10,'Lister/modifier un type de materiel','typeMateriel_liste_form.phtml',51010,'link.gif');
INSERT INTO t2 VALUES (3,'Crer une fiche de client','clients_ajoute_form.phtml',40000,'link.gif');
INSERT INTO t2 VALUES (3,'Cr
é
er une fiche de client','clients_ajoute_form.phtml',40000,'link.gif');
INSERT INTO t2 VALUES (4,'Modifier des clients','en_construction.html',40010,'link.gif');
INSERT INTO t2 VALUES (5,'Effacer des clients','en_construction.html',40020,'link.gif');
INSERT INTO t2 VALUES (6,'Ajouter un service','t2_ajoute_form.phtml',51050,'link.gif');
select t1.id,t1.idservice,t2.ordre,t2.description from t1, t2 where t1.id = 2 and t1.idservice = t2.id order by t2.ordre;
id idservice ordre description
2 1 10 Emettre un appel d'offres
2 3 40000 Crer une fiche de client
2 3 40000 Cr
é
er une fiche de client
2 4 40010 Modifier des clients
2 5 40020 Effacer des clients
2 6 51050 Ajouter un service
...
...
@@ -874,6 +874,14 @@ num (select num + 2 FROM t1 LIMIT 1)
SELECT a.a + 1 AS num FROM t1 a JOIN t1 b ON num = b.a;
ERROR 42S22: Unknown column 'num' in 'on clause'
DROP TABLE t1;
CREATE TABLE t1 (a int);
SELECT p.a AS val, q.a AS val1 FROM t1 p, t1 q ORDER BY val > 1;
val val1
SELECT p.a AS val, q.a AS val FROM t1 p, t1 q ORDER BY val;
ERROR 23000: Column 'val' in order clause is ambiguous
SELECT p.a AS val, q.a AS val FROM t1 p, t1 q ORDER BY val > 1;
ERROR 23000: Column 'val' in order clause is ambiguous
DROP TABLE t1;
create table t1 (a int not null, b int not null, c int not null);
insert t1 values (1,1,1),(1,1,2),(1,2,1);
select a, b from t1 group by a, b order by sum(c);
...
...
mysql-test/t/order_by.test
View file @
61cd864b
...
...
@@ -44,7 +44,7 @@ INSERT INTO t2 VALUES (7,'Liste des t2','t2_liste_form.phtml',51060,'link.gif');
INSERT
INTO
t2
VALUES
(
8
,
'Consulter les soumissions'
,
'consulter_soumissions.phtml'
,
200
,
'link.gif'
);
INSERT
INTO
t2
VALUES
(
9
,
'Ajouter un type de materiel'
,
'typeMateriel_ajoute_form.phtml'
,
51000
,
'link.gif'
);
INSERT
INTO
t2
VALUES
(
10
,
'Lister/modifier un type de materiel'
,
'typeMateriel_liste_form.phtml'
,
51010
,
'link.gif'
);
INSERT
INTO
t2
VALUES
(
3
,
'Crer une fiche de client'
,
'clients_ajoute_form.phtml'
,
40000
,
'link.gif'
);
INSERT
INTO
t2
VALUES
(
3
,
'Cr
é
er une fiche de client'
,
'clients_ajoute_form.phtml'
,
40000
,
'link.gif'
);
INSERT
INTO
t2
VALUES
(
4
,
'Modifier des clients'
,
'en_construction.html'
,
40010
,
'link.gif'
);
INSERT
INTO
t2
VALUES
(
5
,
'Effacer des clients'
,
'en_construction.html'
,
40020
,
'link.gif'
);
INSERT
INTO
t2
VALUES
(
6
,
'Ajouter un service'
,
't2_ajoute_form.phtml'
,
51050
,
'link.gif'
);
...
...
@@ -588,6 +588,21 @@ SELECT a + 1 AS num, (select num + 2 FROM t1 LIMIT 1) FROM t1;
SELECT
a
.
a
+
1
AS
num
FROM
t1
a
JOIN
t1
b
ON
num
=
b
.
a
;
DROP
TABLE
t1
;
#
# Bug #25427: crash when order by expression contains a name
# that cannot be resolved unambiguously
#
CREATE
TABLE
t1
(
a
int
);
SELECT
p
.
a
AS
val
,
q
.
a
AS
val1
FROM
t1
p
,
t1
q
ORDER
BY
val
>
1
;
--
error
1052
SELECT
p
.
a
AS
val
,
q
.
a
AS
val
FROM
t1
p
,
t1
q
ORDER
BY
val
;
--
error
1052
SELECT
p
.
a
AS
val
,
q
.
a
AS
val
FROM
t1
p
,
t1
q
ORDER
BY
val
>
1
;
DROP
TABLE
t1
;
# End of 4.1 tests
create
table
t1
(
a
int
not
null
,
b
int
not
null
,
c
int
not
null
);
insert
t1
values
(
1
,
1
,
1
),(
1
,
1
,
2
),(
1
,
2
,
1
);
...
...
sql/item.cc
View file @
61cd864b
...
...
@@ -3698,6 +3698,8 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
Item
**
res
=
find_item_in_list
(
this
,
thd
->
lex
->
current_select
->
item_list
,
&
counter
,
REPORT_EXCEPT_NOT_FOUND
,
&
not_used
);
if
(
!
res
)
return
1
;
if
(
res
!=
(
Item
**
)
not_found_item
)
{
if
((
*
res
)
->
type
()
==
Item
::
FIELD_ITEM
)
...
...
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