Commit a3908e32 authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

Update upstream source from tag 'upstream/5.5.61'

Update to upstream version '5.5.61'
with Debian dir 20b939dcfbc305feda76bc5cca6748b5c526a79c
parents 908ae0c2 1627a8b1
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
...@@ -845,13 +846,10 @@ rec_get_converted_size_comp_prefix_low( ...@@ -845,13 +846,10 @@ rec_get_converted_size_comp_prefix_low(
if (fixed_len) { if (fixed_len) {
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
ulint mbminlen = DATA_MBMINLEN(col->mbminmaxlen);
ulint mbmaxlen = DATA_MBMAXLEN(col->mbminmaxlen);
ut_ad(len <= fixed_len); ut_ad(len <= fixed_len);
ut_ad(!mbmaxlen || len >= mbminlen ut_ad(!col->mbmaxlen || len >= col->mbminlen
* (fixed_len / mbmaxlen)); * (fixed_len / col->mbmaxlen));
/* dict_index_add_col() should guarantee this */ /* dict_index_add_col() should guarantee this */
ut_ad(!field->prefix_len ut_ad(!field->prefix_len
...@@ -1237,14 +1235,10 @@ rec_convert_dtuple_to_rec_comp( ...@@ -1237,14 +1235,10 @@ rec_convert_dtuple_to_rec_comp(
it is 128 or more, or when the field is stored externally. */ it is 128 or more, or when the field is stored externally. */
if (fixed_len) { if (fixed_len) {
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
ulint mbminlen = DATA_MBMINLEN(
ifield->col->mbminmaxlen);
ulint mbmaxlen = DATA_MBMAXLEN(
ifield->col->mbminmaxlen);
ut_ad(len <= fixed_len); ut_ad(len <= fixed_len);
ut_ad(!mbmaxlen || len >= mbminlen ut_ad(!ifield->col->mbmaxlen
* (fixed_len / mbmaxlen)); || len >= ifield->col->mbminlen
* (fixed_len / ifield->col->mbmaxlen));
ut_ad(!dfield_is_ext(field)); ut_ad(!dfield_is_ext(field));
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
} else if (dfield_is_ext(field)) { } else if (dfield_is_ext(field)) {
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
...@@ -528,7 +529,8 @@ row_ins_cascade_calc_update_vec( ...@@ -528,7 +529,8 @@ row_ins_cascade_calc_update_vec(
if (!dfield_is_null(&ufield->new_val) if (!dfield_is_null(&ufield->new_val)
&& dtype_get_at_most_n_mbchars( && dtype_get_at_most_n_mbchars(
col->prtype, col->mbminmaxlen, col->prtype,
col->mbminlen, col->mbmaxlen,
col->len, col->len,
ufield_len, ufield_len,
dfield_get_data(&ufield->new_val)) dfield_get_data(&ufield->new_val))
...@@ -2353,7 +2355,7 @@ row_ins_index_entry_set_vals( ...@@ -2353,7 +2355,7 @@ row_ins_index_entry_set_vals(
= dict_field_get_col(ind_field); = dict_field_get_col(ind_field);
len = dtype_get_at_most_n_mbchars( len = dtype_get_at_most_n_mbchars(
col->prtype, col->mbminmaxlen, col->prtype, col->mbminlen, col->mbmaxlen,
ind_field->prefix_len, ind_field->prefix_len,
len, dfield_get_data(row_field)); len, dfield_get_data(row_field));
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
...@@ -350,7 +351,7 @@ row_merge_buf_add( ...@@ -350,7 +351,7 @@ row_merge_buf_add(
if (ifield->prefix_len) { if (ifield->prefix_len) {
len = dtype_get_at_most_n_mbchars( len = dtype_get_at_most_n_mbchars(
col->prtype, col->prtype,
col->mbminmaxlen, col->mbminlen, col->mbmaxlen,
ifield->prefix_len, ifield->prefix_len,
len, dfield_get_data(field)); len, dfield_get_data(field));
dfield_set_len(field, len); dfield_set_len(field, len);
...@@ -360,8 +361,7 @@ row_merge_buf_add( ...@@ -360,8 +361,7 @@ row_merge_buf_add(
fixed_len = ifield->fixed_len; fixed_len = ifield->fixed_len;
if (fixed_len && !dict_table_is_comp(index->table) if (fixed_len && !dict_table_is_comp(index->table)
&& DATA_MBMINLEN(col->mbminmaxlen) && col->mbminlen != col->mbmaxlen) {
!= DATA_MBMAXLEN(col->mbminmaxlen)) {
/* CHAR in ROW_FORMAT=REDUNDANT is always /* CHAR in ROW_FORMAT=REDUNDANT is always
fixed-length, but in the temporary file it is fixed-length, but in the temporary file it is
variable-length for variable-length character variable-length for variable-length character
...@@ -371,14 +371,11 @@ row_merge_buf_add( ...@@ -371,14 +371,11 @@ row_merge_buf_add(
if (fixed_len) { if (fixed_len) {
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
ulint mbminlen = DATA_MBMINLEN(col->mbminmaxlen);
ulint mbmaxlen = DATA_MBMAXLEN(col->mbminmaxlen);
/* len should be between size calcualted base on /* len should be between size calcualted base on
mbmaxlen and mbminlen */ mbmaxlen and mbminlen */
ut_ad(len <= fixed_len); ut_ad(len <= fixed_len);
ut_ad(!mbmaxlen || len >= mbminlen ut_ad(!col->mbmaxlen || len >= col->mbminlen
* (fixed_len / mbmaxlen)); * (fixed_len / col->mbmaxlen));
ut_ad(!dfield_is_ext(field)); ut_ad(!dfield_is_ext(field));
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
...@@ -164,7 +165,7 @@ row_build_index_entry( ...@@ -164,7 +165,7 @@ row_build_index_entry(
/* If a column prefix index, take only the prefix. */ /* If a column prefix index, take only the prefix. */
if (ind_field->prefix_len) { if (ind_field->prefix_len) {
len = dtype_get_at_most_n_mbchars( len = dtype_get_at_most_n_mbchars(
col->prtype, col->mbminmaxlen, col->prtype, col->mbminlen, col->mbmaxlen,
ind_field->prefix_len, len, ind_field->prefix_len, len,
dfield_get_data(dfield)); dfield_get_data(dfield));
dfield_set_len(dfield, len); dfield_set_len(dfield, len);
...@@ -562,7 +563,8 @@ row_build_row_ref( ...@@ -562,7 +563,8 @@ row_build_row_ref(
dfield_set_len(dfield, dfield_set_len(dfield,
dtype_get_at_most_n_mbchars( dtype_get_at_most_n_mbchars(
dtype->prtype, dtype->prtype,
dtype->mbminmaxlen, dtype->mbminlen,
dtype->mbmaxlen,
clust_col_prefix_len, clust_col_prefix_len,
len, (char*) field)); len, (char*) field));
} }
...@@ -676,7 +678,8 @@ row_build_row_ref_in_tuple( ...@@ -676,7 +678,8 @@ row_build_row_ref_in_tuple(
dfield_set_len(dfield, dfield_set_len(dfield,
dtype_get_at_most_n_mbchars( dtype_get_at_most_n_mbchars(
dtype->prtype, dtype->prtype,
dtype->mbminmaxlen, dtype->mbminlen,
dtype->mbmaxlen,
clust_col_prefix_len, clust_col_prefix_len,
len, (char*) field)); len, (char*) field));
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc. Copyright (c) 2008, Google Inc.
Copyright (c) 2018, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described Google, Inc. Those modifications are gratefully acknowledged and are described
...@@ -92,8 +93,10 @@ row_sel_sec_rec_is_for_blob( ...@@ -92,8 +93,10 @@ row_sel_sec_rec_is_for_blob(
/*========================*/ /*========================*/
ulint mtype, /*!< in: main type */ ulint mtype, /*!< in: main type */
ulint prtype, /*!< in: precise type */ ulint prtype, /*!< in: precise type */
ulint mbminmaxlen, /*!< in: minimum and maximum length of ulint mbminlen, /*!< in: minimum length of
a multi-byte character */ a character, in bytes */
ulint mbmaxlen, /*!< in: maximum length of
a character, in bytes */
const byte* clust_field, /*!< in: the locally stored part of const byte* clust_field, /*!< in: the locally stored part of
the clustered index column, including the clustered index column, including
the BLOB pointer; the clustered the BLOB pointer; the clustered
...@@ -143,7 +146,7 @@ row_sel_sec_rec_is_for_blob( ...@@ -143,7 +146,7 @@ row_sel_sec_rec_is_for_blob(
return(FALSE); return(FALSE);
} }
len = dtype_get_at_most_n_mbchars(prtype, mbminmaxlen, len = dtype_get_at_most_n_mbchars(prtype, mbminlen, mbmaxlen,
prefix_len, len, (const char*) buf); prefix_len, len, (const char*) buf);
return(!cmp_data_data(mtype, prtype, buf, len, sec_field, sec_len)); return(!cmp_data_data(mtype, prtype, buf, len, sec_field, sec_len));
...@@ -227,14 +230,14 @@ row_sel_sec_rec_is_for_clust_rec( ...@@ -227,14 +230,14 @@ row_sel_sec_rec_is_for_clust_rec(
} }
len = dtype_get_at_most_n_mbchars( len = dtype_get_at_most_n_mbchars(
col->prtype, col->mbminmaxlen, col->prtype, col->mbminlen, col->mbmaxlen,
ifield->prefix_len, len, (char*) clust_field); ifield->prefix_len, len, (char*) clust_field);
if (rec_offs_nth_extern(clust_offs, clust_pos) if (rec_offs_nth_extern(clust_offs, clust_pos)
&& len < sec_len) { && len < sec_len) {
if (!row_sel_sec_rec_is_for_blob( if (!row_sel_sec_rec_is_for_blob(
col->mtype, col->prtype, col->mtype, col->prtype,
col->mbminmaxlen, col->mbminlen, col->mbmaxlen,
clust_field, clust_len, clust_field, clust_len,
sec_field, sec_len, sec_field, sec_len,
ifield->prefix_len, ifield->prefix_len,
...@@ -4431,6 +4434,7 @@ row_search_for_mysql( ...@@ -4431,6 +4434,7 @@ row_search_for_mysql(
prebuilt->new_rec_locks = 1; prebuilt->new_rec_locks = 1;
} }
err = DB_SUCCESS; err = DB_SUCCESS;
/* fall through */
case DB_SUCCESS: case DB_SUCCESS:
break; break;
case DB_LOCK_WAIT: case DB_LOCK_WAIT:
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
...@@ -1008,7 +1009,7 @@ row_upd_index_replace_new_col_val( ...@@ -1008,7 +1009,7 @@ row_upd_index_replace_new_col_val(
} }
len = dtype_get_at_most_n_mbchars(col->prtype, len = dtype_get_at_most_n_mbchars(col->prtype,
col->mbminmaxlen, col->mbminlen, col->mbmaxlen,
field->prefix_len, len, field->prefix_len, len,
(const char*) data); (const char*) data);
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB # Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
# This file is public domain and comes with NO WARRANTY of any kind # This file is public domain and comes with NO WARRANTY of any kind
# MySQL daemon start/stop script. # MariaDB daemon start/stop script.
# Usually this is put in /etc/init.d (at least on machines SYSV R4 based # Usually this is put in /etc/init.d (at least on machines SYSV R4 based
# systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql. # systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql.
...@@ -21,14 +21,14 @@ ...@@ -21,14 +21,14 @@
# Required-Stop: $local_fs $network $remote_fs # Required-Stop: $local_fs $network $remote_fs
# Default-Start: 2 3 4 5 # Default-Start: 2 3 4 5
# Default-Stop: 0 1 6 # Default-Stop: 0 1 6
# Short-Description: start and stop MySQL # Short-Description: start and stop MariaDB
# Description: MySQL is a very fast and reliable SQL database engine. # Description: MariaDB is a very fast and reliable SQL database engine.
### END INIT INFO ### END INIT INFO
# If you install MySQL on some other places than @prefix@, then you # If you install MariaDB on some other places than @prefix@, then you
# have to do one of the following things for this script to work: # have to do one of the following things for this script to work:
# #
# - Run this script from within the MySQL installation directory # - Run this script from within the MariaDB installation directory
# - Create a /etc/my.cnf file with the following information: # - Create a /etc/my.cnf file with the following information:
# [mysqld] # [mysqld]
# basedir=<path-to-mysql-installation-directory> # basedir=<path-to-mysql-installation-directory>
...@@ -37,11 +37,11 @@ ...@@ -37,11 +37,11 @@
# - Add the path to the mysql-installation-directory to the basedir variable # - Add the path to the mysql-installation-directory to the basedir variable
# below. # below.
# #
# If you want to affect other MySQL variables, you should make your changes # If you want to affect other MariaDB variables, you should make your changes
# in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files. # in the /etc/my.cnf, ~/.my.cnf or other MariaDB configuration files.
# If you change base dir, you must also change datadir. These may get # If you change base dir, you must also change datadir. These may get
# overwritten by settings in the MySQL configuration files. # overwritten by settings in the MariaDB configuration files.
basedir= basedir=
datadir= datadir=
...@@ -291,7 +291,7 @@ case "$mode" in ...@@ -291,7 +291,7 @@ case "$mode" in
# Safeguard (relative paths, core dumps..) # Safeguard (relative paths, core dumps..)
cd $basedir cd $basedir
echo $echo_n "Starting MySQL" echo $echo_n "Starting MariaDB"
if test -x $bindir/mysqld_safe if test -x $bindir/mysqld_safe
then then
# Give extra arguments to mysqld with the my.cnf file. This script # Give extra arguments to mysqld with the my.cnf file. This script
...@@ -307,7 +307,7 @@ case "$mode" in ...@@ -307,7 +307,7 @@ case "$mode" in
exit $return_value exit $return_value
else else
log_failure_msg "Couldn't find MySQL server ($bindir/mysqld_safe)" log_failure_msg "Couldn't find MariaDB server ($bindir/mysqld_safe)"
fi fi
;; ;;
...@@ -321,12 +321,12 @@ case "$mode" in ...@@ -321,12 +321,12 @@ case "$mode" in
if (kill -0 $mysqld_pid 2>/dev/null) if (kill -0 $mysqld_pid 2>/dev/null)
then then
echo $echo_n "Shutting down MySQL" echo $echo_n "Shutting down MariaDB"
kill $mysqld_pid kill $mysqld_pid
# mysqld should remove the pid file when it exits, so wait for it. # mysqld should remove the pid file when it exits, so wait for it.
wait_for_gone $mysqld_pid "$mysqld_pid_file_path"; return_value=$? wait_for_gone $mysqld_pid "$mysqld_pid_file_path"; return_value=$?
else else
log_failure_msg "MySQL server process #$mysqld_pid is not running!" log_failure_msg "MariaDB server process #$mysqld_pid is not running!"
rm "$mysqld_pid_file_path" rm "$mysqld_pid_file_path"
fi fi
...@@ -337,7 +337,7 @@ case "$mode" in ...@@ -337,7 +337,7 @@ case "$mode" in
fi fi
exit $return_value exit $return_value
else else
log_failure_msg "MySQL server PID file could not be found!" log_failure_msg "MariaDB server PID file could not be found!"
fi fi
;; ;;
...@@ -355,10 +355,10 @@ case "$mode" in ...@@ -355,10 +355,10 @@ case "$mode" in
'reload'|'force-reload') 'reload'|'force-reload')
if test -s "$mysqld_pid_file_path" ; then if test -s "$mysqld_pid_file_path" ; then
read mysqld_pid < "$mysqld_pid_file_path" read mysqld_pid < "$mysqld_pid_file_path"
kill -HUP $mysqld_pid && log_success_msg "Reloading service MySQL" kill -HUP $mysqld_pid && log_success_msg "Reloading service MariaDB"
touch "$mysqld_pid_file_path" touch "$mysqld_pid_file_path"
else else
log_failure_msg "MySQL PID file could not be found!" log_failure_msg "MariaDB PID file could not be found!"
exit 1 exit 1
fi fi
;; ;;
...@@ -367,10 +367,10 @@ case "$mode" in ...@@ -367,10 +367,10 @@ case "$mode" in
if test -s "$mysqld_pid_file_path" ; then if test -s "$mysqld_pid_file_path" ; then
read mysqld_pid < "$mysqld_pid_file_path" read mysqld_pid < "$mysqld_pid_file_path"
if kill -0 $mysqld_pid 2>/dev/null ; then if kill -0 $mysqld_pid 2>/dev/null ; then
log_success_msg "MySQL running ($mysqld_pid)" log_success_msg "MariaDB running ($mysqld_pid)"
exit 0 exit 0
else else
log_failure_msg "MySQL is not running, but PID file exists" log_failure_msg "MariaDB is not running, but PID file exists"
exit 1 exit 1
fi fi
else else
...@@ -380,17 +380,17 @@ case "$mode" in ...@@ -380,17 +380,17 @@ case "$mode" in
# test if multiple pids exist # test if multiple pids exist
pid_count=`echo $mysqld_pid | wc -w` pid_count=`echo $mysqld_pid | wc -w`
if test $pid_count -gt 1 ; then if test $pid_count -gt 1 ; then
log_failure_msg "Multiple MySQL running but PID file could not be found ($mysqld_pid)" log_failure_msg "Multiple MariaDB running but PID file could not be found ($mysqld_pid)"
exit 5 exit 5
elif test -z $mysqld_pid ; then elif test -z $mysqld_pid ; then
if test -f "$lock_file_path" ; then if test -f "$lock_file_path" ; then
log_failure_msg "MySQL is not running, but lock file ($lock_file_path) exists" log_failure_msg "MariaDB is not running, but lock file ($lock_file_path) exists"
exit 2 exit 2
fi fi
log_failure_msg "MySQL is not running" log_failure_msg "MariaDB is not running"
exit 3 exit 3
else else
log_failure_msg "MySQL is running but PID file could not be found" log_failure_msg "MariaDB is running but PID file could not be found"
exit 4 exit 4
fi fi
fi fi
...@@ -398,7 +398,7 @@ case "$mode" in ...@@ -398,7 +398,7 @@ case "$mode" in
'configtest') 'configtest')
# Safeguard (relative paths, core dumps..) # Safeguard (relative paths, core dumps..)
cd $basedir cd $basedir
echo $echo_n "Testing MySQL configuration syntax" echo $echo_n "Testing MariaDB configuration syntax"
daemon=$bindir/mysqld daemon=$bindir/mysqld
if test -x $libexecdir/mysqld if test -x $libexecdir/mysqld
then then
...@@ -425,7 +425,7 @@ case "$mode" in ...@@ -425,7 +425,7 @@ case "$mode" in
*) *)
# usage # usage
basename=`basename "$0"` basename=`basename "$0"`
echo "Usage: $basename {start|stop|restart|reload|force-reload|status|configtest} [ MySQL server options ]" echo "Usage: $basename {start|stop|restart|reload|force-reload|status|configtest} [ MariaDB server options ]"
exit 1 exit 1
;; ;;
esac esac
......
...@@ -91,6 +91,9 @@ main(int argc __attribute__((unused)),char *argv[]) ...@@ -91,6 +91,9 @@ main(int argc __attribute__((unused)),char *argv[])
diag("src length: %.8x, dst length: %.8x\n", diag("src length: %.8x, dst length: %.8x\n",
(uint) src_len, (uint) dst_len); (uint) src_len, (uint) dst_len);
} }
free(dst);
free(str);
free(src);
} }
my_end(0); my_end(0);
return exit_status(); return exit_status();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment