Skip to content

Commit cbabb95

Browse files
committed
Merge branch '11.0' into 11.1
2 parents 17127fd + 0005f2f commit cbabb95

File tree

1,034 files changed

+41370
-18259
lines changed

Some content is hidden

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

1,034 files changed

+41370
-18259
lines changed

.github/pull_request_template.md

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,47 @@
11
<!--
22
Thank you for contributing to the MariaDB Server repository!
33
4-
You can help us review your changes faster by filling this template <3
4+
You can help us review your changes faster by filling in this template <3
55
6-
If you have any questions related to MariaDB or you just want to
7-
hang out and meet other community members, please join us on
8-
https://mariadb.zulipchat.com/ .
6+
If you have any questions related to MariaDB or you just want to hang out and meet other community members, please join us on https://mariadb.zulipchat.com/ .
97
-->
108

119
<!--
12-
If you've already identified a https://jira.mariadb.org/ issue
13-
that seems to track this bug/feature, please add its number below.
10+
If you've already identified a https://jira.mariadb.org/ issue that seems to track this bug/feature, please add its number below.
1411
-->
15-
- [x] *The Jira issue number for this PR is: MDEV-_____*
12+
- [x] *The Jira issue number for this PR is: MDEV-______*
1613

1714
<!--
1815
An amazing description should answer some questions like:
1916
1. What problem is the patch trying to solve?
20-
2. If some output changed, what was it looking like before
21-
the change and how it's looking with this patch applied
22-
3. Do you think this patch might introduce side-effects in
23-
other parts of the server?
17+
2. If some output changed that is not visible in a test case, what was it looking like before the change and how it's looking with this patch applied?
18+
3. Do you think this patch might introduce side-effects in other parts of the server?
2419
-->
2520
## Description
2621
TODO: fill description here
2722

