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
c675beab
Commit
c675beab
authored
May 27, 2009
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
merged 5.0-bugteam to 5.1-bugteam
parents
c8a7b791
80730df7
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
49 additions
and
1 deletion
+49
-1
mysql-test/r/sp-error.result
mysql-test/r/sp-error.result
+10
-0
mysql-test/t/sp-error.test
mysql-test/t/sp-error.test
+13
-0
sql/item_func.cc
sql/item_func.cc
+9
-1
sql/share/errmsg.txt
sql/share/errmsg.txt
+3
-0
sql/sql_derived.cc
sql/sql_derived.cc
+1
-0
sql/sql_lex.cc
sql/sql_lex.cc
+10
-0
sql/sql_lex.h
sql/sql_lex.h
+2
-0
sql/table.cc
sql/table.cc
+1
-0
No files found.
mysql-test/r/sp-error.result
View file @
c675beab
...
...
@@ -1660,3 +1660,13 @@ declare continue handler for sqlstate '00000' set @x=0;
end$$
ERROR 42000: Bad SQLSTATE: '00000'
LOAD DATA INFILE '../../tmp/proc.txt' INTO TABLE mysql.proc;
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1,1), (2,2);
SELECT MAX (a) FROM t1 WHERE b = 999999;
ERROR 42000: FUNCTION test.MAX does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT AVG (a) FROM t1 WHERE b = 999999;
AVG (a)
NULL
SELECT non_existent (a) FROM t1 WHERE b = 999999;
ERROR 42000: FUNCTION test.non_existent does not exist
DROP TABLE t1;
mysql-test/t/sp-error.test
View file @
c675beab
...
...
@@ -2435,3 +2435,16 @@ delimiter ;$$
#
LOAD
DATA
INFILE
'../../tmp/proc.txt'
INTO
TABLE
mysql
.
proc
;
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
proc
.
txt
;
#
# Bug #38159: Function parsing problem generates misleading error message
#
CREATE
TABLE
t1
(
a
INT
,
b
INT
);
INSERT
INTO
t1
VALUES
(
1
,
1
),
(
2
,
2
);
--
error
ER_FUNC_INEXISTENT_NAME_COLLISION
SELECT
MAX
(
a
)
FROM
t1
WHERE
b
=
999999
;
SELECT
AVG
(
a
)
FROM
t1
WHERE
b
=
999999
;
--
error
ER_SP_DOES_NOT_EXIST
SELECT
non_existent
(
a
)
FROM
t1
WHERE
b
=
999999
;
DROP
TABLE
t1
;
sql/item_func.cc
View file @
c675beab
...
...
@@ -5802,6 +5802,14 @@ Item_func_sp::func_name() const
}
int
my_missing_function_error
(
const
LEX_STRING
&
token
,
const
char
*
func_name
)
{
if
(
token
.
length
&&
is_lex_native_function
(
&
token
))
return
my_error
(
ER_FUNC_INEXISTENT_NAME_COLLISION
,
MYF
(
0
),
func_name
);
else
return
my_error
(
ER_SP_DOES_NOT_EXIST
,
MYF
(
0
),
"FUNCTION"
,
func_name
);
}
/**
@brief Initialize the result field by creating a temporary dummy table
...
...
@@ -5834,7 +5842,7 @@ Item_func_sp::init_result_field(THD *thd)
if
(
!
(
m_sp
=
sp_find_routine
(
thd
,
TYPE_ENUM_FUNCTION
,
m_name
,
&
thd
->
sp_func_cache
,
TRUE
)))
{
my_
error
(
ER_SP_DOES_NOT_EXIST
,
MYF
(
0
),
"FUNCTION"
,
m_name
->
m_qname
.
str
);
my_
missing_function_error
(
m_name
->
m_name
,
m_name
->
m_qname
.
str
);
context
->
process_error
(
thd
);
DBUG_RETURN
(
TRUE
);
}
...
...
sql/share/errmsg.txt
View file @
c675beab
...
...
@@ -6177,3 +6177,6 @@ ER_TOO_LONG_TABLE_COMMENT
ER_TOO_LONG_FIELD_COMMENT
eng "Comment for field '%-.64s' is too long (max = %lu)"
por "Comentrio para o campo '%-.64s' longo demais (max = %lu)"
ER_FUNC_INEXISTENT_NAME_COLLISION 42000
eng "FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual"
sql/sql_derived.cc
View file @
c675beab
...
...
@@ -179,6 +179,7 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *orig_table_list)
{
if
(
thd
->
is_error
()
&&
(
thd
->
main_da
.
sql_errno
()
==
ER_BAD_FIELD_ERROR
||
thd
->
main_da
.
sql_errno
()
==
ER_FUNC_INEXISTENT_NAME_COLLISION
||
thd
->
main_da
.
sql_errno
()
==
ER_SP_DOES_NOT_EXIST
))
{
thd
->
clear_error
();
...
...
sql/sql_lex.cc
View file @
c675beab
...
...
@@ -433,6 +433,16 @@ bool is_keyword(const char *name, uint len)
return
get_hash_symbol
(
name
,
len
,
0
)
!=
0
;
}
/**
Check if name is a sql function
@param name checked name
@return is this a native function or not
@retval 0 name is a function
@retval 1 name isn't a function
*/
bool
is_lex_native_function
(
const
LEX_STRING
*
name
)
{
DBUG_ASSERT
(
name
!=
NULL
);
...
...
sql/sql_lex.h
View file @
c675beab
...
...
@@ -1976,4 +1976,6 @@ extern bool is_lex_native_function(const LEX_STRING *name);
@} (End of group Semantic_Analysis)
*/
int
my_missing_function_error
(
const
LEX_STRING
&
token
,
const
char
*
name
);
#endif
/* MYSQL_SERVER */
sql/table.cc
View file @
c675beab
...
...
@@ -3341,6 +3341,7 @@ void TABLE_LIST::hide_view_error(THD *thd)
if
(
thd
->
main_da
.
sql_errno
()
==
ER_BAD_FIELD_ERROR
||
thd
->
main_da
.
sql_errno
()
==
ER_SP_DOES_NOT_EXIST
||
thd
->
main_da
.
sql_errno
()
==
ER_FUNC_INEXISTENT_NAME_COLLISION
||
thd
->
main_da
.
sql_errno
()
==
ER_PROCACCESS_DENIED_ERROR
||
thd
->
main_da
.
sql_errno
()
==
ER_COLUMNACCESS_DENIED_ERROR
||
thd
->
main_da
.
sql_errno
()
==
ER_TABLEACCESS_DENIED_ERROR
||
...
...
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