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
eaa87eb8
Commit
eaa87eb8
authored
Feb 20, 2023
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow random_bytes() in virtual columns
parent
ffc08863
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
6 deletions
+25
-6
mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc
mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc
+6
-2
mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result
mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result
+9
-1
mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result
mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result
+9
-1
sql/item_strfunc.h
sql/item_strfunc.h
+1
-2
No files found.
mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc
View file @
eaa87eb8
...
...
@@ -257,9 +257,13 @@ drop table t1;
--
echo
#
create
table
t1
(
a
int
);
--
error
ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
insert
t1
values
(
1
);
alter
table
t1
add
column
b
binary
(
32
)
generated
always
as
(
random_bytes
(
a
));
alter
table
t1
add
column
b
binary
(
32
)
default
(
random_bytes
(
a
));
select
a
,
length
(
b
)
from
t1
;
--
error
ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
alter
table
t1
add
index
(
b
);
alter
table
t1
add
column
c
binary
(
32
)
default
(
random_bytes
(
a
));
select
a
,
length
(
b
),
length
(
c
)
from
t1
;
drop
table
t1
;
--
echo
#
...
...
mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result
View file @
eaa87eb8
...
...
@@ -177,9 +177,17 @@ drop table t1;
# MDEV-29029 Index corruption and/or assertion failure upon using RANDOM_BYTES for indexed virtual column
#
create table t1 (a int);
insert t1 values (1);
alter table t1 add column b binary(32) generated always as (random_bytes(a));
select a,length(b) from t1;
a length(b)
1 32
alter table t1 add index (b);
ERROR HY000: Function or expression 'random_bytes()' cannot be used in the GENERATED ALWAYS AS clause of `b`
alter table t1 add column b binary(32) default (random_bytes(a));
alter table t1 add column c binary(32) default (random_bytes(a));
select a,length(b),length(c) from t1;
a length(b) length(c)
1 32 32
drop table t1;
#
#
...
...
mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result
View file @
eaa87eb8
...
...
@@ -179,9 +179,17 @@ drop table t1;
# MDEV-29029 Index corruption and/or assertion failure upon using RANDOM_BYTES for indexed virtual column
#
create table t1 (a int);
insert t1 values (1);
alter table t1 add column b binary(32) generated always as (random_bytes(a));
select a,length(b) from t1;
a length(b)
1 32
alter table t1 add index (b);
ERROR HY000: Function or expression 'random_bytes()' cannot be used in the GENERATED ALWAYS AS clause of `b`
alter table t1 add column b binary(32) default (random_bytes(a));
alter table t1 add column c binary(32) default (random_bytes(a));
select a,length(b),length(c) from t1;
a length(b) length(c)
1 32 32
drop table t1;
#
#
...
...
sql/item_strfunc.h
View file @
eaa87eb8
...
...
@@ -423,8 +423,7 @@ class Item_func_random_bytes : public Item_str_func
}
bool
check_vcol_func_processor
(
void
*
arg
)
override
{
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_NON_DETERMINISTIC
|
VCOL_NEXTVAL
);
return
mark_unsupported_function
(
func_name
(),
"()"
,
arg
,
VCOL_NON_DETERMINISTIC
);
}
Item
*
get_copy
(
THD
*
thd
)
override
{
...
...
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