Skip to content

Commit 0427c47

Browse files
committed
Merge tag '11.1' into 11.2
MariaDB 11.1.3 release
2 parents e6acddf + 0f5613a commit 0427c47

File tree

608 files changed

+15613
-9159
lines changed

Some content is hidden

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

608 files changed

+15613
-9159
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
MYSQL_VERSION_MAJOR=11
22
MYSQL_VERSION_MINOR=2
33
MYSQL_VERSION_PATCH=2
4-
SERVER_MATURITY=gamma
4+
SERVER_MATURITY=stable

client/mysqladmin.cc

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ int main(int argc,char *argv[])
441441
if (error > 0)
442442
break;
443443

444+
error= -error; /* don't exit with negative error codes */
444445
/*
445446
Command was well-formed, but failed on the server. Might succeed
446447
on retry (if conditions on server change etc.), but needs --force
@@ -1129,24 +1130,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
11291130
else
11301131
if (mysql_query(mysql,buff))
11311132
{
1132-
if (mysql_errno(mysql)!=1290)
1133-
{
1134-
my_printf_error(0,"unable to change password; error: '%s'",
1135-
error_flags, mysql_error(mysql));
1136-
}
1137-
else
1138-
{
1139-
/*
1140-
We don't try to execute 'update mysql.user set..'
1141-
because we can't perfectly find out the host
1142-
*/
1143-
my_printf_error(0,"\n"
1144-
"You cannot use 'password' command as mariadbd runs\n"
1145-
" with grant tables disabled (was started with"
1146-
" --skip-grant-tables).\n"
1147-
"Use: \"mysqladmin flush-privileges password '*'\""
1148-
" instead", error_flags);
1149-
}
1133+
my_printf_error(0,"unable to change password; error: '%s'",
1134+
error_flags, mysql_error(mysql));
11501135
ret = -1;
11511136
}
11521137
password_done:

client/mysqlbinlog.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3422,8 +3422,13 @@ int main(int argc, char** argv)
34223422

34233423
if (tmpdir.list)
34243424
free_tmpdir(&tmpdir);
3425-
if (result_file && result_file != stdout)
3426-
my_fclose(result_file, MYF(0));
3425+
if (result_file)
3426+
{
3427+
if (result_file != stdout)
3428+
my_fclose(result_file, MYF(0));
3429+
else
3430+
fflush(result_file);
3431+
}
34273432

34283433
/*
34293434
Ensure the GTID state is correct. If not, end in error.

client/mysqldump.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1912,8 +1912,13 @@ static FILE* open_sql_file_for_table(const char* table, int flags)
19121912

19131913
static void free_resources()
19141914
{
1915-
if (md_result_file && md_result_file != stdout)
1916-
my_fclose(md_result_file, MYF(0));
1915+
if (md_result_file)
1916+
{
1917+
if (md_result_file != stdout)
1918+
my_fclose(md_result_file, MYF(0));
1919+
else
1920+
fflush(md_result_file);
1921+
}
19171922
if (get_table_name_result)
19181923
mysql_free_result(get_table_name_result);
19191924
if (routine_res)

extra/mariabackup/ds_local.cc

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
2828
#include <winioctl.h>
2929
#endif
3030

31+
#ifdef HAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE
32+
#include <linux/falloc.h>
33+
#endif
34+
3135
typedef struct {
3236
File fd;
3337
my_bool init_ibd_done;
@@ -160,9 +164,18 @@ static int write_compressed(File fd, uchar *data, size_t len, size_t pagesize)
160164
if (datasize < n_bytes) {
161165
/* This punches a "hole" in the file. */
162166
size_t hole_bytes = n_bytes - datasize;
163-
if (my_seek(fd, hole_bytes, MY_SEEK_CUR, MYF(MY_WME | MY_NABP))
164-
== MY_FILEPOS_ERROR)
165-
return 1;
167+
my_off_t off = my_seek(fd, hole_bytes, MY_SEEK_CUR, MYF(MY_WME | MY_NABP));
168+
if (off == MY_FILEPOS_ERROR)
169+
return 1;
170+
#ifdef HAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE
171+
/* punch holes harder for filesystems (like XFS) that
172+
heuristically decide whether leave a hole after the
173+
above or not based on the current access pattern
174+
(which is sequential write and not at all typical for
175+
what InnoDB will be doing with the file later */
176+
fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
177+
off - hole_bytes, hole_bytes);
178+
#endif
166179
}
167180
written += n_bytes;
168181
ptr += n_bytes;

