Skip to content

Commit 3a21162

Browse files
committed
Merge branch '10.4' into 10.5
2 parents e29fb95 + d4f6d2f commit 3a21162

File tree

244 files changed

+9702
-2437
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

244 files changed

+9702
-2437
lines changed

client/mysqlshow.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ list_dbs(MYSQL *mysql,const char *wild)
441441
MYSQL_RES *tresult = mysql_list_tables(mysql,(char*)NULL);
442442
if (mysql_affected_rows(mysql) > 0)
443443
{
444-
sprintf(tables,"%6lu",(ulong) mysql_affected_rows(mysql));
444+
snprintf(tables, sizeof(tables), "%6lu",(ulong) mysql_affected_rows(mysql));
445445
rowcount = 0;
446446
if (opt_verbose > 1)
447447
{
@@ -462,13 +462,13 @@ list_dbs(MYSQL *mysql,const char *wild)
462462
}
463463
}
464464
}
465-
sprintf(rows,"%12lu",rowcount);
465+
snprintf(rows, sizeof(rows), "%12lu", rowcount);
466466
}
467467
}
468468
else
469469
{
470-
sprintf(tables,"%6d",0);
471-
sprintf(rows,"%12d",0);
470+
snprintf(tables, sizeof(tables), "%6d" ,0);
471+
snprintf(rows, sizeof(rows), "%12d", 0);
472472
}
473473
mysql_free_result(tresult);
474474
}
@@ -586,7 +586,7 @@ list_tables(MYSQL *mysql,const char *db,const char *table)
586586
}
587587
else
588588
{
589-
sprintf(fields,"%8u",(uint) mysql_num_fields(rresult));
589+
snprintf(fields, sizeof(fields), "%8u", (uint) mysql_num_fields(rresult));
590590
mysql_free_result(rresult);
591591

592592
if (opt_verbose > 1)
@@ -602,10 +602,10 @@ list_tables(MYSQL *mysql,const char *db,const char *table)
602602
rowcount += (unsigned long) strtoull(rrow[0], (char**) 0, 10);
603603
mysql_free_result(rresult);
604604
}
605-
sprintf(rows,"%10lu",rowcount);
605+
snprintf(rows, sizeof(rows), "%10lu", rowcount);
606606
}
607607
else
608-
sprintf(rows,"%10d",0);
608+
snprintf(rows, sizeof(rows), "%10d", 0);
609609
}
610610
}
611611
}

include/my_sys.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,17 @@ extern ulonglong my_getcputime(void);
944944
#define hrtime_sec_part(X) ((ulong)((X).val % HRTIME_RESOLUTION))
945945
#define my_time(X) hrtime_to_time(my_hrtime_coarse())
946946

947+
/**
948+
Make high resolution time from two parts.
949+
*/
950+
951+
static inline my_hrtime_t make_hr_time(my_time_t time, ulong time_sec_part)
952+
{
953+
my_hrtime_t res= {((ulonglong) time)*1000000 + time_sec_part};
954+
return res;
955+
}
956+
957+
947958
#if STACK_DIRECTION < 0
948959
#define available_stack_size(CUR,END) (long) ((char*)(CUR) - (char*)(END))
949960
#else

mysql-test/main/analyze_stmt_privileges.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ CREATE USER u1@localhost;
1111
grant ALL on db.v1 to u1@localhost;
1212
connect con1,localhost,u1,,;
1313
select * from db.t1;
14-
ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table 't1'
14+
ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table `db`.`t1`
1515
explain select * from db.t1;
16-
ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table 't1'
16+
ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table `db`.`t1`
1717
analyze select * from db.t1;
18-
ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table 't1'
18+
ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table `db`.`t1`
1919
select * from db.v1;
2020
i c
2121
2 bar

mysql-test/main/analyze_stmt_privileges2.result

Lines changed: 897 additions & 897 deletions
Large diffs are not rendered by default.

mysql-test/main/bootstrap.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ drop table if exists t1;
88

99
# Add the datadir to the bootstrap command
1010
let $MYSQLD_DATADIR= `select @@datadir`;
11-
let $MYSQLD_BOOTSTRAP_CMD= $MYSQLD_BOOTSTRAP_CMD --datadir=$MYSQLD_DATADIR --default-storage-engine=MyISAM --loose-skip-innodb --plugin-maturity=unknown;
11+
let $MYSQLD_BOOTSTRAP_CMD= $MYSQLD_BOOTSTRAP_CMD --datadir=$MYSQLD_DATADIR --tmpdir=$MYSQL_TMP_DIR --default-storage-engine=MyISAM --loose-skip-innodb --plugin-maturity=unknown;
1212
#
1313
# Check that --bootstrap reads from stdin
1414
#

mysql-test/main/bootstrap_innodb.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ rollback to savepoint s1;
1919
insert t1 values (5);
2020
commit;
2121
EOF
22-
exec $MYSQLD_BOOTSTRAP_CMD --datadir=$datadir --innodb < $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1;
22+
exec $MYSQLD_BOOTSTRAP_CMD --datadir=$datadir --tmpdir=$MYSQL_TMP_DIR --innodb < $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1;
2323
remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql;
2424

2525
source include/start_mysqld.inc;

mysql-test/main/create_or_replace_permission.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ CREATE OR REPLACE DATABASE db2;
3232
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'db2'
3333
USE db1;
3434
CREATE OR REPLACE TABLE t1(id INT);
35-
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table 't1'
35+
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table `db1`.`t1`
3636
CREATE OR REPLACE PROCEDURE proc1 (OUT cnt INT) BEGIN END;
3737
ERROR 42000: alter routine command denied to user 'mysqltest_1'@'localhost' for routine 'db1.proc1'
3838
CREATE OR REPLACE FUNCTION lookup RETURNS STRING SONAME "UDF_EXAMPLE_LIB";

mysql-test/main/cte_grant.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ c
5151
select d from mysqltest.v2;
5252
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'd' in table 'v2'
5353
select * from mysqltest.v3;
54-
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'v3'
54+
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table `mysqltest`.`v3`
5555
connection root;
5656
grant select on mysqltest.v3 to mysqltest_1@localhost;
5757
connection user1;
@@ -116,7 +116,7 @@ revoke SELECT on db.t1 from foo@localhost;
116116
connection con1;
117117
with cte as (select * from t1 where i < 4)
118118
select * from cte;
119-
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 't1'
119+
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table `db`.`t1`
120120
disconnect con1;
121121
connection default;
122122
drop database db;

mysql-test/main/cte_nonrecursive_not_embedded.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ cte3 AS
3939
cte4 AS
4040
(SELECT cte2.a FROM t2,cte2 WHERE cte2.a = t2.a)
4141
SELECT * FROM cte4 as r;
42-
ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table 't2'
42+
ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table `db`.`t2`
4343
disconnect u1;
4444
connection default;
4545
DROP USER 'u1'@'localhost';

0 commit comments

Comments
 (0)