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
122c72e2
Commit
122c72e2
authored
May 13, 2005
by
ramil@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a fix (bug #10339: Incorrect error is displayed if try to set value of internal ' warning_count ').
parent
187ee471
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
0 deletions
+19
-0
mysql-test/r/variables.result
mysql-test/r/variables.result
+4
-0
mysql-test/t/variables.test
mysql-test/t/variables.test
+8
-0
sql/set_var.cc
sql/set_var.cc
+5
-0
sql/set_var.h
sql/set_var.h
+2
-0
No files found.
mysql-test/r/variables.result
View file @
122c72e2
...
@@ -526,3 +526,7 @@ show warnings;
...
@@ -526,3 +526,7 @@ show warnings;
Level Code Message
Level Code Message
Warning 1329 No data to FETCH
Warning 1329 No data to FETCH
drop table t1;
drop table t1;
set @@warning_count=1;
ERROR HY000: Variable 'warning_count' is a read only variable
set @@global.error_count=1;
ERROR HY000: Variable 'error_count' is a read only variable
mysql-test/t/variables.test
View file @
122c72e2
...
@@ -395,3 +395,11 @@ select a into @x from t1;
...
@@ -395,3 +395,11 @@ select a into @x from t1;
show
warnings
;
show
warnings
;
drop
table
t1
;
drop
table
t1
;
#
# Bug #10339: read only variables.
#
--
error
1238
set
@@
warning_count
=
1
;
--
error
1238
set
@@
global
.
error_count
=
1
;
sql/set_var.cc
View file @
122c72e2
...
@@ -2964,6 +2964,11 @@ bool not_all_support_one_shot(List<set_var_base> *var_list)
...
@@ -2964,6 +2964,11 @@ bool not_all_support_one_shot(List<set_var_base> *var_list)
int
set_var
::
check
(
THD
*
thd
)
int
set_var
::
check
(
THD
*
thd
)
{
{
if
(
var
->
is_readonly
())
{
my_error
(
ER_INCORRECT_GLOBAL_LOCAL_VAR
,
MYF
(
0
),
var
->
name
,
"read only"
);
return
-
1
;
}
if
(
var
->
check_type
(
type
))
if
(
var
->
check_type
(
type
))
{
{
int
err
=
type
==
OPT_GLOBAL
?
ER_LOCAL_VARIABLE
:
ER_GLOBAL_VARIABLE
;
int
err
=
type
==
OPT_GLOBAL
?
ER_LOCAL_VARIABLE
:
ER_GLOBAL_VARIABLE
;
...
...
sql/set_var.h
View file @
122c72e2
...
@@ -75,6 +75,7 @@ public:
...
@@ -75,6 +75,7 @@ public:
{
return
option_limits
==
0
;
}
{
return
option_limits
==
0
;
}
Item
*
item
(
THD
*
thd
,
enum_var_type
type
,
LEX_STRING
*
base
);
Item
*
item
(
THD
*
thd
,
enum_var_type
type
,
LEX_STRING
*
base
);
virtual
bool
is_struct
()
{
return
0
;
}
virtual
bool
is_struct
()
{
return
0
;
}
virtual
bool
is_readonly
()
const
{
return
0
;
}
};
};
...
@@ -699,6 +700,7 @@ public:
...
@@ -699,6 +700,7 @@ public:
return
(
*
value_ptr_func
)(
thd
);
return
(
*
value_ptr_func
)(
thd
);
}
}
SHOW_TYPE
type
()
{
return
show_type
;
}
SHOW_TYPE
type
()
{
return
show_type
;
}
bool
is_readonly
()
const
{
return
1
;
}
};
};
class
sys_var_thd_time_zone
:
public
sys_var_thd
class
sys_var_thd_time_zone
:
public
sys_var_thd
...
...
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