mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Merge 10.0 into 10.1
This commit is contained in:
commit
b61700c221
77 changed files with 488 additions and 184 deletions
|
@ -3059,7 +3059,6 @@ static int com_server_help(String *buffer __attribute__((unused)),
|
|||
{
|
||||
unsigned int num_fields= mysql_num_fields(result);
|
||||
my_ulonglong num_rows= mysql_num_rows(result);
|
||||
mysql_fetch_fields(result);
|
||||
if (num_fields==3 && num_rows==1)
|
||||
{
|
||||
if (!(cur= mysql_fetch_row(result)))
|
||||
|
|
|
@ -1130,7 +1130,7 @@ static int check_version_match(void)
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char self_name[FN_REFLEN];
|
||||
char self_name[FN_REFLEN + 1];
|
||||
|
||||
MY_INIT(argv[0]);
|
||||
|
||||
|
@ -1138,7 +1138,7 @@ int main(int argc, char **argv)
|
|||
if (GetModuleFileName(NULL, self_name, FN_REFLEN) == 0)
|
||||
#endif
|
||||
{
|
||||
strncpy(self_name, argv[0], FN_REFLEN);
|
||||
strmake_buf(self_name, argv[0]);
|
||||
}
|
||||
|
||||
if (init_dynamic_string(&ds_args, "", 512, 256) ||
|
||||
|
|
|
@ -614,6 +614,7 @@ static my_bool sql_connect(MYSQL *mysql, uint wait)
|
|||
|
||||
static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
||||
{
|
||||
int ret = 0;
|
||||
const char *status;
|
||||
/*
|
||||
MySQL documentation relies on the fact that mysqladmin will
|
||||
|
@ -1104,7 +1105,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
if (strcmp(typed_password, verified) != 0)
|
||||
{
|
||||
my_printf_error(0,"Passwords don't match",MYF(ME_BELL));
|
||||
return -1;
|
||||
ret = -1;
|
||||
goto password_done;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1131,7 +1133,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
{
|
||||
my_printf_error(0, "Could not determine old_passwords setting from server; error: '%s'",
|
||||
error_flags, mysql_error(mysql));
|
||||
return -1;
|
||||
ret = -1;
|
||||
goto password_done;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1142,7 +1145,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
"Could not get old_passwords setting from "
|
||||
"server; error: '%s'",
|
||||
error_flags, mysql_error(mysql));
|
||||
return -1;
|
||||
ret = -1;
|
||||
goto password_done;
|
||||
}
|
||||
if (!mysql_num_rows(res))
|
||||
old= 1;
|
||||
|
@ -1167,15 +1171,15 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
{
|
||||
my_printf_error(0, "Can't turn off logging; error: '%s'",
|
||||
error_flags, mysql_error(mysql));
|
||||
return -1;
|
||||
ret = -1;
|
||||
}
|
||||
else
|
||||
if (mysql_query(mysql,buff))
|
||||
{
|
||||
if (mysql_errno(mysql)!=1290)
|
||||
{
|
||||
my_printf_error(0,"unable to change password; error: '%s'",
|
||||
error_flags, mysql_error(mysql));
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1189,9 +1193,10 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
" --skip-grant-tables).\n"
|
||||
"Use: \"mysqladmin flush-privileges password '*'\""
|
||||
" instead", error_flags);
|
||||
return -1;
|
||||
}
|
||||
ret = -1;
|
||||
}
|
||||
password_done:
|
||||
/* free up memory from prompted password */
|
||||
if (typed_password != argv[1])
|
||||
{
|
||||
|
@ -1293,7 +1298,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2252,7 +2252,7 @@ static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
|
|||
int2store(buf + BIN_LOG_HEADER_SIZE, binlog_flags);
|
||||
|
||||
size_t tlen = strlen(logname);
|
||||
if (tlen > UINT_MAX)
|
||||
if (tlen > sizeof(buf) - 10)
|
||||
{
|
||||
error("Log name too long.");
|
||||
DBUG_RETURN(ERROR_STOP);
|
||||
|
|
|
@ -2845,6 +2845,8 @@ static uint get_table_structure(char *table, char *db, char *table_type,
|
|||
|
||||
my_free(scv_buff);
|
||||
|
||||
if (path)
|
||||
my_fclose(sql_file, MYF(MY_WME));
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
else
|
||||
|
@ -5927,8 +5929,7 @@ static my_bool get_view_structure(char *table, char* db)
|
|||
dynstr_free(&ds_view);
|
||||
}
|
||||
|
||||
if (switch_character_set_results(mysql, default_charset))
|
||||
DBUG_RETURN(1);
|
||||
switch_character_set_results(mysql, default_charset);
|
||||
|
||||
/* If a separate .sql file was opened, close it now */
|
||||
if (sql_file != md_result_file)
|
||||
|
|
|
@ -1721,13 +1721,12 @@ void log_msg(const char *fmt, ...)
|
|||
int cat_file(DYNAMIC_STRING* ds, const char* filename)
|
||||
{
|
||||
int fd;
|
||||
size_t len;
|
||||
int len;
|
||||
char buff[16384];
|
||||
|
||||
if ((fd= my_open(filename, O_RDONLY, MYF(0))) < 0)
|
||||
return 1;
|
||||
while((len= my_read(fd, (uchar*)&buff,
|
||||
sizeof(buff)-1, MYF(0))) > 0)
|
||||
while((len= (int)my_read(fd, (uchar*)&buff, sizeof(buff)-1, MYF(0))) > 0)
|
||||
{
|
||||
char *p= buff, *start= buff,*end=buff+len;
|
||||
while (p < end)
|
||||
|
|
|
@ -673,21 +673,4 @@
|
|||
#define __STDC_FORMAT_MACROS
|
||||
#endif
|
||||
|
||||
/*
|
||||
stat structure (from <sys/stat.h>) is conditionally defined
|
||||
to have different layout and size depending on the defined macros.
|
||||
The correct macro is defined in my_config.h, which means it MUST be
|
||||
included first (or at least before <features.h> - so, practically,
|
||||
before including any system headers).
|
||||
|
||||
Check the include order by looking at __GLIBC__ (defined in <features.h>)
|
||||
|
||||
But we cannot force all third-party clients/connectors to include
|
||||
my_config.h first. So, their crashes are their responsibility,
|
||||
we enable this check only for MariaDB sources (SAFE_MUTEX check).
|
||||
*/
|
||||
#if defined(__GLIBC__) && defined(SAFE_MUTEX)
|
||||
#error <my_config.h> MUST be included first!
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -606,22 +606,23 @@ ANALYZE
|
|||
},
|
||||
"block-nl-join": {
|
||||
"table": {
|
||||
"table_name": "<subquery2>",
|
||||
"table_name": "t2",
|
||||
"access_type": "ALL",
|
||||
"possible_keys": ["distinct_key"],
|
||||
"r_loops": 1,
|
||||
"rows": 2,
|
||||
"r_rows": 2,
|
||||
"r_total_time_ms": "REPLACED",
|
||||
"filtered": 100,
|
||||
"r_filtered": 100
|
||||
"r_filtered": 0,
|
||||
"attached_condition": "<in_optimizer>(t2.b,t2.b in (subquery#2))"
|
||||
},
|
||||
"buffer_type": "flat",
|
||||
"buffer_size": "256Kb",
|
||||
"join_type": "BNL",
|
||||
"r_filtered": 100,
|
||||
"materialized": {
|
||||
"unique": 1,
|
||||
"r_filtered": null
|
||||
},
|
||||
"subqueries": [
|
||||
{
|
||||
"query_block": {
|
||||
"select_id": 2,
|
||||
"r_loops": 1,
|
||||
|
@ -638,24 +639,7 @@ ANALYZE
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"block-nl-join": {
|
||||
"table": {
|
||||
"table_name": "t2",
|
||||
"access_type": "ALL",
|
||||
"r_loops": 1,
|
||||
"rows": 2,
|
||||
"r_rows": 2,
|
||||
"r_total_time_ms": "REPLACED",
|
||||
"filtered": 100,
|
||||
"r_filtered": 100
|
||||
},
|
||||
"buffer_type": "incremental",
|
||||
"buffer_size": "256Kb",
|
||||
"join_type": "BNL",
|
||||
"attached_condition": "(t2.b = `<subquery2>`.a)",
|
||||
"r_filtered": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
drop table t1,t2;
|
||||
|
|
|
@ -2628,5 +2628,26 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 PRIMARY t2 ref idx idx 5 test.t1.a 140 Using index; FirstMatch(t1)
|
||||
drop view v1;
|
||||
drop table t1,t2;
|
||||
#
|
||||
# Bug mdev-12812: mergeable derived / view with subqueries
|
||||
# NOT subject to semi-join optimizations
|
||||
#
|
||||
CREATE TABLE t1 (c1 varchar(3)) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES ('foo'),('foo');
|
||||
CREATE TABLE t2 (c2 varchar(3)) ENGINE=MyISAM;
|
||||
INSERT INTO t2 VALUES ('bar'),('qux'),('foo');
|
||||
SELECT STRAIGHT_JOIN *
|
||||
FROM ( SELECT * FROM t1 WHERE c1 IN ( SELECT c2 FROM t2 ) ) AS sq;
|
||||
c1
|
||||
foo
|
||||
foo
|
||||
EXPLAIN EXTENDED SELECT STRAIGHT_JOIN *
|
||||
FROM ( SELECT * FROM t1 WHERE c1 IN ( SELECT c2 FROM t2 ) ) AS sq;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select straight_join `test`.`t1`.`c1` AS `c1` from `test`.`t1` where <in_optimizer>(`test`.`t1`.`c1`,<exists>(select `test`.`t2`.`c2` from `test`.`t2` where (<cache>(`test`.`t1`.`c1`) = `test`.`t2`.`c2`)))
|
||||
DROP TABLE t1, t2;
|
||||
set optimizer_switch=@exit_optimizer_switch;
|
||||
set join_cache_level=@exit_join_cache_level;
|
||||
|
|
|
@ -3107,4 +3107,58 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 PRIMARY t2 range idx idx 5 NULL 2 Using where; Using index; Using join buffer (flat, BNL join)
|
||||
drop table t1,t2;
|
||||
set optimizer_switch= @tmp_mdev12675;
|
||||
#
|
||||
# MDEV-12817: subquery NOT subject to semi-join optimizations
|
||||
# in ON expression of INNER JOIN
|
||||
#
|
||||
CREATE TABLE t1 (c1 int) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
CREATE TABLE t2 (c2 int) ENGINE=MyISAM;
|
||||
INSERT INTO t2 VALUES (3),(4);
|
||||
CREATE TABLE t3 (c3 int) ENGINE=MyISAM;
|
||||
INSERT INTO t3 VALUES (5),(6);
|
||||
CREATE TABLE t4 (c4 int) ENGINE=MyISAM;
|
||||
INSERT INTO t4 VALUES (7),(8);
|
||||
SELECT c1
|
||||
FROM t1
|
||||
LEFT JOIN
|
||||
( t2 INNER JOIN t3 ON ( 1 IN ( SELECT c4 FROM t4 ) ) )
|
||||
ON (c1 = c3);
|
||||
c1
|
||||
1
|
||||
2
|
||||
EXPLAIN EXTENDED SELECT c1
|
||||
FROM t1
|
||||
LEFT JOIN
|
||||
( t2 INNER JOIN t3 ON ( 1 IN ( SELECT c4 FROM t4 ) ) )
|
||||
ON (c1 = c3);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
|
||||
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
2 SUBQUERY t4 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(((`test`.`t3`.`c3` = `test`.`t1`.`c1`) and <cache>(<in_optimizer>(1,<exists>(select `test`.`t4`.`c4` from `test`.`t4` where (1 = `test`.`t4`.`c4`)))))) where 1
|
||||
# mdev-12820
|
||||
SELECT *
|
||||
FROM t1
|
||||
LEFT JOIN
|
||||
( ( SELECT * FROM t2 WHERE c2 IN ( SELECT c3 FROM t3 ) ) AS sq INNER JOIN t4 )
|
||||
ON (c1 = c2);
|
||||
c1 c2 c4
|
||||
1 NULL NULL
|
||||
2 NULL NULL
|
||||
EXPLAIN EXTENDED SELECT *
|
||||
FROM t1
|
||||
LEFT JOIN
|
||||
( ( SELECT * FROM t2 WHERE c2 IN ( SELECT c3 FROM t3 ) ) AS sq INNER JOIN t4 )
|
||||
ON (c1 = c2);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
|
||||
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00
|
||||
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2`,`test`.`t4`.`c4` AS `c4` from `test`.`t1` left join (`test`.`t2` join `test`.`t4`) on(((`test`.`t2`.`c2` = `test`.`t1`.`c1`) and <in_optimizer>(`test`.`t1`.`c1`,<exists>(select `test`.`t3`.`c3` from `test`.`t3` where (<cache>(`test`.`t2`.`c2`) = `test`.`t3`.`c3`))))) where 1
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
set optimizer_switch=@subselect_sj_tmp;
|
||||
|
|
|
@ -3121,6 +3121,60 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 PRIMARY t2 range idx idx 5 NULL 2 Using where; Using index; Using join buffer (flat, BNL join)
|
||||
drop table t1,t2;
|
||||
set optimizer_switch= @tmp_mdev12675;
|
||||
#
|
||||
# MDEV-12817: subquery NOT subject to semi-join optimizations
|
||||
# in ON expression of INNER JOIN
|
||||
#
|
||||
CREATE TABLE t1 (c1 int) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
CREATE TABLE t2 (c2 int) ENGINE=MyISAM;
|
||||
INSERT INTO t2 VALUES (3),(4);
|
||||
CREATE TABLE t3 (c3 int) ENGINE=MyISAM;
|
||||
INSERT INTO t3 VALUES (5),(6);
|
||||
CREATE TABLE t4 (c4 int) ENGINE=MyISAM;
|
||||
INSERT INTO t4 VALUES (7),(8);
|
||||
SELECT c1
|
||||
FROM t1
|
||||
LEFT JOIN
|
||||
( t2 INNER JOIN t3 ON ( 1 IN ( SELECT c4 FROM t4 ) ) )
|
||||
ON (c1 = c3);
|
||||
c1
|
||||
1
|
||||
2
|
||||
EXPLAIN EXTENDED SELECT c1
|
||||
FROM t1
|
||||
LEFT JOIN
|
||||
( t2 INNER JOIN t3 ON ( 1 IN ( SELECT c4 FROM t4 ) ) )
|
||||
ON (c1 = c3);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
|
||||
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
|
||||
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
|
||||
2 SUBQUERY t4 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(((`test`.`t3`.`c3` = `test`.`t1`.`c1`) and <cache>(<in_optimizer>(1,<exists>(select `test`.`t4`.`c4` from `test`.`t4` where (1 = `test`.`t4`.`c4`)))))) where 1
|
||||
# mdev-12820
|
||||
SELECT *
|
||||
FROM t1
|
||||
LEFT JOIN
|
||||
( ( SELECT * FROM t2 WHERE c2 IN ( SELECT c3 FROM t3 ) ) AS sq INNER JOIN t4 )
|
||||
ON (c1 = c2);
|
||||
c1 c2 c4
|
||||
1 NULL NULL
|
||||
2 NULL NULL
|
||||
EXPLAIN EXTENDED SELECT *
|
||||
FROM t1
|
||||
LEFT JOIN
|
||||
( ( SELECT * FROM t2 WHERE c2 IN ( SELECT c3 FROM t3 ) ) AS sq INNER JOIN t4 )
|
||||
ON (c1 = c2);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
|
||||
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
|
||||
1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (incremental, BNL join)
|
||||
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2`,`test`.`t4`.`c4` AS `c4` from `test`.`t1` left join (`test`.`t2` join `test`.`t4`) on(((`test`.`t2`.`c2` = `test`.`t1`.`c1`) and <in_optimizer>(`test`.`t1`.`c1`,<exists>(select `test`.`t3`.`c3` from `test`.`t3` where (<cache>(`test`.`t2`.`c2`) = `test`.`t3`.`c3`))))) where 1
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
set optimizer_switch=@subselect_sj_tmp;
|
||||
#
|
||||
# BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off
|
||||
|
|
17
mysql-test/suite/rpl/r/rpl_mdev-11092.result
Normal file
17
mysql-test/suite/rpl/r/rpl_mdev-11092.result
Normal file
|
@ -0,0 +1,17 @@
|
|||
include/master-slave.inc
|
||||
[connection master]
|
||||
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
|
||||
call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occured on the master. .*");
|
||||
SET GLOBAL max_binlog_cache_size = 4096;
|
||||
SET GLOBAL binlog_cache_size = 4096;
|
||||
SET GLOBAL max_binlog_stmt_cache_size = 4096;
|
||||
SET GLOBAL binlog_stmt_cache_size = 4096;
|
||||
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MYISAM;
|
||||
ERROR HY000: Writing one row to the row-based binary log failed
|
||||
include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
|
||||
SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
|
||||
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
|
||||
SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
|
||||
SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
|
||||
DROP TABLE t1;
|
||||
include/rpl_end.inc
|
1
mysql-test/suite/rpl/t/rpl_mdev-11092.opt
Normal file
1
mysql-test/suite/rpl/t/rpl_mdev-11092.opt
Normal file
|
@ -0,0 +1 @@
|
|||
--binlog_checksum=1 --binlog-annotate-row-events=1
|
53
mysql-test/suite/rpl/t/rpl_mdev-11092.test
Normal file
53
mysql-test/suite/rpl/t/rpl_mdev-11092.test
Normal file
|
@ -0,0 +1,53 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/master-slave.inc
|
||||
--source include/not_embedded.inc
|
||||
--source include/not_windows.inc
|
||||
--source include/have_binlog_format_row.inc
|
||||
|
||||
########################################################################################
|
||||
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
|
||||
call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occured on the master. .*");
|
||||
|
||||
let $old_max_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_cache_size", Value, 1);
|
||||
let $old_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_cache_size", Value, 1);
|
||||
let $old_max_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_stmt_cache_size", Value, 1);
|
||||
let $old_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_stmt_cache_size", Value, 1);
|
||||
|
||||
SET GLOBAL max_binlog_cache_size = 4096;
|
||||
SET GLOBAL binlog_cache_size = 4096;
|
||||
SET GLOBAL max_binlog_stmt_cache_size = 4096;
|
||||
SET GLOBAL binlog_stmt_cache_size = 4096;
|
||||
disconnect master;
|
||||
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
||||
|
||||
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MYISAM;
|
||||
|
||||
let $data = `select concat('"', repeat('a',2000), '"')`;
|
||||
|
||||
connection master;
|
||||
|
||||
--disable_query_log
|
||||
--error ER_BINLOG_ROW_LOGGING_FAILED
|
||||
eval INSERT INTO t1 (a, data) VALUES (2,
|
||||
CONCAT($data, $data, $data, $data, $data, $data));
|
||||
--enable_query_log
|
||||
|
||||
# Incident event
|
||||
# 1590=ER_SLAVE_INCIDENT
|
||||
--let $slave_sql_errno= 1590
|
||||
--source include/wait_for_slave_sql_error_and_skip.inc
|
||||
|
||||
connection master;
|
||||
|
||||
--replace_result $old_max_binlog_cache_size ORIGINAL_VALUE
|
||||
--eval SET GLOBAL max_binlog_cache_size= $old_max_binlog_cache_size
|
||||
--replace_result $old_binlog_cache_size ORIGINAL_VALUE
|
||||
--eval SET GLOBAL binlog_cache_size= $old_binlog_cache_size
|
||||
--replace_result $old_max_binlog_stmt_cache_size ORIGINAL_VALUE
|
||||
--eval SET GLOBAL max_binlog_stmt_cache_size= $old_max_binlog_stmt_cache_size
|
||||
--replace_result $old_binlog_stmt_cache_size ORIGINAL_VALUE
|
||||
--eval SET GLOBAL binlog_stmt_cache_size= $old_binlog_stmt_cache_size
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--source include/rpl_end.inc
|
|
@ -1911,6 +1911,26 @@ explain select * from v1;
|
|||
drop view v1;
|
||||
drop table t1,t2;
|
||||
|
||||
--echo #
|
||||
--echo # Bug mdev-12812: mergeable derived / view with subqueries
|
||||
--echo # NOT subject to semi-join optimizations
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (c1 varchar(3)) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES ('foo'),('foo');
|
||||
|
||||
CREATE TABLE t2 (c2 varchar(3)) ENGINE=MyISAM;
|
||||
INSERT INTO t2 VALUES ('bar'),('qux'),('foo');
|
||||
|
||||
let $q=
|
||||
SELECT STRAIGHT_JOIN *
|
||||
FROM ( SELECT * FROM t1 WHERE c1 IN ( SELECT c2 FROM t2 ) ) AS sq;
|
||||
|
||||
eval $q;
|
||||
eval EXPLAIN EXTENDED $q;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
# The following command must be the last one the file
|
||||
set optimizer_switch=@exit_optimizer_switch;
|
||||
set join_cache_level=@exit_join_cache_level;
|
||||
|
|
|
@ -2805,5 +2805,45 @@ select a from t1 join t2 on b between 1 and 2 and a in (select b from t2);
|
|||
drop table t1,t2;
|
||||
set optimizer_switch= @tmp_mdev12675;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-12817: subquery NOT subject to semi-join optimizations
|
||||
--echo # in ON expression of INNER JOIN
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (c1 int) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
|
||||
CREATE TABLE t2 (c2 int) ENGINE=MyISAM;
|
||||
INSERT INTO t2 VALUES (3),(4);
|
||||
|
||||
CREATE TABLE t3 (c3 int) ENGINE=MyISAM;
|
||||
INSERT INTO t3 VALUES (5),(6);
|
||||
|
||||
CREATE TABLE t4 (c4 int) ENGINE=MyISAM;
|
||||
INSERT INTO t4 VALUES (7),(8);
|
||||
|
||||
let $q1=
|
||||
SELECT c1
|
||||
FROM t1
|
||||
LEFT JOIN
|
||||
( t2 INNER JOIN t3 ON ( 1 IN ( SELECT c4 FROM t4 ) ) )
|
||||
ON (c1 = c3);
|
||||
|
||||
eval $q1;
|
||||
eval EXPLAIN EXTENDED $q1;
|
||||
|
||||
let $q2=
|
||||
SELECT *
|
||||
FROM t1
|
||||
LEFT JOIN
|
||||
( ( SELECT * FROM t2 WHERE c2 IN ( SELECT c3 FROM t3 ) ) AS sq INNER JOIN t4 )
|
||||
ON (c1 = c2);
|
||||
|
||||
--echo # mdev-12820
|
||||
eval $q2;
|
||||
eval EXPLAIN EXTENDED $q2;
|
||||
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
|
||||
# The following command must be the last one the file
|
||||
set optimizer_switch=@subselect_sj_tmp;
|
||||
|
|
|
@ -550,7 +550,10 @@ static int initialize_bucket(LF_HASH *hash, LF_SLIST * volatile *node,
|
|||
return -1;
|
||||
if (*el == NULL && bucket &&
|
||||
unlikely(initialize_bucket(hash, el, parent, pins)))
|
||||
{
|
||||
my_free(dummy);
|
||||
return -1;
|
||||
}
|
||||
dummy->hashnr= my_reverse_bits(bucket) | 0; /* dummy node */
|
||||
dummy->key= dummy_key;
|
||||
dummy->keylen= 0;
|
||||
|
|
|
@ -4038,6 +4038,7 @@ mariadb_dyncol_val_double(double *dbl, DYNAMIC_COLUMN_VALUE *val)
|
|||
*dbl= strtod(str, &end);
|
||||
if (*end != '\0')
|
||||
rc= ER_DYNCOL_TRUNCATED;
|
||||
free(str);
|
||||
break;
|
||||
}
|
||||
case DYN_COL_DECIMAL:
|
||||
|
|
|
@ -556,7 +556,7 @@ my_bool wt_resource_id_memcmp(const void *a, const void *b)
|
|||
{
|
||||
/* we use the fact that there's no padding in the middle of WT_RESOURCE_ID */
|
||||
compile_time_assert(offsetof(WT_RESOURCE_ID, type) == sizeof(ulonglong));
|
||||
return memcmp(a, b, sizeof_WT_RESOURCE_ID);
|
||||
return MY_TEST(memcmp(a, b, sizeof_WT_RESOURCE_ID));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -162,6 +162,7 @@ static int pam_auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
|
|||
if (new_username && strcmp(new_username, info->user_name))
|
||||
strncpy(info->authenticated_as, new_username,
|
||||
sizeof(info->authenticated_as));
|
||||
info->authenticated_as[sizeof(info->authenticated_as)-1]= 0;
|
||||
|
||||
end:
|
||||
pam_end(pamh, status);
|
||||
|
|
|
@ -205,7 +205,7 @@ static void send_report(const char *when)
|
|||
/*
|
||||
otherwise, prepare the THD and TABLE_LIST,
|
||||
create and fill the temporary table with data just like
|
||||
SELECT * FROM IFROEMATION_SCHEMA.feedback is doing,
|
||||
SELECT * FROM INFORMATION_SCHEMA.FEEDBACK is doing,
|
||||
read and concatenate table data into a String.
|
||||
*/
|
||||
if (!(thd= new THD()))
|
||||
|
|
|
@ -1041,6 +1041,7 @@ static int start_logging()
|
|||
error_header();
|
||||
fprintf(stderr, "logging started to the file %s.\n", alt_fname);
|
||||
strncpy(current_log_buf, alt_fname, sizeof(current_log_buf));
|
||||
current_log_buf[sizeof(current_log_buf)-1]= 0;
|
||||
}
|
||||
else if (output_type == OUTPUT_SYSLOG)
|
||||
{
|
||||
|
@ -2570,6 +2571,7 @@ static void update_file_path(MYSQL_THD thd,
|
|||
}
|
||||
|
||||
strncpy(path_buffer, new_name, sizeof(path_buffer));
|
||||
path_buffer[sizeof(path_buffer)-1]= 0;
|
||||
file_path= path_buffer;
|
||||
exit_func:
|
||||
internal_stop_logging= 0;
|
||||
|
@ -2622,6 +2624,7 @@ static void update_incl_users(MYSQL_THD thd,
|
|||
flogger_mutex_lock(&lock_operations);
|
||||
mark_always_logged(thd);
|
||||
strncpy(incl_user_buffer, new_users, sizeof(incl_user_buffer));
|
||||
incl_user_buffer[sizeof(incl_user_buffer)-1]= 0;
|
||||
incl_users= incl_user_buffer;
|
||||
user_coll_fill(&incl_user_coll, incl_users, &excl_user_coll, 1);
|
||||
error_header();
|
||||
|
@ -2640,6 +2643,7 @@ static void update_excl_users(MYSQL_THD thd __attribute__((unused)),
|
|||
flogger_mutex_lock(&lock_operations);
|
||||
mark_always_logged(thd);
|
||||
strncpy(excl_user_buffer, new_users, sizeof(excl_user_buffer));
|
||||
excl_user_buffer[sizeof(excl_user_buffer)-1]= 0;
|
||||
excl_users= excl_user_buffer;
|
||||
user_coll_fill(&excl_user_coll, excl_users, &incl_user_coll, 0);
|
||||
error_header();
|
||||
|
@ -2771,6 +2775,7 @@ static void update_syslog_ident(MYSQL_THD thd __attribute__((unused)),
|
|||
{
|
||||
char *new_ident= (*(char **) save) ? *(char **) save : empty_str;
|
||||
strncpy(syslog_ident_buffer, new_ident, sizeof(syslog_ident_buffer));
|
||||
syslog_ident_buffer[sizeof(syslog_ident_buffer)-1]= 0;
|
||||
syslog_ident= syslog_ident_buffer;
|
||||
error_header();
|
||||
fprintf(stderr, "SYSYLOG ident was changed to '%s'\n", syslog_ident);
|
||||
|
|
|
@ -375,8 +375,7 @@ mysql_load_plugin_v(MYSQL *mysql, const char *name, int type,
|
|||
if (!(sym= dlsym(dlhandle, plugin_declarations_sym)))
|
||||
{
|
||||
errmsg= "not a plugin";
|
||||
(void)dlclose(dlhandle);
|
||||
goto err;
|
||||
goto errc;
|
||||
}
|
||||
|
||||
plugin= (struct st_mysql_client_plugin*)sym;
|
||||
|
@ -384,19 +383,19 @@ mysql_load_plugin_v(MYSQL *mysql, const char *name, int type,
|
|||
if (type >=0 && type != plugin->type)
|
||||
{
|
||||
errmsg= "type mismatch";
|
||||
goto err;
|
||||
goto errc;
|
||||
}
|
||||
|
||||
if (strcmp(name, plugin->name))
|
||||
{
|
||||
errmsg= "name mismatch";
|
||||
goto err;
|
||||
goto errc;
|
||||
}
|
||||
|
||||
if (type < 0 && find_plugin(name, plugin->type))
|
||||
{
|
||||
errmsg= "it is already loaded";
|
||||
goto err;
|
||||
goto errc;
|
||||
}
|
||||
|
||||
plugin= add_plugin(mysql, plugin, dlhandle, argc, args);
|
||||
|
@ -406,6 +405,8 @@ mysql_load_plugin_v(MYSQL *mysql, const char *name, int type,
|
|||
DBUG_PRINT ("leave", ("plugin loaded ok"));
|
||||
DBUG_RETURN (plugin);
|
||||
|
||||
errc:
|
||||
dlclose(dlhandle);
|
||||
err:
|
||||
mysql_mutex_unlock(&LOCK_load_client_plugin);
|
||||
DBUG_PRINT ("leave", ("plugin load error : %s", errmsg));
|
||||
|
|
|
@ -89,7 +89,6 @@ int readfrm(const char *name, const uchar **frmdata, size_t *len)
|
|||
error= 0;
|
||||
|
||||
err:
|
||||
if (file > 0)
|
||||
(void) mysql_file_close(file, MYF(MY_WME));
|
||||
|
||||
err_end: /* Here when no file */
|
||||
|
|
|
@ -925,6 +925,7 @@ write_keys(Sort_param *param, Filesort_info *fs_info, uint count,
|
|||
/* check we won't have more buffpeks than we can possibly keep in memory */
|
||||
if (my_b_tell(buffpek_pointers) + sizeof(BUFFPEK) > (ulonglong)UINT_MAX)
|
||||
goto err;
|
||||
bzero(&buffpek, sizeof(buffpek));
|
||||
buffpek.file_pos= my_b_tell(tempfile);
|
||||
if ((ha_rows) count > param->max_rows)
|
||||
count=(uint) param->max_rows; /* purecov: inspected */
|
||||
|
|
|
@ -5640,14 +5640,21 @@ int THD::binlog_write_table_map(TABLE *table, bool is_transactional,
|
|||
IO_CACHE *file=
|
||||
cache_mngr->get_binlog_cache_log(use_trans_cache(this, is_transactional));
|
||||
Log_event_writer writer(file);
|
||||
binlog_cache_data *cache_data=
|
||||
cache_mngr->get_binlog_cache_data(use_trans_cache(this, is_transactional));
|
||||
|
||||
if (with_annotate && *with_annotate)
|
||||
{
|
||||
Annotate_rows_log_event anno(table->in_use, is_transactional, false);
|
||||
/* Annotate event should be written not more than once */
|
||||
*with_annotate= 0;
|
||||
if ((error= writer.write(&anno)))
|
||||
{
|
||||
if (my_errno == EFBIG)
|
||||
cache_data->set_incident();
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
}
|
||||
if ((error= writer.write(&the_event)))
|
||||
DBUG_RETURN(error);
|
||||
|
||||
|
|
|
@ -8174,7 +8174,7 @@ static int show_default_keycache(THD *thd, SHOW_VAR *var, char *buff,
|
|||
{
|
||||
struct st_data {
|
||||
KEY_CACHE_STATISTICS stats;
|
||||
SHOW_VAR var[8];
|
||||
SHOW_VAR var[9];
|
||||
} *data;
|
||||
SHOW_VAR *v;
|
||||
|
||||
|
|
|
@ -6967,8 +6967,11 @@ QUICK_SELECT_I *TRP_ROR_UNION::make_quick(PARAM *param,
|
|||
{
|
||||
if (!(quick= (*scan)->make_quick(param, FALSE, &quick_roru->alloc)) ||
|
||||
quick_roru->push_quick_back(quick))
|
||||
{
|
||||
delete quick_roru;
|
||||
DBUG_RETURN(NULL);
|
||||
}
|
||||
}
|
||||
quick_roru->records= records;
|
||||
quick_roru->read_time= read_cost;
|
||||
}
|
||||
|
@ -10567,9 +10570,7 @@ QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
|
|||
*/
|
||||
thd->mem_root= old_root;
|
||||
|
||||
if (!quick || create_err)
|
||||
return 0; /* no ranges found */
|
||||
if (quick->init())
|
||||
if (!quick || create_err || quick->init())
|
||||
goto err;
|
||||
quick->records= records;
|
||||
|
||||
|
|
|
@ -1105,7 +1105,26 @@ bool convert_join_subqueries_to_semijoins(JOIN *join)
|
|||
do
|
||||
{
|
||||
embedded= embedding;
|
||||
if (MY_TEST(embedded->outer_join))
|
||||
bool block_conversion_to_sj= false;
|
||||
if (embedded->on_expr)
|
||||
{
|
||||
/*
|
||||
Conversion of an IN subquery predicate into semi-join
|
||||
is blocked now if the predicate occurs:
|
||||
- in the ON expression of an outer join
|
||||
- in the ON expression of an inner join embedded directly
|
||||
or indirectly in the inner nest of an outer join
|
||||
*/
|
||||
for (TABLE_LIST *tl= embedded; tl; tl= tl->embedding)
|
||||
{
|
||||
if (tl->outer_join)
|
||||
{
|
||||
block_conversion_to_sj= true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (block_conversion_to_sj)
|
||||
{
|
||||
Item *cond= embedded->on_expr;
|
||||
if (!cond)
|
||||
|
@ -1145,6 +1164,16 @@ bool convert_join_subqueries_to_semijoins(JOIN *join)
|
|||
}
|
||||
}
|
||||
|
||||
if (join->select_options & SELECT_STRAIGHT_JOIN)
|
||||
{
|
||||
/* Block conversion to semijoins for all candidates */
|
||||
li.rewind();
|
||||
while ((in_subq= li++))
|
||||
{
|
||||
in_subq->block_conversion_to_sj();
|
||||
}
|
||||
}
|
||||
|
||||
li.rewind();
|
||||
/* First, convert child join's subqueries. We proceed bottom-up here */
|
||||
while ((in_subq= li++))
|
||||
|
|
|
@ -69,7 +69,7 @@ static int rr_index_desc(READ_RECORD *info);
|
|||
bool init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
|
||||
bool print_error, uint idx, bool reverse)
|
||||
{
|
||||
int error;
|
||||
int error= 0;
|
||||
DBUG_ENTER("init_read_record_idx");
|
||||
|
||||
empty_record(table);
|
||||
|
|
|
@ -3306,7 +3306,7 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length)
|
|||
{
|
||||
stmt->state= Query_arena::STMT_ERROR;
|
||||
stmt->last_errno= thd->get_stmt_da()->sql_errno();
|
||||
strncpy(stmt->last_error, thd->get_stmt_da()->message(), MYSQL_ERRMSG_SIZE);
|
||||
strmake_buf(stmt->last_error, thd->get_stmt_da()->message());
|
||||
}
|
||||
thd->set_stmt_da(save_stmt_da);
|
||||
|
||||
|
|
|
@ -3918,9 +3918,6 @@ bool mysql_show_binlog_events(THD* thd)
|
|||
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
|
||||
DBUG_RETURN(TRUE);
|
||||
|
||||
Format_description_log_event *description_event= new
|
||||
Format_description_log_event(3); /* MySQL 4.0 by default */
|
||||
|
||||
DBUG_ASSERT(thd->lex->sql_command == SQLCOM_SHOW_BINLOG_EVENTS ||
|
||||
thd->lex->sql_command == SQLCOM_SHOW_RELAYLOG_EVENTS);
|
||||
|
||||
|
@ -3941,6 +3938,9 @@ bool mysql_show_binlog_events(THD* thd)
|
|||
binary_log= &(mi->rli.relay_log);
|
||||
}
|
||||
|
||||
Format_description_log_event *description_event= new
|
||||
Format_description_log_event(3); /* MySQL 4.0 by default */
|
||||
|
||||
if (binary_log->is_open())
|
||||
{
|
||||
SELECT_LEX_UNIT *unit= &thd->lex->unit;
|
||||
|
|
|
@ -3222,7 +3222,7 @@ static bool show_status_array(THD *thd, const char *wild,
|
|||
|
||||
for (; variables->name; variables++)
|
||||
{
|
||||
bool wild_checked;
|
||||
bool wild_checked= 0;
|
||||
strnmov(prefix_end, variables->name, len);
|
||||
name_buffer[sizeof(name_buffer)-1]=0; /* Safety */
|
||||
|
||||
|
|
|
@ -1719,7 +1719,10 @@ Sys_var_gtid_binlog_state::do_check(THD *thd, set_var *var)
|
|||
return true;
|
||||
}
|
||||
if (res->length() == 0)
|
||||
{
|
||||
list= NULL;
|
||||
list_len= 0;
|
||||
}
|
||||
else if (!(list= gtid_parse_string_to_list(res->ptr(), res->length(),
|
||||
&list_len)))
|
||||
{
|
||||
|
|
|
@ -986,7 +986,7 @@ PSZ ARRAY::MakeArrayList(PGLOBAL g)
|
|||
|
||||
for (i = 0; i < Nval; i++) {
|
||||
Value->SetValue_pvblk(Vblp, i);
|
||||
Value->Print(g, tp, z);
|
||||
Value->Prints(g, tp, z);
|
||||
len += strlen(tp);
|
||||
} // enfor i
|
||||
|
||||
|
@ -998,7 +998,7 @@ PSZ ARRAY::MakeArrayList(PGLOBAL g)
|
|||
|
||||
for (i = 0; i < Nval;) {
|
||||
Value->SetValue_pvblk(Vblp, i);
|
||||
Value->Print(g, tp, z);
|
||||
Value->Prints(g, tp, z);
|
||||
strcat(p, tp);
|
||||
strcat(p, (++i == Nval) ? ")" : ",");
|
||||
} // enfor i
|
||||
|
@ -1012,7 +1012,7 @@ PSZ ARRAY::MakeArrayList(PGLOBAL g)
|
|||
/***********************************************************************/
|
||||
/* Make file output of ARRAY contents. */
|
||||
/***********************************************************************/
|
||||
void ARRAY::Print(PGLOBAL g, FILE *f, uint n)
|
||||
void ARRAY::Printf(PGLOBAL g, FILE *f, uint n)
|
||||
{
|
||||
char m[64];
|
||||
int lim = MY_MIN(Nval,10);
|
||||
|
@ -1029,7 +1029,7 @@ void ARRAY::Print(PGLOBAL g, FILE *f, uint n)
|
|||
if (Vblp)
|
||||
for (int i = 0; i < lim; i++) {
|
||||
Value->SetValue_pvblk(Vblp, i);
|
||||
Value->Print(g, f, n+4);
|
||||
Value->Printf(g, f, n+4);
|
||||
} // endfor i
|
||||
|
||||
} else
|
||||
|
@ -1040,7 +1040,7 @@ void ARRAY::Print(PGLOBAL g, FILE *f, uint n)
|
|||
/***********************************************************************/
|
||||
/* Make string output of ARRAY contents. */
|
||||
/***********************************************************************/
|
||||
void ARRAY::Print(PGLOBAL, char *ps, uint z)
|
||||
void ARRAY::Prints(PGLOBAL, char *ps, uint z)
|
||||
{
|
||||
if (z < 16)
|
||||
return;
|
||||
|
|
|
@ -56,8 +56,8 @@ class DllExport ARRAY : public XOBJECT, public CSORT { // Array descblock
|
|||
virtual bool Compare(PXOB) {assert(false); return false;}
|
||||
virtual bool SetFormat(PGLOBAL, FORMAT&) {assert(false); return false;}
|
||||
//virtual int CheckSpcCol(PTDB, int) {return 0;}
|
||||
virtual void Print(PGLOBAL g, FILE *f, uint n);
|
||||
virtual void Print(PGLOBAL g, char *ps, uint z);
|
||||
virtual void Printf(PGLOBAL g, FILE *f, uint n);
|
||||
virtual void Prints(PGLOBAL g, char *ps, uint z);
|
||||
// void Empty(void);
|
||||
void SetPrecision(PGLOBAL g, int p);
|
||||
bool AddValue(PGLOBAL g, PSZ sp);
|
||||
|
|
|
@ -56,7 +56,7 @@ BLOCKFILTER::BLOCKFILTER(PTDBDOS tdbp, int op)
|
|||
/***********************************************************************/
|
||||
/* Make file output of BLOCKFILTER contents. */
|
||||
/***********************************************************************/
|
||||
void BLOCKFILTER::Print(PGLOBAL, FILE *f, uint n)
|
||||
void BLOCKFILTER::Printf(PGLOBAL, FILE *f, uint n)
|
||||
{
|
||||
char m[64];
|
||||
|
||||
|
@ -70,7 +70,7 @@ void BLOCKFILTER::Print(PGLOBAL, FILE *f, uint n)
|
|||
/***********************************************************************/
|
||||
/* Make string output of BLOCKFILTER contents. */
|
||||
/***********************************************************************/
|
||||
void BLOCKFILTER::Print(PGLOBAL, char *ps, uint z)
|
||||
void BLOCKFILTER::Prints(PGLOBAL, char *ps, uint z)
|
||||
{
|
||||
strncat(ps, "BlockFilter(s)", z);
|
||||
} // end of Print
|
||||
|
@ -995,7 +995,7 @@ int BLOCKINDEX::BlockEval(PGLOBAL g)
|
|||
/***********************************************************************/
|
||||
/* Make file output of BLOCKINDEX contents. */
|
||||
/***********************************************************************/
|
||||
void BLOCKINDEX::Print(PGLOBAL g, FILE *f, UINT n)
|
||||
void BLOCKINDEX::Printf(PGLOBAL g, FILE *f, UINT n)
|
||||
{
|
||||
char m[64];
|
||||
|
||||
|
@ -1013,7 +1013,7 @@ void BLOCKINDEX::Print(PGLOBAL g, FILE *f, UINT n)
|
|||
/***********************************************************************/
|
||||
/* Make string output of BLOCKINDEX contents. */
|
||||
/***********************************************************************/
|
||||
void BLOCKINDEX::Print(PGLOBAL g, char *ps, UINT z)
|
||||
void BLOCKINDEX::Prints(PGLOBAL g, char *ps, UINT z)
|
||||
{
|
||||
strncat(ps, "BlockIndex(es)", z);
|
||||
} // end of Print
|
||||
|
|
|
@ -27,8 +27,8 @@ class DllExport BLOCKFILTER : public BLOCK { /* Block Filter */
|
|||
// Methods
|
||||
virtual void Reset(PGLOBAL) = 0;
|
||||
virtual int BlockEval(PGLOBAL) = 0;
|
||||
virtual void Print(PGLOBAL g, FILE *f, uint n);
|
||||
virtual void Print(PGLOBAL g, char *ps, uint z);
|
||||
virtual void Printf(PGLOBAL g, FILE *f, uint n);
|
||||
virtual void Prints(PGLOBAL g, char *ps, uint z);
|
||||
|
||||
protected:
|
||||
BLOCKFILTER(void) {} // Standard constructor not to be used
|
||||
|
@ -234,8 +234,8 @@ class DllExport BLOCKINDEX : public BLOCK { /* Indexing Test Block */
|
|||
// Methods
|
||||
void Reset(void);
|
||||
virtual int BlockEval(PGLOBAL);
|
||||
virtual void Print(PGLOBAL g, FILE *f, UINT n);
|
||||
virtual void Print(PGLOBAL g, char *ps, UINT z);
|
||||
virtual void Printf(PGLOBAL g, FILE *f, UINT n);
|
||||
virtual void Prints(PGLOBAL g, char *ps, UINT z);
|
||||
|
||||
protected:
|
||||
BLOCKINDEX(void) {} // Standard constructor not to be used
|
||||
|
|
|
@ -44,8 +44,8 @@ class DllExport BLOCK {
|
|||
return (PlugSubAlloc(g, p, size));
|
||||
} // end of new
|
||||
|
||||
virtual void Print(PGLOBAL, FILE *, uint) {} // Produce file desc
|
||||
virtual void Print(PGLOBAL, char *, uint) {} // Produce string desc
|
||||
virtual void Printf(PGLOBAL, FILE *, uint) {} // Produce file desc
|
||||
virtual void Prints(PGLOBAL, char *, uint) {} // Produce string desc
|
||||
|
||||
#if !defined(__BORLANDC__)
|
||||
// Avoid warning C4291 by defining a matching dummy delete operator
|
||||
|
|
|
@ -214,7 +214,7 @@ void COLBLK::WriteColumn(PGLOBAL g)
|
|||
/***********************************************************************/
|
||||
/* Make file output of a column descriptor block. */
|
||||
/***********************************************************************/
|
||||
void COLBLK::Print(PGLOBAL, FILE *f, uint n)
|
||||
void COLBLK::Printf(PGLOBAL, FILE *f, uint n)
|
||||
{
|
||||
char m[64];
|
||||
int i;
|
||||
|
@ -237,7 +237,7 @@ void COLBLK::Print(PGLOBAL, FILE *f, uint n)
|
|||
/***********************************************************************/
|
||||
/* Make string output of a column descriptor block. */
|
||||
/***********************************************************************/
|
||||
void COLBLK::Print(PGLOBAL, char *ps, uint)
|
||||
void COLBLK::Prints(PGLOBAL, char *ps, uint)
|
||||
{
|
||||
sprintf(ps, "R%d.%s", To_Tdb->GetTdb_No(), Name);
|
||||
} // end of Print
|
||||
|
|
|
@ -72,8 +72,8 @@ class DllExport COLBLK : public XOBJECT {
|
|||
virtual void SetTo_Val(PVAL) {}
|
||||
virtual void ReadColumn(PGLOBAL g);
|
||||
virtual void WriteColumn(PGLOBAL g);
|
||||
virtual void Print(PGLOBAL g, FILE *, uint);
|
||||
virtual void Print(PGLOBAL g, char *, uint);
|
||||
virtual void Printf(PGLOBAL g, FILE *, uint);
|
||||
virtual void Prints(PGLOBAL g, char *, uint);
|
||||
virtual bool VarSize(void) {return false;}
|
||||
bool InitValue(PGLOBAL g);
|
||||
|
||||
|
|
|
@ -49,8 +49,8 @@ class DllExport CSORT {
|
|||
public:
|
||||
// Methods
|
||||
int Qsort(PGLOBAL g, int n); /* Sort calling routine */
|
||||
//virtual void Print(PGLOBAL g, FILE *f, uint n);
|
||||
//virtual void Print(PGLOBAL g, char *ps, uint z);
|
||||
//virtual void Printf(PGLOBAL g, FILE *f, uint n);
|
||||
//virtual void Prints(PGLOBAL g, char *ps, uint z);
|
||||
#ifdef DEBTRACE
|
||||
int GetNcmp(void) {return num_comp;}
|
||||
#endif
|
||||
|
|
|
@ -569,7 +569,6 @@ bool VCTFAM::InitInsert(PGLOBAL g)
|
|||
CurNum = 0;
|
||||
AddBlock = !MaxBlk;
|
||||
} else {
|
||||
int rc;
|
||||
PVCTCOL cp = (PVCTCOL)Tdbp->GetColumns();
|
||||
|
||||
// The starting point must be at the end of file as for append.
|
||||
|
|
|
@ -1409,7 +1409,7 @@ PFIL FILTER::Copy(PTABS t)
|
|||
/*********************************************************************/
|
||||
/* Make file output of FILTER contents. */
|
||||
/*********************************************************************/
|
||||
void FILTER::Print(PGLOBAL g, FILE *f, uint n)
|
||||
void FILTER::Printf(PGLOBAL g, FILE *f, uint n)
|
||||
{
|
||||
char m[64];
|
||||
|
||||
|
@ -1431,7 +1431,7 @@ void FILTER::Print(PGLOBAL g, FILE *f, uint n)
|
|||
if (lin && fp->GetArgType(i) == TYPE_FILTER)
|
||||
fprintf(f, "%s Filter at %p\n", m, fp->Arg(i));
|
||||
else
|
||||
fp->Arg(i)->Print(g, f, n + 2);
|
||||
fp->Arg(i)->Printf(g, f, n + 2);
|
||||
|
||||
} // endfor i
|
||||
|
||||
|
@ -1442,7 +1442,7 @@ void FILTER::Print(PGLOBAL g, FILE *f, uint n)
|
|||
/***********************************************************************/
|
||||
/* Make string output of TABLE contents (z should be checked). */
|
||||
/***********************************************************************/
|
||||
void FILTER::Print(PGLOBAL g, char *ps, uint z)
|
||||
void FILTER::Prints(PGLOBAL g, char *ps, uint z)
|
||||
{
|
||||
#define FLEN 100
|
||||
|
||||
|
@ -1470,7 +1470,7 @@ void FILTER::Print(PGLOBAL g, char *ps, uint z)
|
|||
bcp = bxp;
|
||||
p = bcp->Cold;
|
||||
n = FLEN;
|
||||
fp->Arg(0)->Print(g, p, n);
|
||||
fp->Arg(0)->Prints(g, p, n);
|
||||
n = FLEN - strlen(p);
|
||||
|
||||
switch (fp->Opc) {
|
||||
|
@ -1516,7 +1516,7 @@ void FILTER::Print(PGLOBAL g, char *ps, uint z)
|
|||
|
||||
n = FLEN - strlen(p);
|
||||
p += strlen(p);
|
||||
fp->Arg(1)->Print(g, p, n);
|
||||
fp->Arg(1)->Prints(g, p, n);
|
||||
} else
|
||||
if (!bcp) {
|
||||
strncat(ps, "???", z);
|
||||
|
|
|
@ -61,8 +61,8 @@ class DllExport FILTER : public XOBJECT { /* Filter description block */
|
|||
//virtual PXOB CheckSubQuery(PGLOBAL, PSQL);
|
||||
//virtual bool CheckLocal(PTDB);
|
||||
//virtual int CheckSpcCol(PTDB tdbp, int n);
|
||||
virtual void Print(PGLOBAL g, FILE *f, uint n);
|
||||
virtual void Print(PGLOBAL g, char *ps, uint z);
|
||||
virtual void Printf(PGLOBAL g, FILE *f, uint n);
|
||||
virtual void Prints(PGLOBAL g, char *ps, uint z);
|
||||
// PFIL Linearize(bool nosep);
|
||||
// PFIL Link(PGLOBAL g, PFIL fil2);
|
||||
// PFIL RemoveLastSep(void);
|
||||
|
|
|
@ -1492,7 +1492,7 @@ void PlugPutOut(PGLOBAL g, FILE *f, short t, void *v, uint n)
|
|||
case TYPE_TABLE:
|
||||
case TYPE_TDB:
|
||||
case TYPE_XOBJECT:
|
||||
((PBLOCK)v)->Print(g, f, n-2);
|
||||
((PBLOCK)v)->Printf(g, f, n-2);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -73,7 +73,7 @@ PTABLE XTAB::Link(PTABLE tab2)
|
|||
/***********************************************************************/
|
||||
/* Make file output of XTAB contents. */
|
||||
/***********************************************************************/
|
||||
void XTAB::Print(PGLOBAL g, FILE *f, uint n)
|
||||
void XTAB::Printf(PGLOBAL g, FILE *f, uint n)
|
||||
{
|
||||
char m[64];
|
||||
|
||||
|
@ -91,7 +91,7 @@ void XTAB::Print(PGLOBAL g, FILE *f, uint n)
|
|||
/***********************************************************************/
|
||||
/* Make string output of XTAB contents. */
|
||||
/***********************************************************************/
|
||||
void XTAB::Print(PGLOBAL, char *ps, uint z)
|
||||
void XTAB::Prints(PGLOBAL, char *ps, uint z)
|
||||
{
|
||||
char buf[128];
|
||||
int i, n = (int)z - 1;
|
||||
|
@ -134,7 +134,7 @@ bool COLUMN::SetFormat(PGLOBAL g, FORMAT&)
|
|||
/***********************************************************************/
|
||||
/* Make file output of COLUMN contents. */
|
||||
/***********************************************************************/
|
||||
void COLUMN::Print(PGLOBAL g, FILE *f, uint n)
|
||||
void COLUMN::Printf(PGLOBAL g, FILE *f, uint n)
|
||||
{
|
||||
char m[64];
|
||||
|
||||
|
@ -154,7 +154,7 @@ void COLUMN::Print(PGLOBAL g, FILE *f, uint n)
|
|||
/***********************************************************************/
|
||||
/* Make string output of COLUMN contents. */
|
||||
/***********************************************************************/
|
||||
void COLUMN::Print(PGLOBAL, char *ps, uint z)
|
||||
void COLUMN::Prints(PGLOBAL, char *ps, uint z)
|
||||
{
|
||||
char buf[80];
|
||||
|
||||
|
|
|
@ -38,8 +38,8 @@ class DllExport XTAB: public BLOCK { // Table Name-Schema-Srcdef block.
|
|||
|
||||
// Methods
|
||||
PTABLE Link(PTABLE);
|
||||
void Print(PGLOBAL g, FILE *f, uint n);
|
||||
void Print(PGLOBAL g, char *ps, uint z);
|
||||
void Printf(PGLOBAL g, FILE *f, uint n);
|
||||
void Prints(PGLOBAL g, char *ps, uint z);
|
||||
|
||||
protected:
|
||||
// Members
|
||||
|
@ -78,8 +78,8 @@ class DllExport COLUMN: public XOBJECT { // Column Name/Qualifier block.
|
|||
void SetTo_Col(PCOL colp) {To_Col = colp;}
|
||||
|
||||
// Methods
|
||||
virtual void Print(PGLOBAL g, FILE *f, uint n);
|
||||
virtual void Print(PGLOBAL g, char *ps, uint z);
|
||||
virtual void Printf(PGLOBAL g, FILE *f, uint n);
|
||||
virtual void Prints(PGLOBAL g, char *ps, uint z);
|
||||
// All methods below should never be used for COLUMN's
|
||||
virtual void Reset(void) {assert(false);}
|
||||
virtual bool Compare(PXOB) {assert(false); return false;}
|
||||
|
|
|
@ -2871,9 +2871,9 @@ bool DOSCOL::AddDistinctValue(PGLOBAL g)
|
|||
/***********************************************************************/
|
||||
/* Make file output of a Dos column descriptor block. */
|
||||
/***********************************************************************/
|
||||
void DOSCOL::Print(PGLOBAL g, FILE *f, uint n)
|
||||
void DOSCOL::Printf(PGLOBAL g, FILE *f, uint n)
|
||||
{
|
||||
COLBLK::Print(g, f, n);
|
||||
COLBLK::Printf(g, f, n);
|
||||
} // end of Print
|
||||
|
||||
/* ------------------------------------------------------------------- */
|
||||
|
|
|
@ -232,12 +232,12 @@ class DllExport DOSCOL : public COLBLK {
|
|||
virtual PVBLK GetDval(void) {return Dval;}
|
||||
|
||||
// Methods
|
||||
using COLBLK::Print;
|
||||
//using COLBLK::Print;
|
||||
virtual bool VarSize(void);
|
||||
virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check);
|
||||
virtual void ReadColumn(PGLOBAL g);
|
||||
virtual void WriteColumn(PGLOBAL g);
|
||||
virtual void Print(PGLOBAL g, FILE *, uint);
|
||||
virtual void Printf(PGLOBAL g, FILE *, uint);
|
||||
|
||||
protected:
|
||||
virtual bool SetMinMax(PGLOBAL g);
|
||||
|
|
|
@ -173,7 +173,7 @@ public:
|
|||
// Methods
|
||||
virtual void ReadColumn(PGLOBAL g);
|
||||
virtual void WriteColumn(PGLOBAL g);
|
||||
// void Print(PGLOBAL g, FILE *, uint);
|
||||
// void Printf(PGLOBAL g, FILE *, uint);
|
||||
|
||||
protected:
|
||||
// Members
|
||||
|
|
|
@ -299,7 +299,7 @@ bool TDB::SetRecpos(PGLOBAL g, int)
|
|||
return true;
|
||||
} // end of SetRecpos
|
||||
|
||||
void TDB::Print(PGLOBAL g, FILE *f, uint n)
|
||||
void TDB::Printf(PGLOBAL g, FILE *f, uint n)
|
||||
{
|
||||
PCOL cp;
|
||||
char m[64];
|
||||
|
@ -315,13 +315,13 @@ void TDB::Print(PGLOBAL g, FILE *f, uint n)
|
|||
fprintf(f, "%s Columns (deg=%d):\n", m, tp->Degree);
|
||||
|
||||
for (cp = tp->Columns; cp; cp = cp->GetNext())
|
||||
cp->Print(g, f, n);
|
||||
cp->Printf(g, f, n);
|
||||
|
||||
} /* endfor tp */
|
||||
|
||||
} // end of Print
|
||||
|
||||
void TDB::Print(PGLOBAL, char *ps, uint)
|
||||
void TDB::Prints(PGLOBAL, char *ps, uint)
|
||||
{
|
||||
sprintf(ps, "R%d.%s", Tdb_No, Name);
|
||||
} // end of Print
|
||||
|
|
|
@ -187,7 +187,7 @@ class XSRCCOL : public ODBCCOL {
|
|||
// Methods
|
||||
virtual void ReadColumn(PGLOBAL g);
|
||||
virtual void WriteColumn(PGLOBAL g);
|
||||
// void Print(PGLOBAL g, FILE *, uint);
|
||||
// void Printf(PGLOBAL g, FILE *, uint);
|
||||
|
||||
protected:
|
||||
// Members
|
||||
|
|
|
@ -62,7 +62,7 @@ class TDBINI : public TDBASE {
|
|||
virtual int GetProgCur(void) {return N;}
|
||||
//virtual int GetAffectedRows(void) {return 0;}
|
||||
virtual PCSZ GetFile(PGLOBAL g) {return Ifile;}
|
||||
virtual void SetFile(PGLOBAL g, PSZ fn) {Ifile = fn;}
|
||||
virtual void SetFile(PGLOBAL g, PCSZ fn) {Ifile = fn;}
|
||||
virtual void ResetDB(void) {Seclist = Section = NULL; N = 0;}
|
||||
virtual void ResetSize(void) {MaxSize = -1; Seclist = NULL;}
|
||||
virtual int RowNumber(PGLOBAL g, bool b = false) {return N;}
|
||||
|
@ -80,7 +80,7 @@ class TDBINI : public TDBASE {
|
|||
|
||||
protected:
|
||||
// Members
|
||||
char *Ifile; // The INI file
|
||||
PCSZ Ifile; // The INI file
|
||||
char *Seclist; // The section list
|
||||
char *Section; // The current section
|
||||
int Seclen; // Length of seclist buffer
|
||||
|
|
|
@ -75,7 +75,7 @@ class DllExport TDBXML : public TDBASE {
|
|||
virtual int GetRecpos(void);
|
||||
virtual int GetProgCur(void) {return N;}
|
||||
virtual PCSZ GetFile(PGLOBAL g) {return Xfile;}
|
||||
virtual void SetFile(PGLOBAL g, PSZ fn) {Xfile = fn;}
|
||||
virtual void SetFile(PGLOBAL g, PCSZ fn) {Xfile = fn;}
|
||||
virtual void ResetDB(void) {N = 0;}
|
||||
virtual void ResetSize(void) {MaxSize = -1;}
|
||||
virtual int RowNumber(PGLOBAL g, bool b = false);
|
||||
|
|
|
@ -561,7 +561,7 @@ bool VALUE::Compute(PGLOBAL g, PVAL *, int, OPVAL)
|
|||
/***********************************************************************/
|
||||
/* Make file output of an object value. */
|
||||
/***********************************************************************/
|
||||
void VALUE::Print(PGLOBAL g, FILE *f, uint n)
|
||||
void VALUE::Printf(PGLOBAL g, FILE *f, uint n)
|
||||
{
|
||||
char m[64], buf[64];
|
||||
|
||||
|
@ -571,14 +571,14 @@ void VALUE::Print(PGLOBAL g, FILE *f, uint n)
|
|||
if (Null)
|
||||
fprintf(f, "%s<null>\n", m);
|
||||
else
|
||||
fprintf(f, strcat(strcat(GetCharString(buf), "\n"), m));
|
||||
fprintf(f, "%s%s%s", GetCharString(buf), "\n", m);
|
||||
|
||||
} /* end of Print */
|
||||
|
||||
/***********************************************************************/
|
||||
/* Make string output of an object value. */
|
||||
/***********************************************************************/
|
||||
void VALUE::Print(PGLOBAL g, char *ps, uint z)
|
||||
void VALUE::Prints(PGLOBAL g, char *ps, uint z)
|
||||
{
|
||||
char *p, buf[64];
|
||||
|
||||
|
@ -1712,7 +1712,7 @@ bool TYPVAL<PSZ>::SetConstFormat(PGLOBAL, FORMAT& fmt)
|
|||
/***********************************************************************/
|
||||
/* Make string output of an object value. */
|
||||
/***********************************************************************/
|
||||
void TYPVAL<PSZ>::Print(PGLOBAL g, char *ps, uint z)
|
||||
void TYPVAL<PSZ>::Prints(PGLOBAL g, char *ps, uint z)
|
||||
{
|
||||
if (Null)
|
||||
strncpy(ps, "null", z);
|
||||
|
|
|
@ -122,8 +122,8 @@ class DllExport VALUE : public BLOCK {
|
|||
virtual bool IsEqual(PVAL vp, bool chktype) = 0;
|
||||
virtual bool Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op);
|
||||
virtual bool FormatValue(PVAL vp, PCSZ fmt) = 0;
|
||||
virtual void Print(PGLOBAL g, FILE *, uint);
|
||||
virtual void Print(PGLOBAL g, char *ps, uint z);
|
||||
virtual void Printf(PGLOBAL g, FILE *, uint);
|
||||
virtual void Prints(PGLOBAL g, char *ps, uint z);
|
||||
|
||||
/**
|
||||
Set value from a non-aligned in-memory value in the machine byte order.
|
||||
|
@ -308,7 +308,7 @@ class DllExport TYPVAL<PSZ>: public VALUE {
|
|||
virtual bool Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op);
|
||||
virtual bool FormatValue(PVAL vp, PCSZ fmt);
|
||||
virtual bool SetConstFormat(PGLOBAL, FORMAT&);
|
||||
virtual void Print(PGLOBAL g, char *ps, uint z);
|
||||
virtual void Prints(PGLOBAL g, char *ps, uint z);
|
||||
|
||||
protected:
|
||||
// Members
|
||||
|
|
|
@ -181,7 +181,7 @@ XXBASE::XXBASE(PTDBDOS tbxp, bool b) : CSORT(b),
|
|||
/***********************************************************************/
|
||||
/* Make file output of XINDEX contents. */
|
||||
/***********************************************************************/
|
||||
void XXBASE::Print(PGLOBAL, FILE *f, uint n)
|
||||
void XXBASE::Printf(PGLOBAL, FILE *f, uint n)
|
||||
{
|
||||
char m[64];
|
||||
|
||||
|
@ -193,7 +193,7 @@ void XXBASE::Print(PGLOBAL, FILE *f, uint n)
|
|||
/***********************************************************************/
|
||||
/* Make string output of XINDEX contents. */
|
||||
/***********************************************************************/
|
||||
void XXBASE::Print(PGLOBAL, char *ps, uint z)
|
||||
void XXBASE::Prints(PGLOBAL, char *ps, uint z)
|
||||
{
|
||||
*ps = '\0';
|
||||
strncat(ps, "Xindex", z);
|
||||
|
|
|
@ -200,8 +200,8 @@ class DllExport XXBASE : public CSORT, public BLOCK {
|
|||
void FreeIndex(void) {PlgDBfree(Index);}
|
||||
|
||||
// Methods
|
||||
virtual void Print(PGLOBAL g, FILE *f, uint n);
|
||||
virtual void Print(PGLOBAL g, char *ps, uint z);
|
||||
virtual void Printf(PGLOBAL g, FILE *f, uint n);
|
||||
virtual void Prints(PGLOBAL g, char *ps, uint z);
|
||||
virtual bool Init(PGLOBAL g) = 0;
|
||||
virtual bool Make(PGLOBAL g, PIXDEF sxp) = 0;
|
||||
#if defined(XMAP)
|
||||
|
|
|
@ -173,17 +173,17 @@ bool CONSTANT::Rephrase(PGLOBAL g, PSZ work)
|
|||
/***********************************************************************/
|
||||
/* Make file output of a constant object. */
|
||||
/***********************************************************************/
|
||||
void CONSTANT::Print(PGLOBAL g, FILE *f, uint n)
|
||||
void CONSTANT::Printf(PGLOBAL g, FILE *f, uint n)
|
||||
{
|
||||
Value->Print(g, f, n);
|
||||
Value->Printf(g, f, n);
|
||||
} /* end of Print */
|
||||
|
||||
/***********************************************************************/
|
||||
/* Make string output of a constant object. */
|
||||
/***********************************************************************/
|
||||
void CONSTANT::Print(PGLOBAL g, char *ps, uint z)
|
||||
void CONSTANT::Prints(PGLOBAL g, char *ps, uint z)
|
||||
{
|
||||
Value->Print(g, ps, z);
|
||||
Value->Prints(g, ps, z);
|
||||
} /* end of Print */
|
||||
|
||||
/* -------------------------- Class STRING --------------------------- */
|
||||
|
|
|
@ -112,8 +112,8 @@ class DllExport CONSTANT : public XOBJECT {
|
|||
{return Value->SetConstFormat(g, fmt);}
|
||||
void Convert(PGLOBAL g, int newtype);
|
||||
void SetValue(PVAL vp) {Value = vp;}
|
||||
virtual void Print(PGLOBAL g, FILE *, uint);
|
||||
virtual void Print(PGLOBAL g, char *, uint);
|
||||
virtual void Printf(PGLOBAL g, FILE *, uint);
|
||||
virtual void Prints(PGLOBAL g, char *, uint);
|
||||
}; // end of class CONSTANT
|
||||
|
||||
/***********************************************************************/
|
||||
|
|
|
@ -109,8 +109,8 @@ class DllExport TDB: public BLOCK { // Table Descriptor Block.
|
|||
virtual PTDB Copy(PTABS t);
|
||||
virtual void PrintAM(FILE *f, char *m)
|
||||
{fprintf(f, "%s AM(%d)\n", m, GetAmType());}
|
||||
virtual void Print(PGLOBAL g, FILE *f, uint n);
|
||||
virtual void Print(PGLOBAL g, char *ps, uint z);
|
||||
virtual void Printf(PGLOBAL g, FILE *f, uint n);
|
||||
virtual void Prints(PGLOBAL g, char *ps, uint z);
|
||||
virtual PCSZ GetServer(void) = 0;
|
||||
virtual int GetBadLines(void) {return 0;}
|
||||
virtual CHARSET_INFO *data_charset(void);
|
||||
|
|
|
@ -1508,13 +1508,13 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt)
|
|||
|
||||
/* Don't assert in field::val() functions */
|
||||
table->use_all_columns();
|
||||
if (!(buf= (uchar*) my_malloc(table->s->reclength, MYF(MY_WME))))
|
||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||
|
||||
/* position buffer to the start of the file */
|
||||
if (init_data_file())
|
||||
DBUG_RETURN(HA_ERR_CRASHED_ON_REPAIR);
|
||||
|
||||
if (!(buf= (uchar*) my_malloc(table->s->reclength, MYF(MY_WME))))
|
||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||
/*
|
||||
Local_saved_data_file_length is initialized during the lock phase.
|
||||
Sometimes this is not getting executed before ::repair (e.g. for
|
||||
|
@ -1598,9 +1598,9 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt)
|
|||
DBUG_RETURN(my_errno ? my_errno : -1);
|
||||
share->tina_write_opened= FALSE;
|
||||
}
|
||||
if (mysql_file_close(data_file, MYF(0)) ||
|
||||
mysql_file_close(repair_file, MYF(0)) ||
|
||||
mysql_file_rename(csv_key_file_data,
|
||||
mysql_file_close(data_file, MYF(0));
|
||||
mysql_file_close(repair_file, MYF(0));
|
||||
if (mysql_file_rename(csv_key_file_data,
|
||||
repaired_fname, share->data_file_name, MYF(0)))
|
||||
DBUG_RETURN(-1);
|
||||
|
||||
|
@ -1722,13 +1722,14 @@ int ha_tina::check(THD* thd, HA_CHECK_OPT* check_opt)
|
|||
DBUG_ENTER("ha_tina::check");
|
||||
|
||||
old_proc_info= thd_proc_info(thd, "Checking table");
|
||||
if (!(buf= (uchar*) my_malloc(table->s->reclength, MYF(MY_WME))))
|
||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||
|
||||
/* position buffer to the start of the file */
|
||||
if (init_data_file())
|
||||
DBUG_RETURN(HA_ERR_CRASHED);
|
||||
|
||||
if (!(buf= (uchar*) my_malloc(table->s->reclength, MYF(MY_WME))))
|
||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||
|
||||
/*
|
||||
Local_saved_data_file_length is initialized during the lock phase.
|
||||
Check does not use store_lock in certain cases. So, we set it
|
||||
|
|
|
@ -4220,6 +4220,7 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info,
|
|||
printf("Data records: %s\n", llstr(start_records, llbuff));
|
||||
}
|
||||
|
||||
bzero(&new_data_cache, sizeof(new_data_cache));
|
||||
if (initialize_variables_for_repair(param, &sort_info, &tmp_sort_param, info,
|
||||
rep_quick, &backup_share))
|
||||
goto err;
|
||||
|
|
|
@ -946,6 +946,7 @@ static File create_logfile_by_number_no_cache(uint32 file_no)
|
|||
{
|
||||
DBUG_PRINT("error", ("Error %d during syncing directory '%s'",
|
||||
errno, log_descriptor.directory));
|
||||
mysql_file_close(file, MYF(0));
|
||||
translog_stop_writing();
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
@ -1447,17 +1448,16 @@ LSN translog_get_file_max_lsn_stored(uint32 file)
|
|||
if (translog_read_file_header(&info, fd))
|
||||
{
|
||||
DBUG_PRINT("error", ("Can't read file header"));
|
||||
DBUG_RETURN(LSN_ERROR);
|
||||
info.max_lsn= LSN_ERROR;
|
||||
}
|
||||
|
||||
if (mysql_file_close(fd, MYF(MY_WME)))
|
||||
{
|
||||
DBUG_PRINT("error", ("Can't close file"));
|
||||
DBUG_RETURN(LSN_ERROR);
|
||||
info.max_lsn= LSN_ERROR;
|
||||
}
|
||||
|
||||
DBUG_PRINT("info", ("Max lsn: (%lu,0x%lx)",
|
||||
LSN_IN_PARTS(info.max_lsn)));
|
||||
DBUG_PRINT("info", ("Max lsn: (%lu,0x%lx)", LSN_IN_PARTS(info.max_lsn)));
|
||||
DBUG_RETURN(info.max_lsn);
|
||||
}
|
||||
}
|
||||
|
@ -1621,13 +1621,15 @@ static my_bool translog_create_new_file()
|
|||
if (allocate_dynamic(&log_descriptor.open_files,
|
||||
log_descriptor.max_file - log_descriptor.min_file + 2))
|
||||
goto error_lock;
|
||||
if ((file->handler.file=
|
||||
create_logfile_by_number_no_cache(file_no)) == -1)
|
||||
|
||||
/* this call just expand the array */
|
||||
if (insert_dynamic(&log_descriptor.open_files, (uchar*)&file))
|
||||
goto error_lock;
|
||||
|
||||
if ((file->handler.file= create_logfile_by_number_no_cache(file_no)) == -1)
|
||||
goto error_lock;
|
||||
translog_file_init(file, file_no, 0);
|
||||
|
||||
/* this call just expand the array */
|
||||
insert_dynamic(&log_descriptor.open_files, (uchar*)&file);
|
||||
log_descriptor.max_file++;
|
||||
{
|
||||
char *start= (char*) dynamic_element(&log_descriptor.open_files, 0,
|
||||
|
@ -1661,6 +1663,7 @@ error_lock:
|
|||
mysql_rwlock_unlock(&log_descriptor.open_files_lock);
|
||||
error:
|
||||
translog_stop_writing();
|
||||
my_free(file);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
|
@ -3962,11 +3965,14 @@ my_bool translog_init_with_table(const char *directory,
|
|||
/* Start new log system from scratch */
|
||||
log_descriptor.horizon= MAKE_LSN(start_file_num,
|
||||
TRANSLOG_PAGE_SIZE); /* header page */
|
||||
if ((file->handler.file=
|
||||
create_logfile_by_number_no_cache(start_file_num)) == -1)
|
||||
goto err;
|
||||
translog_file_init(file, start_file_num, 0);
|
||||
if (insert_dynamic(&log_descriptor.open_files, (uchar*)&file))
|
||||
{
|
||||
my_free(file);
|
||||
goto err;
|
||||
}
|
||||
if ((file->handler.file=
|
||||
create_logfile_by_number_no_cache(start_file_num)) == -1)
|
||||
goto err;
|
||||
log_descriptor.min_file= log_descriptor.max_file= start_file_num;
|
||||
if (translog_write_file_header())
|
||||
|
@ -7789,8 +7795,24 @@ void translog_flush_buffers(TRANSLOG_ADDRESS *lsn,
|
|||
translog_force_current_buffer_to_finish();
|
||||
translog_buffer_unlock(buffer);
|
||||
}
|
||||
else if (log_descriptor.bc.buffer->prev_last_lsn != LSN_IMPOSSIBLE)
|
||||
else
|
||||
{
|
||||
if (log_descriptor.bc.buffer->last_lsn == LSN_IMPOSSIBLE)
|
||||
{
|
||||
/*
|
||||
In this case both last_lsn & prev_last_lsn are LSN_IMPOSSIBLE
|
||||
otherwise it will go in the first IF because LSN_IMPOSSIBLE less
|
||||
then any real LSN and cmp_translog_addr(*lsn,
|
||||
log_descriptor.bc.buffer->prev_last_lsn) will be TRUE
|
||||
*/
|
||||
DBUG_ASSERT(log_descriptor.bc.buffer->prev_last_lsn ==
|
||||
LSN_IMPOSSIBLE);
|
||||
DBUG_PRINT("info", ("There is no LSNs yet generated => do nothing"));
|
||||
translog_unlock();
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
DBUG_ASSERT(log_descriptor.bc.buffer->prev_last_lsn != LSN_IMPOSSIBLE);
|
||||
/* fix lsn if it was horizon */
|
||||
*lsn= log_descriptor.bc.buffer->prev_last_lsn;
|
||||
DBUG_PRINT("info", ("LSN to flush fixed to prev last lsn: (%lu,0x%lx)",
|
||||
|
@ -7799,13 +7821,6 @@ void translog_flush_buffers(TRANSLOG_ADDRESS *lsn,
|
|||
TRANSLOG_BUFFERS_NO);
|
||||
translog_unlock();
|
||||
}
|
||||
else if (log_descriptor.bc.buffer->last_lsn == LSN_IMPOSSIBLE)
|
||||
{
|
||||
DBUG_PRINT("info", ("There is no LSNs yet generated => do nothing"));
|
||||
translog_unlock();
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
/* flush buffers */
|
||||
*sent_to_disk= translog_get_sent_to_disk();
|
||||
if (cmp_translog_addr(*lsn, *sent_to_disk) > 0)
|
||||
|
|
|
@ -1445,7 +1445,7 @@ uint _ma_pack_get_block_info(MARIA_HA *maria, MARIA_BIT_BUFF *bit_buff,
|
|||
maria->blob_length=info->blob_len;
|
||||
}
|
||||
info->filepos=filepos+head_length;
|
||||
if (file > 0)
|
||||
if (file >= 0)
|
||||
{
|
||||
info->offset=MY_MIN(info->rec_len, ref_length - head_length);
|
||||
memcpy(*rec_buff_p, header + head_length, info->offset);
|
||||
|
|
|
@ -1988,7 +1988,7 @@ prototype_redo_exec_hook(UNDO_KEY_INSERT)
|
|||
const HA_KEYSEG *keyseg= info->s->keyinfo[keynr].seg;
|
||||
ulonglong value;
|
||||
char llbuf[22];
|
||||
uchar *to;
|
||||
uchar reversed[MARIA_MAX_KEY_BUFF], *to;
|
||||
tprint(tracef, " state older than record\n");
|
||||
/* we read the record to find the auto_increment value */
|
||||
enlarge_buffer(rec);
|
||||
|
@ -2005,7 +2005,6 @@ prototype_redo_exec_hook(UNDO_KEY_INSERT)
|
|||
if (keyseg->flag & HA_SWAP_KEY)
|
||||
{
|
||||
/* We put key from log record to "data record" packing format... */
|
||||
uchar reversed[MARIA_MAX_KEY_BUFF];
|
||||
uchar *key_ptr= to;
|
||||
uchar *key_end= key_ptr + keyseg->length;
|
||||
to= reversed + keyseg->length;
|
||||
|
|
|
@ -1248,6 +1248,7 @@ int ha_myisam::assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt)
|
|||
{
|
||||
KEY_CACHE *new_key_cache= check_opt->key_cache;
|
||||
const char *errmsg= 0;
|
||||
char buf[STRING_BUFFER_USUAL_SIZE];
|
||||
int error= HA_ADMIN_OK;
|
||||
ulonglong map;
|
||||
TABLE_LIST *table_list= table->pos_in_table_list;
|
||||
|
@ -1264,7 +1265,6 @@ int ha_myisam::assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt)
|
|||
|
||||
if ((error= mi_assign_to_key_cache(file, map, new_key_cache)))
|
||||
{
|
||||
char buf[STRING_BUFFER_USUAL_SIZE];
|
||||
my_snprintf(buf, sizeof(buf),
|
||||
"Failed to flush to index file (errno: %d)", error);
|
||||
errmsg= buf;
|
||||
|
|
|
@ -151,7 +151,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
|
|||
}
|
||||
share->mode=open_mode;
|
||||
errpos=1;
|
||||
if (mysql_file_read(kfile, share->state.header.file_version, head_length,
|
||||
if (mysql_file_read(kfile, (uchar*)&share->state.header, head_length,
|
||||
MYF(MY_NABP)))
|
||||
{
|
||||
my_errno= HA_ERR_NOT_A_TABLE;
|
||||
|
|
|
@ -612,6 +612,7 @@ buf_load()
|
|||
|
||||
if (dump_n == 0) {
|
||||
ut_free(dump);
|
||||
ut_free(dump_tmp);
|
||||
ut_sprintf_timestamp(now);
|
||||
buf_load_status(STATUS_NOTICE,
|
||||
"Buffer pool(s) load completed at %s "
|
||||
|
|
|
@ -320,8 +320,8 @@ dict_mem_table_col_rename_low(
|
|||
ut_ad(from_len <= NAME_LEN);
|
||||
ut_ad(to_len <= NAME_LEN);
|
||||
|
||||
char from[NAME_LEN];
|
||||
strncpy(from, s, NAME_LEN);
|
||||
char from[NAME_LEN + 1];
|
||||
strncpy(from, s, NAME_LEN + 1);
|
||||
|
||||
if (from_len == to_len) {
|
||||
/* The easy case: simply replace the column name in
|
||||
|
|
|
@ -3487,13 +3487,13 @@ innobase_convert_identifier(
|
|||
ibool file_id)/*!< in: TRUE=id is a table or database name;
|
||||
FALSE=id is an UTF-8 string */
|
||||
{
|
||||
char nz2[MAX_TABLE_NAME_LEN + 1];
|
||||
const char* s = id;
|
||||
int q;
|
||||
|
||||
if (file_id) {
|
||||
|
||||
char nz[MAX_TABLE_NAME_LEN + 1];
|
||||
char nz2[MAX_TABLE_NAME_LEN + 1];
|
||||
|
||||
/* Decode the table name. The MySQL function expects
|
||||
a NUL-terminated string. The input and output strings
|
||||
|
|
|
@ -1444,6 +1444,7 @@ log_online_setup_bitmap_file_range(
|
|||
if (UNIV_UNLIKELY(array_pos >= bitmap_files->count)) {
|
||||
|
||||
log_online_diagnose_inconsistent_dir(bitmap_files);
|
||||
os_file_closedir(bitmap_dir);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -2590,7 +2590,8 @@ purge_archived_logs(
|
|||
if (dirnamelen + strlen(fileinfo.name) + 2 > OS_FILE_MAX_PATH)
|
||||
continue;
|
||||
|
||||
snprintf(archived_log_filename + dirnamelen, OS_FILE_MAX_PATH,
|
||||
snprintf(archived_log_filename + dirnamelen,
|
||||
OS_FILE_MAX_PATH - dirnamelen - 1,
|
||||
"%s", fileinfo.name);
|
||||
|
||||
if (before_no) {
|
||||
|
|
|
@ -750,7 +750,7 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, size_t len)
|
|||
|
||||
/* Rules: Context */
|
||||
case _CS_CONTEXT:
|
||||
if (len < sizeof(i->context) + 1)
|
||||
if (len < sizeof(i->context))
|
||||
{
|
||||
memcpy(i->context, attr, len);
|
||||
i->context[len]= '\0';
|
||||
|
|
|
@ -1082,6 +1082,7 @@ static void test_wl4435_2()
|
|||
\
|
||||
rs_metadata= mysql_stmt_result_metadata(ps); \
|
||||
fields= mysql_fetch_fields(rs_metadata); \
|
||||
mysql_free_result(rs_metadata); \
|
||||
\
|
||||
rc= mysql_stmt_bind_result(ps, &psp); \
|
||||
check_execute(ps, rc); \
|
||||
|
|
|
@ -687,6 +687,9 @@ void test_update_many(uint *column_numbers, uint *column_values,
|
|||
err:
|
||||
ok(rc, "%s", "update_many");
|
||||
/* cleanup */
|
||||
free(val);
|
||||
free(upd);
|
||||
free(res);
|
||||
mariadb_dyncol_free(&str1);
|
||||
mariadb_dyncol_free(&str2);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue