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
a3e756c5
Commit
a3e756c5
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
Dynamic column functions
parent
b5870a5d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
0 deletions
+70
-0
mysql-test/r/dyncol.result
mysql-test/r/dyncol.result
+37
-0
mysql-test/t/dyncol.test
mysql-test/t/dyncol.test
+33
-0
No files found.
mysql-test/r/dyncol.result
View file @
a3e756c5
...
...
@@ -1875,3 +1875,40 @@ COLUMN_JSON(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL))
#
# end of 10.0 tests
#
#
# Start of 10.2 tests
#
#
# MDEV-10134 Add full support for DEFAULT
#
CREATE TABLE t1 (
name VARCHAR(10),
value VARCHAR(10),
dyncol0 BLOB DEFAULT COLUMN_CREATE(name, value),
value_dyncol0_name0 VARCHAR(10) DEFAULT COLUMN_GET(dyncol0, 'name0' AS CHAR),
dyncol1 BLOB DEFAULT COLUMN_ADD(dyncol0, 'name1', 'value1'),
value_dyncol1_name1 VARCHAR(10) DEFAULT COLUMN_GET(dyncol1, 'name1' AS CHAR),
dyncol2 BLOB DEFAULT COLUMN_DELETE(dyncol1, 'name1'),
dyncol2_exists_name0 INT DEFAULT COLUMN_EXISTS(dyncol2, 'name0'),
dyncol2_exists_name1 INT DEFAULT COLUMN_EXISTS(dyncol2, 'name1'),
dyncol2_check INT DEFAULT COLUMN_CHECK(dyncol2),
dyncol1_list TEXT DEFAULT COLUMN_LIST(dyncol1),
dyncol1_json TEXT DEFAULT COLUMN_JSON(dyncol1)
);
INSERT INTO t1 (name,value) VALUES ('name0', 'value0');
SELECT value_dyncol0_name0, value_dyncol1_name1 FROM t1;
value_dyncol0_name0 value_dyncol1_name1
value0 value1
SELECT dyncol2_check, dyncol2_exists_name0, dyncol2_exists_name1 FROM t1;
dyncol2_check dyncol2_exists_name0 dyncol2_exists_name1
1 1 0
SELECT dyncol1_list FROM t1;
dyncol1_list
`name0`,`name1`
SELECT dyncol1_json FROM t1;
dyncol1_json
{"name0":"value0","name1":"value1"}
DROP TABLE t1;
#
# End of 10.2 tests
#
mysql-test/t/dyncol.test
View file @
a3e756c5
...
...
@@ -923,3 +923,36 @@ SELECT COLUMN_JSON(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL));
--
echo
#
--
echo
# end of 10.0 tests
--
echo
#
--
echo
#
--
echo
# Start of 10.2 tests
--
echo
#
--
echo
#
--
echo
# MDEV-10134 Add full support for DEFAULT
--
echo
#
CREATE
TABLE
t1
(
name
VARCHAR
(
10
),
value
VARCHAR
(
10
),
dyncol0
BLOB
DEFAULT
COLUMN_CREATE
(
name
,
value
),
value_dyncol0_name0
VARCHAR
(
10
)
DEFAULT
COLUMN_GET
(
dyncol0
,
'name0'
AS
CHAR
),
dyncol1
BLOB
DEFAULT
COLUMN_ADD
(
dyncol0
,
'name1'
,
'value1'
),
value_dyncol1_name1
VARCHAR
(
10
)
DEFAULT
COLUMN_GET
(
dyncol1
,
'name1'
AS
CHAR
),
dyncol2
BLOB
DEFAULT
COLUMN_DELETE
(
dyncol1
,
'name1'
),
dyncol2_exists_name0
INT
DEFAULT
COLUMN_EXISTS
(
dyncol2
,
'name0'
),
dyncol2_exists_name1
INT
DEFAULT
COLUMN_EXISTS
(
dyncol2
,
'name1'
),
dyncol2_check
INT
DEFAULT
COLUMN_CHECK
(
dyncol2
),
dyncol1_list
TEXT
DEFAULT
COLUMN_LIST
(
dyncol1
),
dyncol1_json
TEXT
DEFAULT
COLUMN_JSON
(
dyncol1
)
);
INSERT
INTO
t1
(
name
,
value
)
VALUES
(
'name0'
,
'value0'
);
SELECT
value_dyncol0_name0
,
value_dyncol1_name1
FROM
t1
;
SELECT
dyncol2_check
,
dyncol2_exists_name0
,
dyncol2_exists_name1
FROM
t1
;
SELECT
dyncol1_list
FROM
t1
;
SELECT
dyncol1_json
FROM
t1
;
DROP
TABLE
t1
;
--
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