extra/mariabackup/xtrabackup.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,7 +1886,7 @@ static int prepare_export()
18861886
IF_WIN("\"","") "\"%s\" --mysqld \"%s\""
18871887
" --defaults-extra-file=./backup-my.cnf --defaults-group-suffix=%s --datadir=."
18881888
" --innodb --innodb-fast-shutdown=0 --loose-partition"
1889-
" --innodb_purge_rseg_truncate_frequency=1 --innodb-buffer-pool-size=%llu"
1889+
" --innodb-buffer-pool-size=%llu"
18901890
" --console --skip-log-error --skip-log-bin --bootstrap %s< "
18911891
BOOTSTRAP_FILENAME IF_WIN("\"",""),
18921892
mariabackup_exe,
@@ -1900,7 +1900,7 @@ static int prepare_export()
19001900
IF_WIN("\"","") "\"%s\" --mysqld"
19011901
" --defaults-file=./backup-my.cnf --defaults-group-suffix=%s --datadir=."
19021902
" --innodb --innodb-fast-shutdown=0 --loose-partition"
1903-
" --innodb_purge_rseg_truncate_frequency=1 --innodb-buffer-pool-size=%llu"
1903+
" --innodb-buffer-pool-size=%llu"
19041904
" --console --log-error= --skip-log-bin --bootstrap %s< "
19051905
BOOTSTRAP_FILENAME IF_WIN("\"",""),
19061906
mariabackup_exe,

include/m_ctype.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,6 +1865,9 @@ my_well_formed_length(CHARSET_INFO *cs, const char *b, const char *e,
18651865
#include "t_ctype.h"
18661866
#endif
18671867

1868+
int my_wc_mb_utf8mb4_bmp_only(CHARSET_INFO *cs, my_wc_t wc, uchar *r,
1869+
uchar *e);
1870+
18681871
#ifdef __cplusplus
18691872
}
18701873
#endif

include/my_compare.h

Lines changed: 129 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,135 @@ static inline void set_rec_bits(uint16 bits, uchar *ptr, uchar ofs, uint len)
110110
#define clr_rec_bits(bit_ptr, bit_ofs, bit_len) \
111111
set_rec_bits(0, bit_ptr, bit_ofs, bit_len)
112112