2823
## How can this PR be tested?
2924

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.
25+
TODO: modify the automated test suite to verify that the PR causes MariaDB to behave as intended.
26+
Consult the documentation on ["Writing good test cases"](https://mariadb.org/get-involved/getting-started-for-developers/writing-good-test-cases-mariadb-server).
27+
<!--
28+
In many cases, this will be as simple as modifying one `.test` and one `.result` file in the `mysql-test/` subdirectory.
29+
Without automated tests, future regressions in the expected behavior can't be automatically detected and verified.
30+
-->
3631

37-
If the changes are not amenable to automated testing, please explain why not and
38-
carefully describe how to test manually.
32+
If the changes are not amenable to automated testing, please explain why not and carefully describe how to test manually.
3933

4034
<!--
41-
Tick one of the following boxes [x] to help us understand
42-
if the base branch for the PR is correct
43-
(Currently the earliest maintained branch is 10.3)
35+
Tick one of the following boxes [x] to help us understand if the base branch for the PR is correct. (Currently the earliest maintained branch is 10.3)
4436
-->
4537
## Basing the PR against the correct MariaDB version
46-
- [ ] *This is a new feature and the PR is based against the latest MariaDB development branch*
47-
- [ ] *This is a bug fix and the PR is based against the earliest maintained branch in which the bug can be reproduced*
38+
- [ ] *This is a new feature and the PR is based against the latest MariaDB development branch.*
39+
- [ ] *This is a bug fix and the PR is based against the earliest maintained branch in which the bug can be reproduced.*
4840

4941
<!--
50-
You might consider answering some questions like:
51-
1. Does this affect the on-disk format used by MariaDB?
52-
2. Does this change any behavior experienced by a user
53-
who upgrades from a version prior to this patch?
54-
3. Would a user be able to start MariaDB on a datadir
55-
created prior to your fix?
42+
All code merged into the MariaDB codebase must meet a quality standard and codying style.
43+
Maintainers are happy to point out inconsistencies but in order to speed up the review and merge process we ask you to check the CODING standards.
5644
-->
57-
## Backward compatibility
58-
TODO: fill details here, if applicable, or remove the section
59-
6045
## PR quality check
6146
- [ ] I checked the [CODING_STANDARDS.md](https://github.com/MariaDB/server/blob/11.0/CODING_STANDARDS.md) file and my PR conforms to this where appropriate.
47+
- [ ] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ support-files/mysql.10.0.11.spec
267267
support-files/mysql.server
268268
support-files/mysql.service
269269
support-files/mysql.spec
270-
support-files/mysql-log-rotate
271270
support-files/mysqld.service
272271
support-files/mysqld_multi.server
273272
support-files/policy/selinux/mysqld-safe.pp

.gitlab-ci.yml

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ stages:
2727
- build
2828
- test
2929
- Salsa-CI
30+
- sast
3031

3132
default:
3233
# Base image for builds and tests unless otherwise defined
@@ -42,7 +43,7 @@ variables:
4243
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"
4344
# Major version dictates which branches share the same ccache. E.g. 10.6-abc
4445
# and 10.6-xyz will have the same cache.
45-
MARIADB_MAJOR_VERSION: "10.8"
46+
MARIADB_MAJOR_VERSION: "11.0"
4647
# NOTE! Currently ccache is only used on the Centos8 build. As each job has
4748
# sufficiently different environments they are unable to benefit from each
4849
# other's ccaches. As each build generates about 1 GB of ccache, having
@@ -515,6 +516,70 @@ mini-benchmark:
515516
metrics:
516517
- metrics.txt
517518

519+
cppcheck:
520+
stage: sast
521+
needs: []
522+
variables:
523+
GIT_STRATEGY: fetch
524+
GIT_SUBMODULE_STRATEGY: normal
525+
script:
526+
- yum install -y cppcheck diffutils
527+
# --template: use a single-line template
528+
# --force: check large directories without warning
529+
# -i<directory>: ignore this directory when scanning
530+
# -j: run multiple cppcheck threads
531+
# Use newline to escape colon in yaml
532+
- >
533+
cppcheck --template="{file}:{line}: {severity}: {message}" --force
534+
client dbug extra include libmariadb libmysqld libservices mysql-test mysys mysys_ssl pcre plugin
535+
strings tests unittest vio wsrep-lib sql sql-common storage
536+
-istorage/mroonga -istorage/tokudb -istorage/spider -istorage/rocksdb -iextra/ -ilibmariadb/ -istorage/columnstore
537+
--output-file=cppcheck.txt -j $(nproc)
538+
# Parallel jobs may output findings in an nondeterministic order. Sort to match ignorelist.
539+
- cat cppcheck.txt | sort > cppcheck_sorted.txt
540+
# Remove line numbers for diff
541+
- sed 's/:[^:]*:/:/' cppcheck_sorted.txt > cppcheck_sorted_no_line_numbers.txt
542+
# Only print new issues not found in ignore list
543+
- echo "Problems found in ignore list that were not discovered by cppcheck (may have been fixed)."
544+
- diff --changed-group-format='%>' --unchanged-group-format='' cppcheck_sorted_no_line_numbers.txt tests/code_quality/cppcheck_ignorelist.txt || true
545+
- echo "Problems found by cppcheck that were not in ignore list."
546+
- diff --changed-group-format='%<' --unchanged-group-format='' cppcheck_sorted_no_line_numbers.txt tests/code_quality/cppcheck_ignorelist.txt > lines_not_ignored.txt || true
547+
- cat lines_not_ignored.txt && test ! -s lines_not_ignored.txt
548+
artifacts:
549+
when: always
550+
paths:
551+
- cppcheck_sorted.txt
552+
553+
flawfinder:
554+
stage: sast
555+
needs: []
556+
variables:
557+
GIT_STRATEGY: fetch
558+
GIT_SUBMODULE_STRATEGY: normal
559+
script:
560+
- yum install -y python3 python3-pip jq diffutils git
561+
- pip install flawfinder
562+
- flawfinder --falsepositive --quiet --html . > flawfinder-all-vulnerabilities.html
563+
- cat flawfinder-all-vulnerabilities.html | grep "Hits ="
564+
- flawfinder --falsepositive --quiet --minlevel=5 --sarif . > flawfinder-output.json
565+
# FlawFinder's --sarif output will display all vulnerabilities despite having --minlevel=5 specified.
566+
# Therefore, we postprocess the results with jq and filter out findings where the vulnerability level is less than 5.
567+
# Also in the SARIF output format, the vulnerabilities are ranked as 0.2/0.4/0.6/0.8/1.0 which correspond to the --minlevel=1/2/3/4/5 of FlawFinder.
568+
# Additionally, we sort the results because individual findings are consistent across different runs, but their ordering may not be.
569+
# Vulnerabilities can also be ignored in-line (/* Flawfinder: ignore */), but this option was chosen as to not clutter the codebase.
570+
- jq 'del(.runs[] | .tool | .driver | .rules) | del(.runs[] | .results[] | select(.rank < 1)) | del(.runs[] | .results[] | .locations[] | .physicalLocation | .region | .startLine) | .runs[0].results|=sort_by(.fingerprints)' flawfinder-output.json > flawfinder-min-level5.json
571+
# Diff against known vulnerabilities, but ignore the line number.
572+
- echo "Problems found in ignore list that were not discovered by flawfinder (may have been fixed)."
573+
- diff --changed-group-format='%>' --unchanged-group-format='' flawfinder-min-level5.json tests/code_quality/flawfinder_ignorelist.json || true
574+
- echo "Problems found by flawfinder that were not in ignore list."
575+
- diff --changed-group-format='%<' --unchanged-group-format='' flawfinder-min-level5.json tests/code_quality/flawfinder_ignorelist.json > lines_not_ignored.txt || true
576+
- cat lines_not_ignored.txt && test ! -s lines_not_ignored.txt
577+
artifacts:
578+
when: always
579+
paths:
580+
- flawfinder-all-vulnerabilities.html
581+
- flawfinder-min-level5.json
582+
518583
# Once all RPM builds and tests have passed, also run the DEB builds and tests
519584
# @NOTE: This is likely to work well only on salsa.debian.org as the Gitlab.com
520585
# runners are too small for everything this stage does.

.gitmodules

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
[submodule "libmariadb"]
22
path = libmariadb
33
url = https://github.com/MariaDB/mariadb-connector-c.git
4-
ignore = all
54
[submodule "storage/rocksdb/rocksdb"]
65
path = storage/rocksdb/rocksdb
76
url = https://github.com/facebook/rocksdb.git
8-
ignore = all
97
[submodule "wsrep-lib"]
108
path = wsrep-lib
119
url = https://github.com/codership/wsrep-lib.git
1210
branch = master
13-
ignore = all
1411
[submodule "extra/wolfssl/wolfssl"]
1512
path = extra/wolfssl/wolfssl
1613
url = https://github.com/wolfSSL/wolfssl.git
17-
ignore = all
1814
[submodule "storage/maria/libmarias3"]
1915
path = storage/maria/libmarias3
2016
url = https://github.com/mariadb-corporation/libmarias3.git
21-
ignore = all
2217
[submodule "storage/columnstore/columnstore"]
2318
path = storage/columnstore/columnstore
2419
url = https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
25-
ignore = all

BUILD/SETUP.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,14 @@ max_plugins="--with-plugins=max"
216216
max_no_embedded_configs="$max_plugins"
217217
max_no_qc_configs="$max_plugins --without-query-cache"
218218
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"
219-
all_configs="$max_plugins --with-embedded-server --with-innodb_plugin --with-libevent"
219+
all_configs="$max_configs"
220220

221221
#
222222
# CPU and platform specific compilation flags.
223223
#
224224
alpha_cflags="$check_cpu_cflags -Wa,-m$cpu_flag"
225-
amd64_cflags="$check_cpu_cflags"
226-
amd64_cxxflags="" # If dropping '--with-big-tables', add here "-DBIG_TABLES"
227225
pentium_cflags="$check_cpu_cflags -m32"
226+
amd64_cflags="$check_cpu_cflags -m64"
228227
pentium64_cflags="$check_cpu_cflags -m64"
229228
ppc_cflags="$check_cpu_cflags"
230229
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"

CODING_STANDARDS.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,23 @@ if (!condition)
118118
return success;
119119
```
120120

121+
#### Functions
122+
123+
Consecutive functions should be separated with 2 empty lines in between
124+
125+
```cpp
126+
void my_function_1()
127+
{
128+
<logic>
129+
}
130+
131+
132+
void my_function_2()
133+
{
134+
<logic>
135+
}
136+
```
137+
121138
### File names
122139

123140
File names should be lower case with underscore word separators.
@@ -218,11 +235,28 @@ Variables should be declared at the start of it's context (start of function, in
218235
The benefits of this:
219236
- Code lines gets shorter
220237
- It is easier to see the stack space used by a function.
221-
- It is easer to find the declaration of the variable.
238+
- It is easier to find the declaration of the variable.
222239
- If one has to add an 'if (error) goto end' construct, one can do
223240
that without having to move variable declarations around.
224241

225242

243+
### Variable initializations
244+
Variables can be initialized using assignment operator or initializer and expression list.
245+
For Example:
246+
247+
```cpp
248+
int milliseconds= 1000;
249+
char type= 't';
250+
```
251+
252+
Or
253+
254+
```cpp
255+
int milliseconds{1000};
256+
char type{'t'};
257+
```
258+
259+
226260
### Constant integers
227261
228262
Constant integers that are used to define elements such as buffer sizes should be defined rather than used directly.

0 commit comments

Comments
 (0)