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
fe3b6356
Commit
fe3b6356
authored
Sep 07, 2009
by
Martin Hansson
Browse files
Options
Browse Files
Download
Plain Diff
Bug#46259: Merge
parents
bdd43744
2cb3a131
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
1 deletion
+35
-1
mysql-test/r/udf.result
mysql-test/r/udf.result
+16
-0
mysql-test/t/udf.test
mysql-test/t/udf.test
+12
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+7
-1
No files found.
mysql-test/r/udf.result
View file @
fe3b6356
...
...
@@ -392,4 +392,20 @@ a
4
DROP FUNCTION sequence;
DROP TABLE t1,t2;
#
# Bug#46259: 5.0.83 -> 5.1.36, query doesn't work
#
CREATE TABLE t1 ( a INT );
INSERT INTO t1 VALUES (1), (2), (3);
SELECT IF( a = 1, a, a ) AS `b` FROM t1 ORDER BY field( `b` + 1, 1 );
b
1
2
3
SELECT IF( a = 1, a, a ) AS `b` FROM t1 ORDER BY field( `b`, 1 );
b
2
3
1
DROP TABLE t1;
End of 5.0 tests.
mysql-test/t/udf.test
View file @
fe3b6356
...
...
@@ -436,4 +436,16 @@ SELECT * FROM t2 WHERE a = sequence();
DROP
FUNCTION
sequence
;
DROP
TABLE
t1
,
t2
;
--
echo
#
--
echo
# Bug#46259: 5.0.83 -> 5.1.36, query doesn't work
--
echo
#
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
1
),
(
2
),
(
3
);
SELECT
IF
(
a
=
1
,
a
,
a
)
AS
`b`
FROM
t1
ORDER
BY
field
(
`b`
+
1
,
1
);
SELECT
IF
(
a
=
1
,
a
,
a
)
AS
`b`
FROM
t1
ORDER
BY
field
(
`b`
,
1
);
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
.
sql/sql_yacc.yy
View file @
fe3b6356
...
...
@@ -7921,7 +7921,13 @@ udf_expr:
$2->is_autogenerated_name= FALSE;
$2->set_name($4.str, $4.length, system_charset_info);
}
else
/*
A field has to have its proper name in order for name
resolution to work, something we are only guaranteed if we
parse it out. If we hijack the input stream with
remember_name we may get quoted or escaped names.
*/
else if ($2->type() != Item::FIELD_ITEM)
$2->set_name($1, (uint) ($3 - $1), YYTHD->charset());
$$= $2;
}
...
...
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