Skip to content

Commit 5aa46fe

Browse files
committed
MDEV-39196: SELECT from information schema fails when FederatedX loses underlying table
When a remote table is unavailable, FederatedX was passing a hard error back to the SQL layer, causing INFORMATION_SCHEMA queries to abort entirely. This patch intercepts the remote error in ha_federatedx::info, downgrades it to a warning using push_warning_printf, and includes the local table name in the warning message so the user knows which table is inaccessible. Signed-off-by: Anway Durge <124391429+itzanway@users.noreply.github.com>
1 parent 0bbec68 commit 5aa46fe

3,994 files changed

Lines changed: 385319 additions & 123264 deletions

File tree

Some content is hidden

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

.github/pull_request_template.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,16 @@ An amazing description should answer some questions like:
2626
TODO: fill description here
2727

2828
## How can this PR be tested?
29-
TODO: fill steps to reproduce here, if applicable,
30-
or remove the section
29+
30+
TODO: modify the automated test suite to verify that the PR causes MariaDB to
31+
behave as intended. Consult the documentation on
32+
["Writing good test cases"](https://mariadb.org/get-involved/getting-started-for-developers/writing-good-test-cases-mariadb-server).
33+
In many cases, this will be as simple as modifying one `.test` and one `.result`
34+
file in the `mysql-test/` subdirectory. Without _automated_ tests, future regressions
35+
in the expected behavior can't be automatically detected and verified.
36+
37+
If the changes are not amenable to automated testing, please explain why not and
38+
carefully describe how to test manually.
3139

3240
<!--
3341
Tick one of the following boxes [x] to help us understand
@@ -47,4 +55,3 @@ You might consider answering some questions like:
4755
-->
4856
## Backward compatibility
4957
TODO: fill details here, if applicable, or remove the section
50-

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ packaging/rpm-oel/mysql.spec
107107
packaging/rpm-uln/mysql.10.0.11.spec
108108
packaging/solaris/postinstall-solaris
109109
extra/pcre2
110+
extra/libfmt
110111
plugin/auth_pam/auth_pam_tool
111112
plugin/auth_pam/config_auth_pam.h
112113
plugin/aws_key_management/aws-sdk-cpp
@@ -186,6 +187,7 @@ sql-bench/innotest1b.pl
186187
sql-bench/innotest2.pl
187188
sql-bench/innotest2a.pl
188189
sql-bench/innotest2b.pl
190+
sql-bench/output
189191
sql-bench/run-all-tests.pl
190192
sql-bench/server-cfg.pl
191193
sql-bench/test-ATIS.pl
@@ -240,7 +242,6 @@ storage/perfschema/pfs_config.h
240242
storage/rocksdb/ldb
241243
storage/rocksdb/myrocks_hotbackup
242244
storage/rocksdb/mysql_ldb
243-
storage/rocksdb/myrocks_hotbackup
244245
storage/rocksdb/rdb_source_revision.h
245246
storage/rocksdb/sst_dump
246247
strings/conf_to_src
@@ -257,12 +258,13 @@ support-files/mariadb-extra.socket
257258
support-files/mariadb@.service
258259
support-files/mariadb@.socket
259260
support-files/mariadb-extra@.socket
261+
support-files/mini-benchmark
260262
support-files/my-huge.cnf
261263
support-files/my-innodb-heavy-4G.cnf
262264
support-files/my-large.cnf
263265
support-files/my-medium.cnf
264266
support-files/my-small.cnf
265-
support-files/mysql-log-rotate
267+
support-files/mariadb.logrotate
266268
support-files/mysql.10.0.11.spec
267269
support-files/mysql.server
268270
support-files/mysql.service
@@ -615,6 +617,8 @@ scripts/mariadb-setpermission
615617
sql/mariadbd
616618
sql/mariadb-tzinfo-to-sql
617619
storage/rocksdb/mariadb-ldb
620+
strings/ctype-uca1400data.h
621+
strings/uca-dump
618622
tests/mariadb-client-test
619623
versioninfo_dll.rc
620624
versioninfo_exe.rc

.gitlab-ci.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ variables:
4343
CMAKE_FLAGS: "-DWITH_SSL=system -DPLUGIN_COLUMNSTORE=NO -DPLUGIN_ROCKSDB=NO -DPLUGIN_S3=NO -DPLUGIN_MROONGA=NO -DPLUGIN_CONNECT=NO -DPLUGIN_MROONGA=NO -DPLUGIN_TOKUDB=NO -DPLUGIN_PERFSCHEMA=NO -DWITH_WSREP=OFF"
4444
# Major version dictates which branches share the same ccache. E.g. 10.6-abc
4545
# and 10.6-xyz will have the same cache.
46-
MARIADB_MAJOR_VERSION: "10.6"
46+
MARIADB_MAJOR_VERSION: "10.9"
4747
# NOTE! Currently ccache is only used on the Centos 9 build. As each job has
4848
# sufficiently different environments they are unable to benefit from each
4949
# other's ccaches. As each build generates about 1 GB of ccache, having
@@ -510,6 +510,37 @@ flawfinder:
510510
- flawfinder-all-vulnerabilities.html
511511
- flawfinder-min-level5.json
512512

513+
mini-benchmark:
514+
stage: test
515+
dependencies:
516+
- fedora
517+
needs:
518+
- fedora
519+
script:
520+
- ls -la rpm; rm -vf rpm/*.el?.* # Delete artifacts from Centos builds
521+
# Don't use cracklib, otherwise the Sysbench user password will be rejected
522+
- rm -vf rpm/*cracklib*.rpm
523+
# Nothing provides galera-4 on Fedora, so this step fails if built with wsrep
524+
- yum install -y rpm/*.rpm
525+
# Fedora does not support running services in Docker (like Debian packages do) so start it manually
526+
- /usr/bin/mariadb-install-db -u mysql
527+
- sudo -u mysql /usr/sbin/mariadbd & sleep 10
528+
# Since we did a manual start, we also need to run upgrade manually
529+
- /usr/bin/mariadb-upgrade -u root
530+
- |
531+
mariadb --skip-column-names -e "SELECT @@version, @@version_comment" | tee /tmp/version
532+
grep $MARIADB_MAJOR_VERSION /tmp/version || echo "MariaDB didn't install properly"
533+
- yum install -y sysbench procps-ng perf flamegraph flamegraph-stackcollapse-perf util-linux dnf-utils
534+
- /usr/share/mysql/mini-benchmark
535+
- cp -av */sysbench-run-*.log */metrics.txt . # Move files one level down so they can be saved as artifacts
536+
artifacts:
537+
when: always
538+
paths:
539+
- sysbench-run-*.log
540+
reports:
541+
metrics:
542+
- metrics.txt
543+
513544
# Once all RPM builds and tests have passed, also run the DEB builds and tests
514545
# @NOTE: This is likely to work well only on salsa.debian.org as the Gitlab.com
515546
# runners are too small for everything this stage does.

BUILD/FINISH.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fi
3434

3535
commands=""
3636
# git clean -fdX removes all ignored (build) files
37-
if test -d .git
37+
if test -d .git && test -d libmariadb/CMakeFiles
3838
then
3939
commands="\
4040
git clean -fdX

BUILD/SETUP.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ base_configs="$base_configs --with-extra-charsets=complex "
204204
base_configs="$base_configs --enable-thread-safe-client "
205205
base_configs="$base_configs --with-big-tables $maintainer_mode"
206206
base_configs="$base_configs --with-plugin-aria --with-aria-tmp-tables --with-plugin-s3=STATIC"
207+
base_configs="$base_configs $SSL_LIBRARY"
207208

208209
if test -d "$path/../cmd-line-utils/readline"
209210
then
@@ -214,18 +215,17 @@ then
214215
fi
215216

216217
max_plugins="--with-plugins=max"
217-
max_no_embedded_configs="$SSL_LIBRARY $max_plugins"
218-
max_no_qc_configs="$SSL_LIBRARY $max_plugins --without-query-cache"
219-
max_configs="$SSL_LIBRARY $max_plugins --with-embedded-server --with-libevent --with-plugin-rocksdb=dynamic --with-plugin-test_sql_discovery=DYNAMIC --with-plugin-file_key_management=DYNAMIC"
220-
all_configs="$SSL_LIBRARY $max_plugins --with-embedded-server --with-innodb_plugin --with-libevent"
218+
max_no_embedded_configs="$max_plugins"
219+
max_no_qc_configs="$max_plugins --without-query-cache"
220+
max_configs="$max_plugins --with-embedded-server --with-libevent --with-plugin-rocksdb=dynamic --with-plugin-test_sql_discovery=DYNAMIC --with-plugin-file_key_management=DYNAMIC --with-plugin-hashicorp_key_management=DYNAMIC --with-plugin-auth_gssapi=DYNAMIC"
221+
all_configs="$max_configs"
221222

222223
#
223224
# CPU and platform specific compilation flags.
224225
#
225226
alpha_cflags="$check_cpu_cflags -Wa,-m$cpu_flag"
226-
amd64_cflags="$check_cpu_cflags"
227-
amd64_cxxflags="" # If dropping '--with-big-tables', add here "-DBIG_TABLES"
228227
pentium_cflags="$check_cpu_cflags -m32"
228+
amd64_cflags="$check_cpu_cflags -m64"
229229
pentium64_cflags="$check_cpu_cflags -m64"
230230
ppc_cflags="$check_cpu_cflags"
231231
sparc_cflags=""

BUILD/compile-amd64-debug-all

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#! /bin/sh
2+
23
path=`dirname $0`
4+
set -- "$@" --with-debug=full
35
. "$path/SETUP.sh"
6+
47
extra_flags="$amd64_cflags $debug_cflags"
58
extra_configs="$amd64_configs $debug_configs $all_configs"
6-
9+
CC="$CC --pipe"
710
. "$path/FINISH.sh"

BUILD/compile-amd64-debug-max

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#! /bin/sh
22

3-
# Copyright (c) 2005, 2006 MySQL AB
4-
# Use is subject to license terms
3+
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
54
#
65
# This program is free software; you can redistribute it and/or modify
76
# it under the terms of the GNU General Public License as published by
@@ -14,11 +13,13 @@
1413
#
1514
# You should have received a copy of the GNU General Public License
1615
# along with this program; if not, write to the Free Software
17-
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
16+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
1817

1918
path=`dirname $0`
2019
. "$path/SETUP.sh"
20+
2121
extra_flags="$amd64_cflags $debug_cflags"
2222
extra_configs="$amd64_configs $debug_configs $max_configs"
2323

24+
CC="$CC --pipe"
2425
. "$path/FINISH.sh"

BUILD/compile-pentium64-debug-all

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,5 @@ set -- "$@" --with-debug=full
66

77
extra_flags="$pentium64_cflags $debug_cflags"
88
extra_configs="$pentium_configs $debug_configs $all_configs"
9-
10-
extra_configs="$extra_configs "
119
CC="$CC --pipe"
1210
. "$path/FINISH.sh"

BUILD/compile-pentium64-debug-max

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@ path=`dirname $0`
2121
extra_flags="$pentium64_cflags $debug_cflags"
2222
extra_configs="$pentium_configs $debug_configs $max_configs"
2323

24-
extra_configs="$extra_configs "
2524
CC="$CC --pipe"
2625
. "$path/FINISH.sh"

BUILD/compile-pentium64-ubsan

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ path=`dirname $0`
3131
# the destination
3232
#
3333

34-
extra_flags="$pentium64_cflags $debug_cflags -fsanitize=undefined -DWITH_UBSAN -Wno-conversion -Wno-uninitialized"
34+
extra_flags="$pentium64_cflags $debug_cflags -fsanitize=undefined -DWITH_UBSAN -Wno-conversion -Wno-uninitialized -Wno-unused-parameter"
3535
extra_configs="$pentium_configs $debug_configs -DWITH_UBSAN=ON -DMYSQL_MAINTAINER_MODE=NO --without-spider"
3636

3737
. "$path/FINISH.sh"

0 commit comments

Comments
 (0)