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
b5870a5d
Commit
b5870a5d
authored
Jun 10, 2016
by
Alexander Barkov
Committed by
Sergei Golubchik
Jun 30, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More test for MDEV-10134 Add full support for DEFAULT
Functions DATABASE() and USER().
parent
5ba196c4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
0 deletions
+78
-0
mysql-test/r/default.result
mysql-test/r/default.result
+15
-0
mysql-test/r/grant.result
mysql-test/r/grant.result
+25
-0
mysql-test/t/default.test
mysql-test/t/default.test
+12
-0
mysql-test/t/grant.test
mysql-test/t/grant.test
+26
-0
No files found.
mysql-test/r/default.result
View file @
b5870a5d
...
...
@@ -1118,6 +1118,21 @@ ERROR HY000: Function or expression 'current_user()' is not allowed for 'DEFAULT
CREATE TABLE t1 (a VARCHAR(30) DEFAULT CURRENT_ROLE);
ERROR HY000: Function or expression 'current_role()' is not allowed for 'DEFAULT' of column/constraint 'a'
#
# Other Item_func_sysconst derived functions
#
CREATE TABLE t1 (a VARCHAR(30) DEFAULT DATABASE());
INSERT INTO t1 VALUES ();
USE INFORMATION_SCHEMA;
INSERT INTO test.t1 VALUES ();
USE test;
INSERT INTO t1 VALUES ();
SELECT * FROM t1;
a
test
information_schema
test
DROP TABLE t1;
#
# Check DEFAULT() function
#
CREATE TABLE `t1` (`a` int(11) DEFAULT 3+3,`b` int(11) DEFAULT '1000');
...
...
mysql-test/r/grant.result
View file @
b5870a5d
...
...
@@ -2665,3 +2665,28 @@ GRANT USAGE ON *.* TO 'mysqltest_u1'@'%'
drop database mysqltest_db1;
drop user mysqltest_u1;
set GLOBAL sql_mode=default;
#
# Start of 10.2 tests
#
#
# MDEV-10134 Add full support for DEFAULT
#
CREATE TABLE t1 (a VARCHAR(30) DEFAULT USER());
INSERT INTO t1 VALUES ();
GRANT ALL PRIVILEGES ON test.* TO dummy@localhost IDENTIFIED BY 'pwd';
connect conn1,localhost,dummy,pwd,test;
connection conn1;
INSERT INTO t1 VALUES ();
connection default;
disconnect conn1;
INSERT INTO t1 VALUES ();
SELECT * FROM t1;
a
root@localhost
dummy@localhost
root@localhost
DROP TABLE t1;
DROP USER dummy@localhost;
#
# End of 10.2 tests
#
mysql-test/t/default.test
View file @
b5870a5d
...
...
@@ -848,6 +848,18 @@ CREATE TABLE t1 (a VARCHAR(30) DEFAULT CURRENT_USER);
--
error
ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED
CREATE
TABLE
t1
(
a
VARCHAR
(
30
)
DEFAULT
CURRENT_ROLE
);
--
echo
#
--
echo
# Other Item_func_sysconst derived functions
--
echo
#
CREATE
TABLE
t1
(
a
VARCHAR
(
30
)
DEFAULT
DATABASE
());
INSERT
INTO
t1
VALUES
();
USE
INFORMATION_SCHEMA
;
INSERT
INTO
test
.
t1
VALUES
();
USE
test
;
INSERT
INTO
t1
VALUES
();
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Check DEFAULT() function
--
echo
#
...
...
mysql-test/t/grant.test
View file @
b5870a5d
...
...
@@ -2172,3 +2172,29 @@ drop user mysqltest_u1;
set
GLOBAL
sql_mode
=
default
;
# Wait till we reached the initial number of concurrent sessions
--
source
include
/
wait_until_count_sessions
.
inc
--
echo
#
--
echo
# Start of 10.2 tests
--
echo
#
--
echo
#
--
echo
# MDEV-10134 Add full support for DEFAULT
--
echo
#
CREATE
TABLE
t1
(
a
VARCHAR
(
30
)
DEFAULT
USER
());
INSERT
INTO
t1
VALUES
();
GRANT
ALL
PRIVILEGES
ON
test
.*
TO
dummy
@
localhost
IDENTIFIED
BY
'pwd'
;
connect
(
conn1
,
localhost
,
dummy
,
pwd
,
test
);
connection
conn1
;
INSERT
INTO
t1
VALUES
();
connection
default
;
disconnect
conn1
;
INSERT
INTO
t1
VALUES
();
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
DROP
USER
dummy
@
localhost
;
--
echo
#
--
echo
# End of 10.2 tests
--
echo
#
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