Skip to content

Commit

Permalink
Merge branch '10.11' into 11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Feb 1, 2024
2 parents fe490f8 + 87e1372 commit 6ef0b2e
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 17 deletions.
3 changes: 0 additions & 3 deletions client/mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2300,10 +2300,7 @@ static int read_and_execute(bool interactive)
the readline/libedit library.
*/
if (line)
{
free(line);
glob_buffer.length(0);
}
line= readline(prompt);
#ifdef USE_LIBEDIT_INTERFACE
/*
Expand Down
10 changes: 4 additions & 6 deletions cmake/libfmt.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
INCLUDE (CheckCXXSourceCompiles)
INCLUDE (CheckCXXSourceRuns)
INCLUDE (ExternalProject)

SET(WITH_LIBFMT "auto" CACHE STRING
Expand Down Expand Up @@ -27,17 +27,15 @@ ENDMACRO()
MACRO (CHECK_LIBFMT)
IF(WITH_LIBFMT STREQUAL "system" OR WITH_LIBFMT STREQUAL "auto")
SET(CMAKE_REQUIRED_INCLUDES ${LIBFMT_INCLUDE_DIR})
CHECK_CXX_SOURCE_COMPILES(
CHECK_CXX_SOURCE_RUNS(
"#define FMT_STATIC_THOUSANDS_SEPARATOR ','
#define FMT_HEADER_ONLY 1
#include <fmt/format-inl.h>
#include <iostream>
int main() {
int answer= 42;
int answer= 4321;
fmt::format_args::format_arg arg=
fmt::detail::make_arg<fmt::format_context>(answer);
std::cout << fmt::vformat(\"The answer is {}.\",
fmt::format_args(&arg, 1));
return fmt::vformat(\"{:L}\", fmt::format_args(&arg, 1)).compare(\"4,321\");
}" HAVE_SYSTEM_LIBFMT)
SET(CMAKE_REQUIRED_INCLUDES)
ENDIF()
Expand Down
9 changes: 3 additions & 6 deletions cmake/pcre.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,15 @@ MACRO (CHECK_PCRE)
FIND_PACKAGE(PkgConfig QUIET)
PKG_CHECK_MODULES(PCRE libpcre2-8)
# in case pkg-config or libpcre2-8.pc is not installed:
IF(NOT PCRE_FOUND)
UNSET(PCRE_FOUND CACHE)
CHECK_LIBRARY_EXISTS(pcre2-8 pcre2_match_8 "" PCRE_FOUND)
ENDIF()
CHECK_LIBRARY_EXISTS(pcre2-8 pcre2_match_8 "${PCRE_LIBRARY_DIRS}" HAVE_PCRE2_MATCH_8)
ENDIF()
IF(NOT PCRE_FOUND OR WITH_PCRE STREQUAL "bundled")
IF(NOT HAVE_PCRE2_MATCH_8 OR WITH_PCRE STREQUAL "bundled")
IF (WITH_PCRE STREQUAL "system")
MESSAGE(FATAL_ERROR "system pcre2-8 library is not found or unusable")
ENDIF()
BUNDLE_PCRE2()
ELSE()
CHECK_LIBRARY_EXISTS(pcre2-posix PCRE2regcomp "" NEEDS_PCRE2_DEBIAN_HACK)
CHECK_LIBRARY_EXISTS(pcre2-posix PCRE2regcomp "${PCRE_LIBRARY_DIRS}" NEEDS_PCRE2_DEBIAN_HACK)
IF(NEEDS_PCRE2_DEBIAN_HACK)
SET(PCRE2_DEBIAN_HACK "-Dregcomp=PCRE2regcomp -Dregexec=PCRE2regexec -Dregerror=PCRE2regerror -Dregfree=PCRE2regfree")
ENDIF()
Expand Down
24 changes: 24 additions & 0 deletions mysql-test/main/mysql-interactive.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# regression introduced by MDEV-14448
#
delimiter $
select 1;
$
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is X
Server version: Y
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> delimiter $
MariaDB [(none)]> select 1;
-> $
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set

MariaDB [(none)]>
29 changes: 29 additions & 0 deletions mysql-test/main/mysql-interactive.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--echo #
--echo # regression introduced by MDEV-14448
--echo #
source include/not_embedded.inc;
source include/not_windows.inc;

error 0,1;
exec $MYSQL -V|grep -q readline;
if ($sys_errno == 1)
{
# strangely enough
skip does not work with libedit;
}

write_file $MYSQL_TMP_DIR/mysql_in;
delimiter $
select 1;
$
EOF
let TERM=dumb;
replace_regex /id is \d+/id is X/ /Server version: .*/Server version: Y/ / \(\d+\.\d+ sec\)//;
error 0,127;
exec socat EXEC:"$MYSQL",pty STDIO < $MYSQL_TMP_DIR/mysql_in;
if ($sys_errno == 127)
{
remove_file $MYSQL_TMP_DIR/mysql_in;
skip no socat;
}
remove_file $MYSQL_TMP_DIR/mysql_in;
8 changes: 8 additions & 0 deletions mysql-test/suite/funcs_1/views/views_master.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3085,8 +3085,10 @@ eval SHOW CREATE VIEW test1.v$level;
# the following line as written as '--eror ER_TOO_MANY_TABLES' and the command
# is successful so assuming no expected error was intended
# --error ER_TOO_MANY_TABLES
--disable_ps2_protocol
eval SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
CAST(f2 AS CHAR) AS f2 FROM test1.v$level;
--enable_ps2_protocol
let $message= The output of following EXPLAIN is deactivated, because the result
differs on some platforms
FIXME Is this a bug ? ;
Expand Down Expand Up @@ -3116,25 +3118,31 @@ SELECT f1 as f2, f2 as f1 FROM test2.t1;
CREATE OR REPLACE VIEW test2.v0 AS
SELECT CAST('0001-01-01' AS DATE) as f1, f2 FROM test3.t1;
eval SHOW CREATE VIEW test1.v$toplevel;
--disable_ps2_protocol
eval SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
CAST(f2 AS CHAR) AS f2 FROM test1.v$toplevel;
--enable_ps2_protocol
eval EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
CAST(f2 AS CHAR) AS f2 FROM test1.v$toplevel;
# 2.3.3 UCS2 string instead of common string
CREATE OR REPLACE VIEW test3.v0 AS
SELECT f1 , CONVERT('ßÄäÖöÜü§' USING UCS2) as f2 FROM test1.t1;
eval SHOW CREATE VIEW test1.v$toplevel;
--disable_ps2_protocol
eval SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
CAST(f2 AS CHAR) AS f2 FROM test1.v$toplevel;
--enable_ps2_protocol
eval EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
CAST(f2 AS CHAR) AS f2 FROM test1.v$toplevel;

