Skip to content

Commit

Permalink
Merge branch '10.3' into 10.4
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Oct 1, 2022
2 parents 3744b8a + dd8833b commit d4f6d2f
Show file tree
Hide file tree
Showing 208 changed files with 4,248 additions and 2,250 deletions.
14 changes: 7 additions & 7 deletions client/mysqlshow.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ list_dbs(MYSQL *mysql,const char *wild)
MYSQL_RES *tresult = mysql_list_tables(mysql,(char*)NULL);
if (mysql_affected_rows(mysql) > 0)
{
sprintf(tables,"%6lu",(ulong) mysql_affected_rows(mysql));
snprintf(tables, sizeof(tables), "%6lu",(ulong) mysql_affected_rows(mysql));
rowcount = 0;
if (opt_verbose > 1)
{
Expand All @@ -457,13 +457,13 @@ list_dbs(MYSQL *mysql,const char *wild)
}
}
}
sprintf(rows,"%12lu",rowcount);
snprintf(rows, sizeof(rows), "%12lu", rowcount);
}
}
else
{
sprintf(tables,"%6d",0);
sprintf(rows,"%12d",0);
snprintf(tables, sizeof(tables), "%6d" ,0);
snprintf(rows, sizeof(rows), "%12d", 0);
}
mysql_free_result(tresult);
}
Expand Down Expand Up @@ -581,7 +581,7 @@ list_tables(MYSQL *mysql,const char *db,const char *table)
}
else
{
sprintf(fields,"%8u",(uint) mysql_num_fields(rresult));
snprintf(fields, sizeof(fields), "%8u", (uint) mysql_num_fields(rresult));
mysql_free_result(rresult);

if (opt_verbose > 1)
Expand All @@ -597,10 +597,10 @@ list_tables(MYSQL *mysql,const char *db,const char *table)
rowcount += (unsigned long) strtoull(rrow[0], (char**) 0, 10);
mysql_free_result(rresult);
}
sprintf(rows,"%10lu",rowcount);
snprintf(rows, sizeof(rows), "%10lu", rowcount);
}
else
sprintf(rows,"%10d",0);
snprintf(rows, sizeof(rows), "%10d", 0);
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions include/my_sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,17 @@ extern ulonglong my_getcputime(void);
#define hrtime_sec_part(X) ((ulong)((X).val % HRTIME_RESOLUTION))
#define my_time(X) hrtime_to_time(my_hrtime_coarse())

/**
Make high resolution time from two parts.
*/

static inline my_hrtime_t make_hr_time(my_time_t time, ulong time_sec_part)
{
my_hrtime_t res= {((ulonglong) time)*1000000 + time_sec_part};
return res;
}


#if STACK_DIRECTION < 0
#define available_stack_size(CUR,END) (long) ((char*)(CUR) - (char*)(END))
#else
Expand Down
6 changes: 3 additions & 3 deletions mysql-test/main/analyze_stmt_privileges.result
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ CREATE USER u1@localhost;
grant ALL on db.v1 to u1@localhost;
connect con1,localhost,u1,,;
select * from db.t1;
ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table 't1'
ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table `db`.`t1`
explain select * from db.t1;
ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table 't1'
ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table `db`.`t1`
analyze select * from db.t1;
ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table 't1'
ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table `db`.`t1`
select * from db.v1;
i c
2 bar
Expand Down
1,794 changes: 897 additions & 897 deletions mysql-test/main/analyze_stmt_privileges2.result

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mysql-test/main/bootstrap.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ drop table if exists t1;

# Add the datadir to the bootstrap command
let $MYSQLD_DATADIR= `select @@datadir`;
let $MYSQLD_BOOTSTRAP_CMD= $MYSQLD_BOOTSTRAP_CMD --datadir=$MYSQLD_DATADIR --default-storage-engine=MyISAM --loose-skip-innodb --plugin-maturity=unknown;
let $MYSQLD_BOOTSTRAP_CMD= $MYSQLD_BOOTSTRAP_CMD --datadir=$MYSQLD_DATADIR --tmpdir=$MYSQL_TMP_DIR --default-storage-engine=MyISAM --loose-skip-innodb --plugin-maturity=unknown;
#
# Check that --bootstrap reads from stdin
#
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/main/bootstrap_innodb.test
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ rollback to savepoint s1;
insert t1 values (5);
commit;
EOF
exec $MYSQLD_BOOTSTRAP_CMD --datadir=$datadir --innodb < $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1;
exec $MYSQLD_BOOTSTRAP_CMD --datadir=$datadir --tmpdir=$MYSQL_TMP_DIR --innodb < $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1;
remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql;

source include/start_mysqld.inc;
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/main/create_or_replace_permission.result
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ CREATE OR REPLACE DATABASE db2;
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'db2'
USE db1;
CREATE OR REPLACE TABLE t1(id INT);
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table 't1'
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table `db1`.`t1`
CREATE OR REPLACE PROCEDURE proc1 (OUT cnt INT) BEGIN END;
ERROR 42000: alter routine command denied to user 'mysqltest_1'@'localhost' for routine 'db1.proc1'
CREATE OR REPLACE FUNCTION lookup RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/main/cte_grant.result
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ c
select d from mysqltest.v2;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'd' in table 'v2'
select * from mysqltest.v3;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'v3'
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table `mysqltest`.`v3`
connection root;
grant select on mysqltest.v3 to mysqltest_1@localhost;
connection user1;
Expand Down Expand Up @@ -116,7 +116,7 @@ revoke SELECT on db.t1 from foo@localhost;
connection con1;
with cte as (select * from t1 where i < 4)
select * from cte;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 't1'
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table `db`.`t1`
disconnect con1;
connection default;
drop database db;
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/main/cte_nonrecursive_not_embedded.result
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ cte3 AS
cte4 AS
(SELECT cte2.a FROM t2,cte2 WHERE cte2.a = t2.a)
SELECT * FROM cte4 as r;
ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table 't2'
ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table `db`.`t2`
disconnect u1;
connection default;
DROP USER 'u1'@'localhost';
Expand Down
Loading

0 comments on commit d4f6d2f

Please sign in to comment.