113-
extern int ha_compare_text(CHARSET_INFO *, const uchar *, size_t,
114-
const uchar *, size_t , my_bool);
113+
114+
/*
115+
Compare two VARCHAR values.
116+
@param charset_info - The character set and collation
117+
@param a - The pointer to the first string
118+
@param a_length - The length of the first string
119+
@param b - The pointer to the second string
120+
@param b_length - The length of the second string
121+
@param b_is_prefix - Whether "b" is a prefix of "a",
122+
e.g. in a prefix key (partial length key).
123+
@returns - The result of comparison
124+
125+
- If "b_is_prefix" is FALSE, then the two strings are compared
126+
taking into account the PAD SPACE/NO PAD attribute of the collation.
127+
128+
- If "b_is_prefix" is TRUE, then trailing spaces are compared in NO PAD style.
129+
This is done e.g. when we compare a column value to its prefix key value
130+
(the value of "a" to the value of "key_a"):
131+
CREATE TABLE t1 (a VARCHAR(10), KEY(key_a(5));
132+
*/
133+
static inline int ha_compare_char_varying(CHARSET_INFO *charset_info,
134+
const uchar *a, size_t a_length,
135+
const uchar *b, size_t b_length,
136+
my_bool b_is_prefix)
137+
{
138+
if (!b_is_prefix)
139+
return charset_info->coll->strnncollsp(charset_info, a, a_length,
140+
b, b_length);
141+
return charset_info->coll->strnncoll(charset_info,
142+
a, a_length,
143+
b, b_length, TRUE/*prefix*/);
144+
}
145+
146+
147+
/*
148+
Compare two CHAR values of the same declared character length,
149+
e.g. CHAR(5) to CHAR(5).
150+
151+
@param charset_info - The character set and collation
152+
@param a - The pointer to the first string
153+
@param a_length - The length of the first string
154+
@param b - The pointer to the second string
155+
@param b_length - The length of the second string
156+
@param nchars - The declared length (in characters)
157+
@param b_is_prefix - Whether "b" is a prefix of "a",
158+
e.g. in a prefix key (partial length key).
159+
@returns - The result of comparison
160+
161+
- If "b_is_prefix" is FALSE, then the two strings are compared
162+
taking into account the PAD SPACE/NO PAD attribute of the collation.
163+
Additionally, this function assumes that the underlying storage could
164+
optionally apply trailing space compression, so values can come into this
165+
comparison function in different states:
166+
- all trailing spaces removed
167+
- some trailing spaced removed
168+
- no trailing spaces removed (exactly "nchars" characters on the two sides)
169+
This function virtually reconstructs trailing spaces up to the defined
170+
length specified in "nchars".
171+
If either of the sides have more than "nchar" characters,
172+
then only leftmost "nchar" characters are compared.
173+
174+
- If "b_is_prefix" is TRUE, then trailing spaces are compared in NO PAD style.
175+
This is done e.g. when we compare a column value to its prefix key value
176+
(the value of "a" to the value of "key_a"):
177+
CREATE TABLE t1 (a CHAR(10), KEY(key_a(5));
178+
*/
179+
static inline int ha_compare_char_fixed(CHARSET_INFO *charset_info,
180+
const uchar *a, size_t a_length,
181+
const uchar *b, size_t b_length,
182+
size_t nchars,
183+
my_bool b_is_prefix)
184+
{
185+
if (!b_is_prefix)
186+
return charset_info->coll->strnncollsp_nchars(charset_info,
187+
a, a_length,
188+
b, b_length,
189+
nchars,
190+
MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES);
191+
return charset_info->coll->strnncoll(charset_info,
192+
a, a_length,
193+
b, b_length, TRUE/*prefix*/);
194+
}
195+
196+
197+
/*
198+
A function to compare words of a text.
199+
This is a common operation in full-text search:
200+
SELECT MATCH (title) AGAINST ('word') FROM t1;
201+
*/
202+
static inline int ha_compare_word(CHARSET_INFO *charset_info,
203+
const uchar *a, size_t a_length,
204+
const uchar *b, size_t b_length)
205+
{
206+
return charset_info->coll->strnncollsp(charset_info,
207+
a, a_length,
208+
b, b_length);
209+
}
210+
211+
212+
/*
213+
A function to compare a word of a text to a word prefix.
214+
This is a common operation in full-text search:
215+
SELECT MATCH (title) AGAINST ('wor*' IN BOOLEAN MODE) FROM t1;
216+
*/
217+
static inline int ha_compare_word_prefix(CHARSET_INFO *charset_info,
218+
const uchar *a, size_t a_length,
219+
const uchar *b, size_t b_length)
220+
{
221+
return charset_info->coll->strnncoll(charset_info,
222+
a, a_length,
223+
b, b_length,
224+
TRUE/*b_is_prefix*/);
225+
}
226+
227+
228+
/*
229+
Compare words (full match or prefix match), e.g. for full-text search.
230+
*/
231+
static inline int ha_compare_word_or_prefix(CHARSET_INFO *charset_info,
232+
const uchar *a, size_t a_length,
233+
const uchar *b, size_t b_length,
234+
my_bool b_is_prefix)
235+
{
236+
if (!b_is_prefix)
237+
return ha_compare_word(charset_info, a, a_length, b, b_length);
238+
return ha_compare_word_prefix(charset_info, a, a_length, b, b_length);
239+
}
240+
241+
115242
extern int ha_key_cmp(HA_KEYSEG *keyseg, const uchar *a,
116243
const uchar *b, uint key_length, uint nextflag,
117244
uint *diff_pos);

libmariadb

libmysqld/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ ENDIF()
5151
SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
5252
libmysql.c ../sql-common/errmsg.c
5353
../sql-common/client.c
54+
../sql/cset_narrowing.cc
5455
../sql-common/my_user.c ../sql-common/pack.c
5556
../sql-common/client_plugin.c
5657
../sql/password.c ../sql/discover.cc ../sql/derror.cc

0 commit comments

Comments
 (0)