# 2.3.4 UCS2 string instead of numeric
CREATE OR REPLACE VIEW test3.v0 AS
SELECT CONVERT('ßÄäÖöÜü§' USING UCS2) as f1, f2 FROM test1.t1;
eval SHOW CREATE VIEW test1.v$toplevel;
--disable_ps2_protocol
eval SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
CAST(f2 AS CHAR) AS f2 FROM test1.v$toplevel;
--enable_ps2_protocol
eval EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
CAST(f2 AS CHAR) AS f2 FROM test1.v$toplevel;
--enable_result_log
Expand Down
5 changes: 5 additions & 0 deletions mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ connection slave;
include/stop_slave.inc
CHANGE MASTER TO MASTER_USE_GTID=NO;
include/start_slave.inc
connection master;
# Ensure only the new binlog dump thread is alive (wait for the old one
# to complete its kill)
# And that it has already sent its fake rotate
connection slave;
include/stop_slave.inc
# Test slave with no capability gets dummy event, which is ignored.
set @old_dbug= @@global.debug_dbug;
Expand Down
11 changes: 11 additions & 0 deletions mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ sync_slave_with_master;
CHANGE MASTER TO MASTER_USE_GTID=NO;
--source include/start_slave.inc

--connection master
--echo # Ensure only the new binlog dump thread is alive (wait for the old one
--echo # to complete its kill)
--let $wait_condition= select count(*)=1 from information_schema.processlist where command='Binlog Dump'
--source include/wait_condition.inc

--echo # And that it has already sent its fake rotate
--let $wait_condition= select count(*)=1 from information_schema.processlist where state LIKE '%Master has sent all binlog to slave%' and command='Binlog Dump'
--source include/wait_condition.inc

--connection slave
--source include/stop_slave.inc
--echo # Test slave with no capability gets dummy event, which is ignored.
set @old_dbug= @@global.debug_dbug;
Expand Down
1 change: 0 additions & 1 deletion sql/item_strfunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,6 @@ class Item_func_replace :public Item_str_func
Item_str_func(thd, org, find, replace) {}
String *val_str(String *to) override { return val_str_internal(to, false); };
bool fix_length_and_dec(THD *thd) override;
String *val_str_internal(String *str, String *empty_string_for_null);
const Schema *schema() const override { return &mariadb_schema; }
void print(String *str, enum_query_type query_type) override
{
Expand Down
3 changes: 3 additions & 0 deletions sql/sql_lex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4787,9 +4787,12 @@ void st_select_lex::fix_prepare_information(THD *thd, Item **conds,
{
Query_arena_stmt on_stmt_arena(thd);
changed_elements|= TOUCHED_SEL_COND;
/*
TODO: return after MDEV-33218 fix
DBUG_ASSERT(
active_arena->is_stmt_prepare_or_first_stmt_execute() ||
active_arena->state == Query_arena::STMT_SP_QUERY_ARGUMENTS);
*/
if (group_list.first)
{
if (!group_list_ptrs)
Expand Down
1 change: 1 addition & 0 deletions storage/spider/mysql-test/spider/bugfix/disabled.def
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ wait_timeout : MDEV-26045
mdev_29676 : MDEV-31138
mdev_27239: MDEV-32046
mdev_27575 : MDEV-32997
mdev_28739_simple : MDEV-33343

0 comments on commit 6ef0b2e

Please sign in to comment.