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
111c0f14
Commit
111c0f14
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
Metadata functions
parent
a3e756c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
0 deletions
+68
-0
mysql-test/r/default.result
mysql-test/r/default.result
+34
-0
mysql-test/t/default.test
mysql-test/t/default.test
+34
-0
No files found.
mysql-test/r/default.result
View file @
111c0f14
...
...
@@ -2003,3 +2003,37 @@ xa 2
xxa 3
xxxa 4
DROP TABLE t1;
#
# INT result metadata functions
#
CREATE TABLE t1
(
id SERIAL PRIMARY KEY,
b INT DEFAULT LAST_INSERT_ID()
);
ERROR HY000: Function or expression 'last_insert_id' is not allowed for 'DEFAULT' of column/constraint 'b'
CREATE TABLE t1 (a INT DEFAULT CONNECTION_ID());
INSERT INTO t1 VALUES();
SELECT a>0 FROM t1;
a>0
1
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT COERCIBILITY(a), c INT DEFAULT COERCIBILITY(b));
INSERT INTO t1 (a) VALUES ('test');
SELECT * FROM t1;
a b c
test 2 5
DROP TABLE t1;
#
# String result metadata functions
#
CREATE TABLE t1 (
a VARCHAR(10) CHARACTER SET latin1,
b VARCHAR(20) DEFAULT CHARSET(a),
c VARCHAR(20) DEFAULT COLLATION(a)
);
INSERT INTO t1 (a) VALUES ('test');
SELECT * FROM t1;
a b c
test latin1 latin1_swedish_ci
DROP TABLE t1;
mysql-test/t/default.test
View file @
111c0f14
...
...
@@ -1570,3 +1570,37 @@ CREATE TABLE t1 (a VARCHAR(10), b INT DEFAULT REGEXP_INSTR(a, 'a'));
INSERT
INTO
t1
(
a
)
VALUES
(
'xa'
),(
'xxa'
),(
'xxxa'
);
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# INT result metadata functions
--
echo
#
# QQ: LAST_INSERT_ID() should probably be allowed
--
error
ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED
CREATE
TABLE
t1
(
id
SERIAL
PRIMARY
KEY
,
b
INT
DEFAULT
LAST_INSERT_ID
()
);
CREATE
TABLE
t1
(
a
INT
DEFAULT
CONNECTION_ID
());
INSERT
INTO
t1
VALUES
();
SELECT
a
>
0
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
VARCHAR
(
10
),
b
INT
DEFAULT
COERCIBILITY
(
a
),
c
INT
DEFAULT
COERCIBILITY
(
b
));
INSERT
INTO
t1
(
a
)
VALUES
(
'test'
);
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# String result metadata functions
--
echo
#
CREATE
TABLE
t1
(
a
VARCHAR
(
10
)
CHARACTER
SET
latin1
,
b
VARCHAR
(
20
)
DEFAULT
CHARSET
(
a
),
c
VARCHAR
(
20
)
DEFAULT
COLLATION
(
a
)
);
INSERT
INTO
t1
(
a
)
VALUES
(
'test'
);
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
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