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
a9110984
Commit
a9110984
authored
Nov 07, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge an .inc file to .test
parent
6567a94c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
95 deletions
+93
-95
mysql-test/suite/innodb/include/alter_not_null.inc
mysql-test/suite/innodb/include/alter_not_null.inc
+0
-94
mysql-test/suite/innodb/t/alter_not_null.test
mysql-test/suite/innodb/t/alter_not_null.test
+93
-1
No files found.
mysql-test/suite/innodb/include/alter_not_null.inc
deleted
100644 → 0
View file @
6567a94c
--
source
include
/
have_innodb
.
inc
CREATE
TABLE
t1
(
f1
INT
)
ENGINE
=
INNODB
;
INSERT
INTO
t1
VALUES
(
NULL
);
SELECT
*
FROM
t1
;
--
enable_info
--
error
$error_code
ALTER
TABLE
t1
CHANGE
f1
f1
INT
NOT
NULL
;
--
disable_info
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
f1
CHAR
(
10
))
ENGINE
=
INNODB
;
INSERT
INTO
t1
VALUES
(
NULL
);
SELECT
*
FROM
t1
;
--
enable_info
--
error
$error_code
ALTER
TABLE
t1
CHANGE
f1
f1
CHAR
(
10
)
NOT
NULL
;
--
disable_info
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
f1
VARCHAR
(
10
))
ENGINE
=
INNODB
;
INSERT
INTO
t1
VALUES
(
NULL
);
SELECT
*
FROM
t1
;
--
enable_info
--
error
$error_code
ALTER
TABLE
t1
CHANGE
f1
f1
VARCHAR
(
20
)
NOT
NULL
;
--
disable_info
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
f1
TEXT
)
ENGINE
=
INNODB
;
INSERT
INTO
t1
VALUES
(
NULL
);
SELECT
*
FROM
t1
;
--
enable_info
--
error
$error_code
ALTER
TABLE
t1
CHANGE
f1
f1
TEXT
NOT
NULL
DEFAULT
'abc'
;
--
disable_info
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
f1
INT
NOT
NULL
,
f2
INT
NOT
NULL
,
f3
INT
)
ENGINE
=
INNODB
;
INSERT
INTO
t1
VALUES
(
2
,
2
,
NULL
);
SELECT
*
FROM
t1
;
--
enable_info
--
error
$error_code
ALTER
TABLE
t1
CHANGE
f3
f3
INT
NOT
NULL
DEFAULT
(
f1
+
f2
);
--
disable_info
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
f1
INT
NOT
NULL
DEFAULT
0
,
b
TINYINT
)
ENGINE
=
InnoDB
;
INSERT
INTO
t1
VALUES
(
10
,
NULL
);
SELECT
*
FROM
t1
;
--
enable_info
--
error
$error_code
ALTER
TABLE
t1
CHANGE
b
b
TINYINT
NOT
NULL
DEFAULT
if
(
unix_timestamp
()
>
1
,
1000
,
0
);
--
disable_info
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
INT
,
v
INT
AS
(
a
),
c
INT
,
d
INT
NOT
NULL
,
e
INT
)
ENGINE
=
InnoDB
;
--
enable_info
ALTER
TABLE
t1
DROP
COLUMN
c
,
CHANGE
COLUMN
e
e
INT
NOT
NULL
;
--
disable_info
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
INT
,
v
INT
AS
(
a
),
d
INT
NOT
NULL
,
e
INT
)
ENGINE
=
InnoDB
;
--
enable_info
ALTER
TABLE
t1
FORCE
;
--
disable_info
DROP
TABLE
t1
;
# Alter ignore should work irrespective of sql mode
CREATE
TABLE
t1
(
c1
INT
NOT
NULL
,
c2
INT
,
PRIMARY
KEY
(
c1
))
ENGINE
=
INNODB
;
INSERT
INTO
t1
VALUES
(
1
,
NULL
);
--
enable_info
ALTER
IGNORE
TABLE
t1
CHANGE
c2
c2
INT
NOT
NULL
DEFAULT
2
;
--
disable_info
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-16126 Crash or ASAN heap-buffer-overflow in
--
echo
# mach_read_from_n_little_endian upon ALTER TABLE with blob
--
echo
#
CREATE
TABLE
t1
(
a
INT
,
v
INT
AS
(
a
),
b
INT
,
c
BLOB
)
ENGINE
=
InnoDB
;
--
enable_info
ALTER
TABLE
t1
ADD
PRIMARY
KEY
(
b
);
--
disable_info
DROP
TABLE
t1
;
mysql-test/suite/innodb/t/alter_not_null.test
View file @
a9110984
--
source
include
/
have_innodb
.
inc
--
source
alter_sql_mode
.
inc
let
$sql_mode
=
`SELECT @@SQL_MODE`
;
...
...
@@ -7,4 +8,95 @@ if ($sql_mode == "STRICT_TRANS_TABLES") {
let
$error_code
=
WARN_DATA_TRUNCATED
;
}
--
source
include
/
alter_not_null
.
inc
CREATE
TABLE
t1
(
f1
INT
)
ENGINE
=
INNODB
;
INSERT
INTO
t1
VALUES
(
NULL
);
SELECT
*
FROM
t1
;
--
enable_info
--
error
$error_code
ALTER
TABLE
t1
CHANGE
f1
f1
INT
NOT
NULL
;
--
disable_info
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
f1
CHAR
(
10
))
ENGINE
=
INNODB
;
INSERT
INTO
t1
VALUES
(
NULL
);
SELECT
*
FROM
t1
;
--
enable_info
--
error
$error_code
ALTER
TABLE
t1
CHANGE
f1
f1
CHAR
(
10
)
NOT
NULL
;
--
disable_info
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
f1
VARCHAR
(
10
))
ENGINE
=
INNODB
;
INSERT
INTO
t1
VALUES
(
NULL
);
SELECT
*
FROM
t1
;
--
enable_info
--
error
$error_code
ALTER
TABLE
t1
CHANGE
f1
f1
VARCHAR
(
20
)
NOT
NULL
;
--
disable_info
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
f1
TEXT
)
ENGINE
=
INNODB
;
INSERT
INTO
t1
VALUES
(
NULL
);
SELECT
*
FROM
t1
;
--
enable_info
--
error
$error_code
ALTER
TABLE
t1
CHANGE
f1
f1
TEXT
NOT
NULL
DEFAULT
'abc'
;
--
disable_info
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
f1
INT
NOT
NULL
,
f2
INT
NOT
NULL
,
f3
INT
)
ENGINE
=
INNODB
;
INSERT
INTO
t1
VALUES
(
2
,
2
,
NULL
);
SELECT
*
FROM
t1
;
--
enable_info
--
error
$error_code
ALTER
TABLE
t1
CHANGE
f3
f3
INT
NOT
NULL
DEFAULT
(
f1
+
f2
);
--
disable_info
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
f1
INT
NOT
NULL
DEFAULT
0
,
b
TINYINT
)
ENGINE
=
InnoDB
;
INSERT
INTO
t1
VALUES
(
10
,
NULL
);
SELECT
*
FROM
t1
;
--
enable_info
--
error
$error_code
ALTER
TABLE
t1
CHANGE
b
b
TINYINT
NOT
NULL
DEFAULT
if
(
unix_timestamp
()
>
1
,
1000
,
0
);
--
disable_info
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
INT
,
v
INT
AS
(
a
),
c
INT
,
d
INT
NOT
NULL
,
e
INT
)
ENGINE
=
InnoDB
;
--
enable_info
ALTER
TABLE
t1
DROP
COLUMN
c
,
CHANGE
COLUMN
e
e
INT
NOT
NULL
;
--
disable_info
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
INT
,
v
INT
AS
(
a
),
d
INT
NOT
NULL
,
e
INT
)
ENGINE
=
InnoDB
;
--
enable_info
ALTER
TABLE
t1
FORCE
;
--
disable_info
DROP
TABLE
t1
;
# Alter ignore should work irrespective of sql mode
CREATE
TABLE
t1
(
c1
INT
NOT
NULL
,
c2
INT
,
PRIMARY
KEY
(
c1
))
ENGINE
=
INNODB
;
INSERT
INTO
t1
VALUES
(
1
,
NULL
);
--
enable_info
ALTER
IGNORE
TABLE
t1
CHANGE
c2
c2
INT
NOT
NULL
DEFAULT
2
;
--
disable_info
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-16126 Crash or ASAN heap-buffer-overflow in
--
echo
# mach_read_from_n_little_endian upon ALTER TABLE with blob
--
echo
#
CREATE
TABLE
t1
(
a
INT
,
v
INT
AS
(
a
),
b
INT
,
c
BLOB
)
ENGINE
=
InnoDB
;
--
enable_info
ALTER
TABLE
t1
ADD
PRIMARY
KEY
(
b
);
--
disable_info
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