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
4f29d776
Commit
4f29d776
authored
May 16, 2020
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.3 into 10.4
parents
a4996f95
3eadb135
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
973 additions
and
26 deletions
+973
-26
client/mysql.cc
client/mysql.cc
+3
-16
mysql-test/main/custom_aggregate_functions.result
mysql-test/main/custom_aggregate_functions.result
+35
-0
mysql-test/main/custom_aggregate_functions.test
mysql-test/main/custom_aggregate_functions.test
+36
-0
mysql-test/main/func_math.result
mysql-test/main/func_math.result
+737
-1
mysql-test/main/func_math.test
mysql-test/main/func_math.test
+60
-1
mysql-test/main/table_value_constr.result
mysql-test/main/table_value_constr.result
+11
-0
mysql-test/main/table_value_constr.test
mysql-test/main/table_value_constr.test
+13
-0
mysql-test/suite/parts/inc/partition_auto_increment.inc
mysql-test/suite/parts/inc/partition_auto_increment.inc
+11
-0
mysql-test/suite/parts/r/partition_auto_increment_innodb.result
...test/suite/parts/r/partition_auto_increment_innodb.result
+8
-0
mysql-test/suite/parts/r/partition_auto_increment_maria.result
...-test/suite/parts/r/partition_auto_increment_maria.result
+8
-0
mysql-test/suite/parts/r/partition_auto_increment_memory.result
...test/suite/parts/r/partition_auto_increment_memory.result
+8
-0
mysql-test/suite/parts/r/partition_auto_increment_myisam.result
...test/suite/parts/r/partition_auto_increment_myisam.result
+8
-0
sql/item_func.cc
sql/item_func.cc
+11
-0
sql/item_sum.cc
sql/item_sum.cc
+5
-3
sql/sp_head.cc
sql/sp_head.cc
+1
-1
sql/sql_repl.cc
sql/sql_repl.cc
+4
-3
sql/sql_tvc.cc
sql/sql_tvc.cc
+8
-1
sql/table.cc
sql/table.cc
+6
-0
No files found.
client/mysql.cc
View file @
4f29d776
...
...
@@ -91,6 +91,9 @@ extern "C" {
#include <conio.h>
#else
#include <readline.h>
#if !defined(USE_LIBEDIT_INTERFACE)
#include <history.h>
#endif
#define HAVE_READLINE
#define USE_POPEN
#endif
...
...
@@ -1042,22 +1045,6 @@ static const char *embedded_server_groups[]=
{
"server"
,
"embedded"
,
"mysql_SERVER"
,
"mariadb_SERVER"
,
0
};
#ifdef HAVE_READLINE
/*
HIST_ENTRY is defined for libedit, but not for the real readline
Need to redefine it for real readline to find it
*/
#if !defined(HAVE_HIST_ENTRY)
typedef
struct
_hist_entry
{
const
char
*
line
;
const
char
*
data
;
}
HIST_ENTRY
;
#endif
extern
"C"
int
add_history
(
const
char
*
command
);
/* From readline directory */
extern
"C"
int
read_history
(
const
char
*
command
);
extern
"C"
int
write_history
(
const
char
*
command
);
extern
"C"
HIST_ENTRY
*
history_get
(
int
num
);
extern
"C"
int
history_length
;
static
int
not_in_history
(
const
char
*
line
);
static
void
initialize_readline
();
static
void
fix_history
(
String
*
final_command
);
...
...
mysql-test/main/custom_aggregate_functions.result
View file @
4f29d776
...
...
@@ -1154,6 +1154,40 @@ NULL 8
drop function agg_sum;
drop table t1;
#
# User defined aggregate functions not working correctly when the schema is changed
#
CREATE SCHEMA IF NOT EXISTS common_schema;
CREATE SCHEMA IF NOT EXISTS another_schema;
DROP FUNCTION IF EXISTS common_schema.add_ints |
Warnings:
Note 1305 FUNCTION common_schema.add_ints does not exist
CREATE FUNCTION common_schema.add_ints(int_1 INT, int_2 INT) RETURNS INT NO SQL
BEGIN
RETURN int_1 + int_2;
END |
DROP FUNCTION IF EXISTS common_schema.sum_ints |
Warnings:
Note 1305 FUNCTION common_schema.sum_ints does not exist
CREATE AGGREGATE FUNCTION common_schema.sum_ints(int_val INT) RETURNS INT
BEGIN
DECLARE result INT DEFAULT 0;
DECLARE CONTINUE HANDLER FOR NOT FOUND RETURN result;
LOOP FETCH GROUP NEXT ROW;
SET result = common_schema.add_ints(result, int_val);
END LOOP;
END |
use common_schema;
SELECT common_schema.sum_ints(seq) FROM (SELECT 1 seq UNION ALL SELECT 2) t;
common_schema.sum_ints(seq)
3
USE another_schema;
SELECT common_schema.sum_ints(seq) FROM (SELECT 1 seq UNION ALL SELECT 2) t;
common_schema.sum_ints(seq)
3
drop database common_schema;
drop database another_schema;
USE test;
#
# MDEV-18813 PROCEDURE and anonymous blocks silently ignore FETCH GROUP NEXT ROW
#
CREATE PROCEDURE p1()
...
...
@@ -1186,3 +1220,4 @@ STARTS CURRENT_TIMESTAMP + INTERVAL 1 MONTH
ENDS CURRENT_TIMESTAMP + INTERVAL 1 MONTH + INTERVAL 1 WEEK
DO FETCH GROUP NEXT ROW;
ERROR HY000: Aggregate specific instruction (FETCH GROUP NEXT ROW) used in a wrong context
# End of 10.4 tests
mysql-test/main/custom_aggregate_functions.test
View file @
4f29d776
...
...
@@ -966,6 +966,40 @@ select i, sum(i) from t1 group by i with rollup;
drop
function
agg_sum
;
drop
table
t1
;
--
echo
#
--
echo
# User defined aggregate functions not working correctly when the schema is changed
--
echo
#
CREATE
SCHEMA
IF
NOT
EXISTS
common_schema
;
CREATE
SCHEMA
IF
NOT
EXISTS
another_schema
;
DELIMITER
|
;
DROP
FUNCTION
IF
EXISTS
common_schema
.
add_ints
|
CREATE
FUNCTION
common_schema
.
add_ints
(
int_1
INT
,
int_2
INT
)
RETURNS
INT
NO
SQL
BEGIN
RETURN
int_1
+
int_2
;
END
|
DROP
FUNCTION
IF
EXISTS
common_schema
.
sum_ints
|
CREATE
AGGREGATE
FUNCTION
common_schema
.
sum_ints
(
int_val
INT
)
RETURNS
INT
BEGIN
DECLARE
result
INT
DEFAULT
0
;
DECLARE
CONTINUE
HANDLER
FOR
NOT
FOUND
RETURN
result
;
LOOP
FETCH
GROUP
NEXT
ROW
;
SET
result
=
common_schema
.
add_ints
(
result
,
int_val
);
END
LOOP
;
END
|
DELIMITER
;
|
use
common_schema
;
SELECT
common_schema
.
sum_ints
(
seq
)
FROM
(
SELECT
1
seq
UNION
ALL
SELECT
2
)
t
;
USE
another_schema
;
SELECT
common_schema
.
sum_ints
(
seq
)
FROM
(
SELECT
1
seq
UNION
ALL
SELECT
2
)
t
;
drop
database
common_schema
;
drop
database
another_schema
;
USE
test
;
--
echo
#
--
echo
# MDEV-18813 PROCEDURE and anonymous blocks silently ignore FETCH GROUP NEXT ROW
...
...
@@ -1016,3 +1050,5 @@ CREATE EVENT ev1
STARTS
CURRENT_TIMESTAMP
+
INTERVAL
1
MONTH
ENDS
CURRENT_TIMESTAMP
+
INTERVAL
1
MONTH
+
INTERVAL
1
WEEK
DO
FETCH
GROUP
NEXT
ROW
;
--
echo
# End of 10.4 tests
mysql-test/main/func_math.result
View file @
4f29d776
...
...
@@ -1015,6 +1015,742 @@ SELECT -9223372036854775808 MOD -9223372036854775808;
-9223372036854775808 MOD -9223372036854775808
0
#
# MDEV-22502 MDB crashes in CREATE TABLE AS SELECT when the precision of returning type = 0
#
CREATE TABLE t1 (d decimal(5,5));
INSERT INTO t1 VALUES (0.55555);
SELECT TRUNCATE(d,0) FROM t1;
TRUNCATE(d,0)
0
CREATE TABLE t2 AS SELECT TRUNCATE(d,0) FROM t1;
SELECT * FROM t2;
TRUNCATE(d,0)
0
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`TRUNCATE(d,0)` decimal(1,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1, t2;
#
# MDEV-22503 MDB limits DECIMAL column precision to 16 doing CTAS with floor/ceil over DECIMAL(X,Y) where X > 16
#
CREATE TABLE t44 (d1 decimal(38,0) DEFAULT NULL);
INSERT INTO t44 VALUES (12345678901234567890123456789012345678);
SELECT FLOOR(d1) FROM t44;
FLOOR(d1)
12345678901234567890123456789012345678
CREATE TABLE t45 AS SELECT FLOOR(d1) FROM t44;
SELECT * FROM t45;
FLOOR(d1)
12345678901234567890123456789012345678
SHOW CREATE TABLE t45;
Table Create Table
t45 CREATE TABLE `t45` (
`FLOOR(d1)` decimal(38,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t44, t45;
CREATE PROCEDURE p1(prec INT, scale INT)
BEGIN
DECLARE maxval VARCHAR(128) DEFAULT '';
SET @type= CONCAT('DECIMAL(', prec, ',', scale,')');
SET @stmt= CONCAT('CREATE TABLE t1 (a ', @type, ',b ', @type, 'unsigned)');
PREPARE stmt FROM @stmt;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET maxval= CONCAT(REPEAT('9', prec-scale), '.', REPEAT('9',scale));
INSERT INTO t1 VALUES (maxval, maxval);
CREATE TABLE t2 AS SELECT a, b, FLOOR(a) AS fa, FLOOR(b) AS fb FROM t1;
SHOW CREATE TABLE t2;
SELECT * FROM t2;
DROP TABLE t1, t2;
END;
$$
CREATE PROCEDURE p2(prec INT)
BEGIN
DECLARE scale INT DEFAULT 0;
WHILE scale < prec AND scale <= 30 DO
CALL p1(prec, scale);
SET scale= scale + 1;
END WHILE;
END;
$$
CALL p2(38);
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,0) DEFAULT NULL,
`b` decimal(38,0) unsigned DEFAULT NULL,
`fa` decimal(38,0) DEFAULT NULL,
`fb` decimal(38,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999999999999999999999
b 99999999999999999999999999999999999999
fa 99999999999999999999999999999999999999
fb 99999999999999999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,1) DEFAULT NULL,
`b` decimal(38,1) unsigned DEFAULT NULL,
`fa` decimal(37,0) DEFAULT NULL,
`fb` decimal(37,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999999999999999999999.9
b 9999999999999999999999999999999999999.9
fa 9999999999999999999999999999999999999
fb 9999999999999999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,2) DEFAULT NULL,
`b` decimal(38,2) unsigned DEFAULT NULL,
`fa` decimal(36,0) DEFAULT NULL,
`fb` decimal(36,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999999999999999999.99
b 999999999999999999999999999999999999.99
fa 999999999999999999999999999999999999
fb 999999999999999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,3) DEFAULT NULL,
`b` decimal(38,3) unsigned DEFAULT NULL,
`fa` decimal(35,0) DEFAULT NULL,
`fb` decimal(35,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999999999999999999.999
b 99999999999999999999999999999999999.999
fa 99999999999999999999999999999999999
fb 99999999999999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,4) DEFAULT NULL,
`b` decimal(38,4) unsigned DEFAULT NULL,
`fa` decimal(34,0) DEFAULT NULL,
`fb` decimal(34,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999999999999999999.9999
b 9999999999999999999999999999999999.9999
fa 9999999999999999999999999999999999
fb 9999999999999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,5) DEFAULT NULL,
`b` decimal(38,5) unsigned DEFAULT NULL,
`fa` decimal(33,0) DEFAULT NULL,
`fb` decimal(33,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999999999999999.99999
b 999999999999999999999999999999999.99999
fa 999999999999999999999999999999999
fb 999999999999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,6) DEFAULT NULL,
`b` decimal(38,6) unsigned DEFAULT NULL,
`fa` decimal(32,0) DEFAULT NULL,
`fb` decimal(32,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999999999999999.999999
b 99999999999999999999999999999999.999999
fa 99999999999999999999999999999999
fb 99999999999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,7) DEFAULT NULL,
`b` decimal(38,7) unsigned DEFAULT NULL,
`fa` decimal(31,0) DEFAULT NULL,
`fb` decimal(31,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999999999999999.9999999
b 9999999999999999999999999999999.9999999
fa 9999999999999999999999999999999
fb 9999999999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,8) DEFAULT NULL,
`b` decimal(38,8) unsigned DEFAULT NULL,
`fa` decimal(30,0) DEFAULT NULL,
`fb` decimal(30,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999999999999.99999999
b 999999999999999999999999999999.99999999
fa 999999999999999999999999999999
fb 999999999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,9) DEFAULT NULL,
`b` decimal(38,9) unsigned DEFAULT NULL,
`fa` decimal(29,0) DEFAULT NULL,
`fb` decimal(29,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999999999999.999999999
b 99999999999999999999999999999.999999999
fa 99999999999999999999999999999
fb 99999999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,10) DEFAULT NULL,
`b` decimal(38,10) unsigned DEFAULT NULL,
`fa` decimal(28,0) DEFAULT NULL,
`fb` decimal(28,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999999999999.9999999999
b 9999999999999999999999999999.9999999999
fa 9999999999999999999999999999
fb 9999999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,11) DEFAULT NULL,
`b` decimal(38,11) unsigned DEFAULT NULL,
`fa` decimal(27,0) DEFAULT NULL,
`fb` decimal(27,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999999999.99999999999
b 999999999999999999999999999.99999999999
fa 999999999999999999999999999
fb 999999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,12) DEFAULT NULL,
`b` decimal(38,12) unsigned DEFAULT NULL,
`fa` decimal(26,0) DEFAULT NULL,
`fb` decimal(26,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999999999.999999999999
b 99999999999999999999999999.999999999999
fa 99999999999999999999999999
fb 99999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,13) DEFAULT NULL,
`b` decimal(38,13) unsigned DEFAULT NULL,
`fa` decimal(25,0) DEFAULT NULL,
`fb` decimal(25,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999999999.9999999999999
b 9999999999999999999999999.9999999999999
fa 9999999999999999999999999
fb 9999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,14) DEFAULT NULL,
`b` decimal(38,14) unsigned DEFAULT NULL,
`fa` decimal(24,0) DEFAULT NULL,
`fb` decimal(24,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999999.99999999999999
b 999999999999999999999999.99999999999999
fa 999999999999999999999999
fb 999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,15) DEFAULT NULL,
`b` decimal(38,15) unsigned DEFAULT NULL,
`fa` decimal(23,0) DEFAULT NULL,
`fb` decimal(23,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999999.999999999999999
b 99999999999999999999999.999999999999999
fa 99999999999999999999999
fb 99999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,16) DEFAULT NULL,
`b` decimal(38,16) unsigned DEFAULT NULL,
`fa` decimal(22,0) DEFAULT NULL,
`fb` decimal(22,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999999.9999999999999999
b 9999999999999999999999.9999999999999999
fa 9999999999999999999999
fb 9999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,17) DEFAULT NULL,
`b` decimal(38,17) unsigned DEFAULT NULL,
`fa` decimal(21,0) DEFAULT NULL,
`fb` decimal(21,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999.99999999999999999
b 999999999999999999999.99999999999999999
fa 999999999999999999999
fb 999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,18) DEFAULT NULL,
`b` decimal(38,18) unsigned DEFAULT NULL,
`fa` decimal(20,0) DEFAULT NULL,
`fb` decimal(20,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999.999999999999999999
b 99999999999999999999.999999999999999999
fa 99999999999999999999
fb 99999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,19) DEFAULT NULL,
`b` decimal(38,19) unsigned DEFAULT NULL,
`fa` decimal(19,0) DEFAULT NULL,
`fb` decimal(19,0) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999.9999999999999999999
b 9999999999999999999.9999999999999999999
fa 9999999999999999999
fb 9999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,20) DEFAULT NULL,
`b` decimal(38,20) unsigned DEFAULT NULL,
`fa` decimal(18,0) DEFAULT NULL,
`fb` bigint(17) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999.99999999999999999999
b 999999999999999999.99999999999999999999
fa 999999999999999999
fb 999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,21) DEFAULT NULL,
`b` decimal(38,21) unsigned DEFAULT NULL,
`fa` bigint(17) DEFAULT NULL,
`fb` bigint(17) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999.999999999999999999999
b 99999999999999999.999999999999999999999
fa 99999999999999999
fb 99999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,22) DEFAULT NULL,
`b` decimal(38,22) unsigned DEFAULT NULL,
`fa` bigint(17) DEFAULT NULL,
`fb` bigint(17) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999.9999999999999999999999
b 9999999999999999.9999999999999999999999
fa 9999999999999999
fb 9999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,23) DEFAULT NULL,
`b` decimal(38,23) unsigned DEFAULT NULL,
`fa` bigint(17) DEFAULT NULL,
`fb` bigint(17) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999.99999999999999999999999
b 999999999999999.99999999999999999999999
fa 999999999999999
fb 999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,24) DEFAULT NULL,
`b` decimal(38,24) unsigned DEFAULT NULL,
`fa` bigint(17) DEFAULT NULL,
`fb` bigint(16) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999.999999999999999999999999
b 99999999999999.999999999999999999999999
fa 99999999999999
fb 99999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,25) DEFAULT NULL,
`b` decimal(38,25) unsigned DEFAULT NULL,
`fa` bigint(16) DEFAULT NULL,
`fb` bigint(15) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999.9999999999999999999999999
b 9999999999999.9999999999999999999999999
fa 9999999999999
fb 9999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,26) DEFAULT NULL,
`b` decimal(38,26) unsigned DEFAULT NULL,
`fa` bigint(15) DEFAULT NULL,
`fb` bigint(14) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999.99999999999999999999999999
b 999999999999.99999999999999999999999999
fa 999999999999
fb 999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,27) DEFAULT NULL,
`b` decimal(38,27) unsigned DEFAULT NULL,
`fa` bigint(14) DEFAULT NULL,
`fb` bigint(13) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999.999999999999999999999999999
b 99999999999.999999999999999999999999999
fa 99999999999
fb 99999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,28) DEFAULT NULL,
`b` decimal(38,28) unsigned DEFAULT NULL,
`fa` bigint(13) DEFAULT NULL,
`fb` bigint(12) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999.9999999999999999999999999999
b 9999999999.9999999999999999999999999999
fa 9999999999
fb 9999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,29) DEFAULT NULL,
`b` decimal(38,29) unsigned DEFAULT NULL,
`fa` bigint(12) DEFAULT NULL,
`fb` bigint(11) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999.99999999999999999999999999999
b 999999999.99999999999999999999999999999
fa 999999999
fb 999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,30) DEFAULT NULL,
`b` decimal(38,30) unsigned DEFAULT NULL,
`fa` bigint(11) DEFAULT NULL,
`fb` bigint(10) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999.999999999999999999999999999999
b 99999999.999999999999999999999999999999
fa 99999999
fb 99999999
CALL p2(30);
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,0) DEFAULT NULL,
`b` decimal(30,0) unsigned DEFAULT NULL,
`fa` decimal(30,0) DEFAULT NULL,
`fb` decimal(31,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999999999999
b 999999999999999999999999999999
fa 999999999999999999999999999999
fb 999999999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,1) DEFAULT NULL,
`b` decimal(30,1) unsigned DEFAULT NULL,
`fa` decimal(29,0) DEFAULT NULL,
`fb` decimal(30,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999999999999.9
b 99999999999999999999999999999.9
fa 99999999999999999999999999999
fb 99999999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,2) DEFAULT NULL,
`b` decimal(30,2) unsigned DEFAULT NULL,
`fa` decimal(28,0) DEFAULT NULL,
`fb` decimal(29,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999999999999.99
b 9999999999999999999999999999.99
fa 9999999999999999999999999999
fb 9999999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,3) DEFAULT NULL,
`b` decimal(30,3) unsigned DEFAULT NULL,
`fa` decimal(27,0) DEFAULT NULL,
`fb` decimal(28,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999999999.999
b 999999999999999999999999999.999
fa 999999999999999999999999999
fb 999999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,4) DEFAULT NULL,
`b` decimal(30,4) unsigned DEFAULT NULL,
`fa` decimal(26,0) DEFAULT NULL,
`fb` decimal(27,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999999999.9999
b 99999999999999999999999999.9999
fa 99999999999999999999999999
fb 99999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,5) DEFAULT NULL,
`b` decimal(30,5) unsigned DEFAULT NULL,
`fa` decimal(25,0) DEFAULT NULL,
`fb` decimal(26,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999999999.99999
b 9999999999999999999999999.99999
fa 9999999999999999999999999
fb 9999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,6) DEFAULT NULL,
`b` decimal(30,6) unsigned DEFAULT NULL,
`fa` decimal(24,0) DEFAULT NULL,
`fb` decimal(25,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999999.999999
b 999999999999999999999999.999999
fa 999999999999999999999999
fb 999999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,7) DEFAULT NULL,
`b` decimal(30,7) unsigned DEFAULT NULL,
`fa` decimal(23,0) DEFAULT NULL,
`fb` decimal(24,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999999.9999999
b 99999999999999999999999.9999999
fa 99999999999999999999999
fb 99999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,8) DEFAULT NULL,
`b` decimal(30,8) unsigned DEFAULT NULL,
`fa` decimal(22,0) DEFAULT NULL,
`fb` decimal(23,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999999.99999999
b 9999999999999999999999.99999999
fa 9999999999999999999999
fb 9999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,9) DEFAULT NULL,
`b` decimal(30,9) unsigned DEFAULT NULL,
`fa` decimal(21,0) DEFAULT NULL,
`fb` decimal(22,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999.999999999
b 999999999999999999999.999999999
fa 999999999999999999999
fb 999999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,10) DEFAULT NULL,
`b` decimal(30,10) unsigned DEFAULT NULL,
`fa` decimal(20,0) DEFAULT NULL,
`fb` decimal(21,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999.9999999999
b 99999999999999999999.9999999999
fa 99999999999999999999
fb 99999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,11) DEFAULT NULL,
`b` decimal(30,11) unsigned DEFAULT NULL,
`fa` decimal(19,0) DEFAULT NULL,
`fb` decimal(20,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999.99999999999
b 9999999999999999999.99999999999
fa 9999999999999999999
fb 9999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,12) DEFAULT NULL,
`b` decimal(30,12) unsigned DEFAULT NULL,
`fa` decimal(18,0) DEFAULT NULL,
`fb` bigint(17) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999.999999999999
b 999999999999999999.999999999999
fa 999999999999999999
fb 999999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,13) DEFAULT NULL,
`b` decimal(30,13) unsigned DEFAULT NULL,
`fa` bigint(17) DEFAULT NULL,
`fb` bigint(17) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999.9999999999999
b 99999999999999999.9999999999999
fa 99999999999999999
fb 99999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,14) DEFAULT NULL,
`b` decimal(30,14) unsigned DEFAULT NULL,
`fa` bigint(17) DEFAULT NULL,
`fb` bigint(17) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999.99999999999999
b 9999999999999999.99999999999999
fa 9999999999999999
fb 9999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,15) DEFAULT NULL,
`b` decimal(30,15) unsigned DEFAULT NULL,
`fa` bigint(17) DEFAULT NULL,
`fb` bigint(17) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999.999999999999999
b 999999999999999.999999999999999
fa 999999999999999
fb 999999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,16) DEFAULT NULL,
`b` decimal(30,16) unsigned DEFAULT NULL,
`fa` bigint(17) DEFAULT NULL,
`fb` bigint(16) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999.9999999999999999
b 99999999999999.9999999999999999
fa 99999999999999
fb 99999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,17) DEFAULT NULL,
`b` decimal(30,17) unsigned DEFAULT NULL,
`fa` bigint(16) DEFAULT NULL,
`fb` bigint(15) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999.99999999999999999
b 9999999999999.99999999999999999
fa 9999999999999
fb 9999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,18) DEFAULT NULL,
`b` decimal(30,18) unsigned DEFAULT NULL,
`fa` bigint(15) DEFAULT NULL,
`fb` bigint(14) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999.999999999999999999
b 999999999999.999999999999999999
fa 999999999999
fb 999999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,19) DEFAULT NULL,
`b` decimal(30,19) unsigned DEFAULT NULL,
`fa` bigint(14) DEFAULT NULL,
`fb` bigint(13) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999.9999999999999999999
b 99999999999.9999999999999999999
fa 99999999999
fb 99999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,20) DEFAULT NULL,
`b` decimal(30,20) unsigned DEFAULT NULL,
`fa` bigint(13) DEFAULT NULL,
`fb` bigint(12) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999.99999999999999999999
b 9999999999.99999999999999999999
fa 9999999999
fb 9999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,21) DEFAULT NULL,
`b` decimal(30,21) unsigned DEFAULT NULL,
`fa` bigint(12) DEFAULT NULL,
`fb` bigint(11) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999.999999999999999999999
b 999999999.999999999999999999999
fa 999999999
fb 999999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,22) DEFAULT NULL,
`b` decimal(30,22) unsigned DEFAULT NULL,
`fa` bigint(11) DEFAULT NULL,
`fb` bigint(10) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999.9999999999999999999999
b 99999999.9999999999999999999999
fa 99999999
fb 99999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,23) DEFAULT NULL,
`b` decimal(30,23) unsigned DEFAULT NULL,
`fa` bigint(10) DEFAULT NULL,
`fb` int(9) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999.99999999999999999999999
b 9999999.99999999999999999999999
fa 9999999
fb 9999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,24) DEFAULT NULL,
`b` decimal(30,24) unsigned DEFAULT NULL,
`fa` int(9) DEFAULT NULL,
`fb` int(8) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999.999999999999999999999999
b 999999.999999999999999999999999
fa 999999
fb 999999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,25) DEFAULT NULL,
`b` decimal(30,25) unsigned DEFAULT NULL,
`fa` int(8) DEFAULT NULL,
`fb` int(7) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999.9999999999999999999999999
b 99999.9999999999999999999999999
fa 99999
fb 99999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,26) DEFAULT NULL,
`b` decimal(30,26) unsigned DEFAULT NULL,
`fa` int(7) DEFAULT NULL,
`fb` int(6) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999.99999999999999999999999999
b 9999.99999999999999999999999999
fa 9999
fb 9999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,27) DEFAULT NULL,
`b` decimal(30,27) unsigned DEFAULT NULL,
`fa` int(6) DEFAULT NULL,
`fb` int(5) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999.999999999999999999999999999
b 999.999999999999999999999999999
fa 999
fb 999
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,28) DEFAULT NULL,
`b` decimal(30,28) unsigned DEFAULT NULL,
`fa` int(5) DEFAULT NULL,
`fb` int(4) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99.9999999999999999999999999999
b 99.9999999999999999999999999999
fa 99
fb 99
Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,29) DEFAULT NULL,
`b` decimal(30,29) unsigned DEFAULT NULL,
`fa` int(4) DEFAULT NULL,
`fb` int(3) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9.99999999999999999999999999999
b 9.99999999999999999999999999999
fa 9
fb 9
DROP PROCEDURE p2;
DROP PROCEDURE p1;
#
# End of 10.1 tests
#
#
...
...
@@ -1466,7 +2202,7 @@ SET @val = 'a';
EXECUTE stmt1 USING @val;
CRC32(?)
3904355907
DEALLOCATE PREPARE stmt;
DEALLOCATE PREPARE stmt
1
;
SET NAMES utf8;
CREATE TABLE t1 (a TEXT) CHARACTER SET = utf8;
LOAD DATA INFILE '../../std_data/loaddata_utf8.dat' INTO TABLE t1 CHARACTER SET utf8;
...
...
mysql-test/main/func_math.test
View file @
4f29d776
...
...
@@ -715,6 +715,65 @@ SELECT 9223372036854775808 MOD -9223372036854775808;
SELECT
-
9223372036854775808
MOD
9223372036854775808
;
SELECT
-
9223372036854775808
MOD
-
9223372036854775808
;
--
echo
#
--
echo
# MDEV-22502 MDB crashes in CREATE TABLE AS SELECT when the precision of returning type = 0
--
echo
#
CREATE
TABLE
t1
(
d
decimal
(
5
,
5
));
INSERT
INTO
t1
VALUES
(
0.55555
);
SELECT
TRUNCATE
(
d
,
0
)
FROM
t1
;
CREATE
TABLE
t2
AS
SELECT
TRUNCATE
(
d
,
0
)
FROM
t1
;
SELECT
*
FROM
t2
;
SHOW
CREATE
TABLE
t2
;
DROP
TABLE
t1
,
t2
;
--
echo
#
--
echo
# MDEV-22503 MDB limits DECIMAL column precision to 16 doing CTAS with floor/ceil over DECIMAL(X,Y) where X > 16
--
echo
#
CREATE
TABLE
t44
(
d1
decimal
(
38
,
0
)
DEFAULT
NULL
);
INSERT
INTO
t44
VALUES
(
12345678901234567890123456789012345678
);
SELECT
FLOOR
(
d1
)
FROM
t44
;
CREATE
TABLE
t45
AS
SELECT
FLOOR
(
d1
)
FROM
t44
;
SELECT
*
FROM
t45
;
SHOW
CREATE
TABLE
t45
;
DROP
TABLE
t44
,
t45
;
DELIMITER
$$
;
CREATE
PROCEDURE
p1
(
prec
INT
,
scale
INT
)
BEGIN
DECLARE
maxval
VARCHAR
(
128
)
DEFAULT
''
;
SET
@
type
=
CONCAT
(
'DECIMAL('
,
prec
,
','
,
scale
,
')'
);
SET
@
stmt
=
CONCAT
(
'CREATE TABLE t1 (a '
,
@
type
,
',b '
,
@
type
,
'unsigned)'
);
PREPARE
stmt
FROM
@
stmt
;
EXECUTE
stmt
;
DEALLOCATE
PREPARE
stmt
;
SET
maxval
=
CONCAT
(
REPEAT
(
'9'
,
prec
-
scale
),
'.'
,
REPEAT
(
'9'
,
scale
));
INSERT
INTO
t1
VALUES
(
maxval
,
maxval
);
CREATE
TABLE
t2
AS
SELECT
a
,
b
,
FLOOR
(
a
)
AS
fa
,
FLOOR
(
b
)
AS
fb
FROM
t1
;
SHOW
CREATE
TABLE
t2
;
SELECT
*
FROM
t2
;
DROP
TABLE
t1
,
t2
;
END
;
$$
CREATE
PROCEDURE
p2
(
prec
INT
)
BEGIN
DECLARE
scale
INT
DEFAULT
0
;
WHILE
scale
<
prec
AND
scale
<=
30
DO
CALL
p1
(
prec
,
scale
);
SET
scale
=
scale
+
1
;
END
WHILE
;
END
;
$$
DELIMITER
;
$$
--
vertical_results
CALL
p2
(
38
);
CALL
p2
(
30
);
--
horizontal_results
DROP
PROCEDURE
p2
;
DROP
PROCEDURE
p1
;
--
echo
#
...
...
@@ -1013,7 +1072,7 @@ DROP FUNCTION crc32_func;
PREPARE
stmt1
FROM
'SELECT CRC32(?)'
;
SET
@
val
=
'a'
;
EXECUTE
stmt1
USING
@
val
;
DEALLOCATE
PREPARE
stmt
;
DEALLOCATE
PREPARE
stmt
1
;
# Test case for checksum on contents of a file
SET
NAMES
utf8
;
...
...
mysql-test/main/table_value_constr.result
View file @
4f29d776
...
...
@@ -2599,3 +2599,14 @@ a
2
1
drop view v1;
#
# MDEV-22560 Crash on a table value constructor with an SP variable
#
BEGIN NOT ATOMIC
DECLARE a INT DEFAULT 0;
VALUES (a) UNION SELECT 1;
END;
$$
a
0
1
mysql-test/main/table_value_constr.test
View file @
4f29d776
...
...
@@ -1326,3 +1326,16 @@ create view v1 as with t(a) as (values (2), (1)) select a from t;
show
create
view
v1
;
select
*
from
v1
;
drop
view
v1
;
--
echo
#
--
echo
# MDEV-22560 Crash on a table value constructor with an SP variable
--
echo
#
DELIMITER
$$
;
BEGIN
NOT
ATOMIC
DECLARE
a
INT
DEFAULT
0
;
VALUES
(
a
)
UNION
SELECT
1
;
END
;
$$
DELIMITER
;
$$
mysql-test/suite/parts/inc/partition_auto_increment.inc
View file @
4f29d776
...
...
@@ -861,6 +861,17 @@ SELECT * FROM t1;
DROP
TABLE
t1
;
}
if
(
!
$skip_update
)
{
--
echo
#
--
echo
# MDEV-19622 Assertion failures in
--
echo
# ha_partition::set_auto_increment_if_higher upon UPDATE on Aria table
--
echo
#
CREATE
OR
REPLACE
TABLE
t1
(
pk
INT
AUTO_INCREMENT
,
a
INT
,
KEY
(
pk
))
ENGINE
=
myisam
PARTITION
BY
HASH
(
a
);
INSERT
INTO
t1
VALUES
(
1
,
1
),(
2
,
2
);
UPDATE
t1
SET
pk
=
0
;
DROP
TABLE
t1
;
}
--
echo
##############################################################################
}
mysql-test/suite/parts/r/partition_auto_increment_innodb.result
View file @
4f29d776
...
...
@@ -1101,4 +1101,12 @@ SELECT * FROM t1;
a
0
DROP TABLE t1;
#
# MDEV-19622 Assertion failures in
# ha_partition::set_auto_increment_if_higher upon UPDATE on Aria table
#
CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam PARTITION BY HASH(a);
INSERT INTO t1 VALUES (1,1),(2,2);
UPDATE t1 SET pk = 0;
DROP TABLE t1;
##############################################################################
mysql-test/suite/parts/r/partition_auto_increment_maria.result
View file @
4f29d776
...
...
@@ -1148,4 +1148,12 @@ SELECT * FROM t1;
a
0
DROP TABLE t1;
#
# MDEV-19622 Assertion failures in
# ha_partition::set_auto_increment_if_higher upon UPDATE on Aria table
#
CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam PARTITION BY HASH(a);
INSERT INTO t1 VALUES (1,1),(2,2);
UPDATE t1 SET pk = 0;
DROP TABLE t1;
##############################################################################
mysql-test/suite/parts/r/partition_auto_increment_memory.result
View file @
4f29d776
...
...
@@ -1129,4 +1129,12 @@ SELECT * FROM t1;
a
0
DROP TABLE t1;
#
# MDEV-19622 Assertion failures in
# ha_partition::set_auto_increment_if_higher upon UPDATE on Aria table
#
CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam PARTITION BY HASH(a);
INSERT INTO t1 VALUES (1,1),(2,2);
UPDATE t1 SET pk = 0;
DROP TABLE t1;
##############################################################################
mysql-test/suite/parts/r/partition_auto_increment_myisam.result
View file @
4f29d776
...
...
@@ -1148,4 +1148,12 @@ SELECT * FROM t1;
a
0
DROP TABLE t1;
#
# MDEV-19622 Assertion failures in
# ha_partition::set_auto_increment_if_higher upon UPDATE on Aria table
#
CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam PARTITION BY HASH(a);
INSERT INTO t1 VALUES (1,1),(2,2);
UPDATE t1 SET pk = 0;
DROP TABLE t1;
##############################################################################
sql/item_func.cc
View file @
4f29d776
...
...
@@ -2173,6 +2173,12 @@ longlong Item_func_bit_neg::val_int()
void
Item_func_int_val
::
fix_length_and_dec_int_or_decimal
()
{
/*
The INT branch of this code should be revised.
It creates too large data types, e.g.
CREATE OR REPLACE TABLE t2 AS SELECT FLOOR(9999999.999) AS fa;
results in a BININT(10) column, while INT(7) should probably be enough.
*/
ulonglong
tmp_max_length
=
(
ulonglong
)
args
[
0
]
->
max_length
-
(
args
[
0
]
->
decimals
?
args
[
0
]
->
decimals
+
1
:
0
)
+
2
;
max_length
=
tmp_max_length
>
(
ulonglong
)
UINT_MAX32
?
...
...
@@ -2187,6 +2193,9 @@ void Item_func_int_val::fix_length_and_dec_int_or_decimal()
*/
if
(
args
[
0
]
->
max_length
-
args
[
0
]
->
decimals
>=
DECIMAL_LONGLONG_DIGITS
-
2
)
{
fix_char_length
(
my_decimal_precision_to_length_no_truncation
(
args
[
0
]
->
decimal_int_part
(),
0
,
false
));
set_handler
(
&
type_handler_newdecimal
);
}
else
...
...
@@ -2303,6 +2312,8 @@ void Item_func_round::fix_length_and_dec_decimal(uint decimals_to_set)
set_handler
(
&
type_handler_newdecimal
);
unsigned_flag
=
args
[
0
]
->
unsigned_flag
;
decimals
=
decimals_to_set
;
if
(
!
precision
)
precision
=
1
;
// DECIMAL(0,0) -> DECIMAL(1,0)
max_length
=
my_decimal_precision_to_length_no_truncation
(
precision
,
decimals
,
unsigned_flag
);
...
...
sql/item_sum.cc
View file @
4f29d776
...
...
@@ -1385,10 +1385,12 @@ Item_sum_sp::execute()
bool
res
;
uint
old_server_status
=
thd
->
server_status
;
/* We set server status so we can send a signal to exit from the
function with the return value. */
/*
We set server status so we can send a signal to exit from the
function with the return value.
*/
thd
->
server_status
=
SERVER_STATUS_LAST_ROW_SENT
;
thd
->
server_status
|
=
SERVER_STATUS_LAST_ROW_SENT
;
res
=
Item_sp
::
execute
(
thd
,
&
null_value
,
args
,
arg_count
);
thd
->
server_status
=
old_server_status
;
return
res
;
...
...
sql/sp_head.cc
View file @
4f29d776
...
...
@@ -4505,7 +4505,7 @@ sp_instr_agg_cfetch::execute(THD *thd, uint *nextp)
else
{
thd
->
spcont
->
pause_state
=
FALSE
;
if
(
thd
->
server_status
==
SERVER_STATUS_LAST_ROW_SENT
)
if
(
thd
->
server_status
&
SERVER_STATUS_LAST_ROW_SENT
)
{
my_message
(
ER_SP_FETCH_NO_DATA
,
ER_THD
(
thd
,
ER_SP_FETCH_NO_DATA
),
MYF
(
0
));
...
...
sql/sql_repl.cc
View file @
4f29d776
/* Copyright (c) 2000, 2018, Oracle and/or its affiliates.
Copyright (c) 2008, 20
19
, MariaDB Corporation
Copyright (c) 2008, 20
20
, MariaDB Corporation
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -2005,7 +2005,7 @@ send_event_to_slave(binlog_send_info *info, Log_event_type event_type,
pos
=
my_b_tell
(
log
);
if
(
repl_semisync_master
.
update_sync_header
(
info
->
thd
,
(
uchar
*
)
packet
->
ptr
(),
(
uchar
*
)
packet
->
c_ptr_safe
(),
info
->
log_file_name
+
info
->
dirlen
,
pos
,
&
need_sync
))
{
...
...
@@ -2029,7 +2029,8 @@ send_event_to_slave(binlog_send_info *info, Log_event_type event_type,
}
}
if
(
need_sync
&&
repl_semisync_master
.
flush_net
(
info
->
thd
,
packet
->
c_ptr
()))
if
(
need_sync
&&
repl_semisync_master
.
flush_net
(
info
->
thd
,
packet
->
c_ptr_safe
()))
{
info
->
error
=
ER_UNKNOWN_ERROR
;
return
"Failed to run hook 'after_send_event'"
;
...
...
sql/sql_tvc.cc
View file @
4f29d776
...
...
@@ -52,7 +52,14 @@ bool fix_fields_for_tvc(THD *thd, List_iterator_fast<List_item> &li)
while
((
item
=
it
++
))
{
if
(
item
->
fix_fields
(
thd
,
0
))
/*
Some items have already been fixed.
For example Item_splocal items get fixed in
Item_splocal::append_for_log(), which is called from subst_spvars()
while replacing their values to NAME_CONST()s.
So fix only those that have not been.
*/
if
(
item
->
fix_fields_if_needed
(
thd
,
0
))
DBUG_RETURN
(
true
);
}
}
...
...
sql/table.cc
View file @
4f29d776
...
...
@@ -7007,6 +7007,12 @@ void TABLE::mark_columns_needed_for_update()
}
need_signal
=
true
;
}
else
{
if
(
found_next_number_field
)
mark_auto_increment_column
();
}
if
(
file
->
ha_table_flags
()
&
HA_PRIMARY_KEY_REQUIRED_FOR_DELETE
)
{
/*
...
...
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