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
082aea77
Commit
082aea77
authored
Oct 21, 2023
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-31112 vcol circular references lead to stack overflow
parent
547dfc0e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
3 deletions
+28
-3
mysql-test/suite/vcol/r/vcol_misc.result
mysql-test/suite/vcol/r/vcol_misc.result
+11
-0
mysql-test/suite/vcol/t/vcol_misc.test
mysql-test/suite/vcol/t/vcol_misc.test
+13
-0
sql/item.cc
sql/item.cc
+4
-3
No files found.
mysql-test/suite/vcol/r/vcol_misc.result
View file @
082aea77
...
@@ -569,3 +569,14 @@ drop table t1;
...
@@ -569,3 +569,14 @@ drop table t1;
#
#
# End of 10.3 tests
# End of 10.3 tests
#
#
#
# MDEV-31112 vcol circular references lead to stack overflow
#
create table t (a int, c int as (a));
alter table t alter column c drop default;
alter table t modify column a int as (c) stored;
ERROR 01000: Expression for field `a` is referring to uninitialized field `c`
drop table t;
#
# End of 10.4 tests
#
mysql-test/suite/vcol/t/vcol_misc.test
View file @
082aea77
...
@@ -536,3 +536,16 @@ drop table t1;
...
@@ -536,3 +536,16 @@ drop table t1;
--
echo
#
--
echo
#
--
echo
# End of 10.3 tests
--
echo
# End of 10.3 tests
--
echo
#
--
echo
#
--
echo
#
--
echo
# MDEV-31112 vcol circular references lead to stack overflow
--
echo
#
create
table
t
(
a
int
,
c
int
as
(
a
));
alter
table
t
alter
column
c
drop
default
;
--
error
ER_EXPRESSION_REFERS_TO_UNINIT_FIELD
alter
table
t
modify
column
a
int
as
(
c
)
stored
;
drop
table
t
;
--
echo
#
--
echo
# End of 10.4 tests
--
echo
#
sql/item.cc
View file @
082aea77
...
@@ -908,14 +908,15 @@ bool Item_field::register_field_in_write_map(void *arg)
...
@@ -908,14 +908,15 @@ bool Item_field::register_field_in_write_map(void *arg)
This is used by fix_vcol_expr() when a table is opened
This is used by fix_vcol_expr() when a table is opened
We don't have to check fields that are marked as NO_DEFAULT_VALUE
We don't have to check non-virtual fields that are marked as
as the upper level will ensure that all these will be given a value.
NO_DEFAULT_VALUE as the upper level will ensure that all these
will be given a value.
*/
*/
bool
Item_field
::
check_field_expression_processor
(
void
*
arg
)
bool
Item_field
::
check_field_expression_processor
(
void
*
arg
)
{
{
Field
*
org_field
=
(
Field
*
)
arg
;
Field
*
org_field
=
(
Field
*
)
arg
;
if
(
field
->
flags
&
NO_DEFAULT_VALUE_FLAG
)
if
(
field
->
flags
&
NO_DEFAULT_VALUE_FLAG
&&
!
field
->
vcol_info
)
return
0
;
return
0
;
if
((
field
->
default_value
&&
field
->
default_value
->
flags
)
||
field
->
vcol_info
)
if
((
field
->
default_value
&&
field
->
default_value
->
flags
)
||
field
->
vcol_info
)
{
{
...
...
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