Skip to content

Commit f4b950d

Browse files
author
monty@mashka.mysql.fi
committed
Merge with 3.23
2 parents c16e908 + 6250c1d commit f4b950d

27 files changed

+89
-49
lines changed

Makefile.am

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ AUTOMAKE_OPTIONS = foreign
2121
# These are built from source in the Docs directory
2222
EXTRA_DIST = INSTALL-SOURCE README \
2323
COPYING COPYING.LIB
24-
SUBDIRS = include @docs_dirs@ @readline_dir@ \
24+
SUBDIRS = . include @docs_dirs@ @readline_dir@ \
2525
@thread_dirs@ pstack @sql_client_dirs@ \
26-
@sql_server_dirs@ @libmysqld_dirs@ scripts man \
27-
tests BUILD os2 \
26+
@sql_server_dirs@ scripts man tests \
27+
BUILD os2 libmysql_r @libmysqld_dirs@ \
2828
@bench_dirs@ support-files @fs_dirs@ @tools_dirs@
2929

3030
# Relink after clean

bdb/dist/aclocal/mutex.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ fi
279279
dnl Sparc/gcc: SunOS, Solaris
280280
dnl The sparc/gcc code doesn't always work, specifically, I've seen assembler
281281
dnl failures from the stbar instruction on SunOS 4.1.4/sun4c and gcc 2.7.2.2.
282-
if test "$db_cv_mutex" = DOESNT_WORK; then
282+
if test "$db_cv_mutex" = no; then
283283
AC_TRY_RUN([main(){
284284
#if defined(__sparc__)
285285
#if defined(__GNUC__)

bdb/include/mutex.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ typedef unsigned char tsl_t;
327327
*/
328328
#define MUTEX_SET(tsl) ({ \
329329
register tsl_t *__l = (tsl); \
330-
int __r; \
330+
unsigned char __r; \
331331
asm volatile("tas %1; \n \
332332
seq %0" \
333333
: "=dm" (__r), "=m" (*__l) \

client/mysqltest.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
4343
**********************************************************************/
4444

45-
#define MTEST_VERSION "1.26"
45+
#define MTEST_VERSION "1.27"
4646

4747
#include <my_global.h>
4848
#include <mysql_embed.h>
@@ -677,7 +677,7 @@ int open_file(const char* name)
677677

678678
if (*cur_file && cur_file == file_stack_end)
679679
die("Source directives are nesting too deep");
680-
if (!(*(cur_file+1) = my_fopen(buff, O_RDONLY, MYF(MY_WME))))
680+
if (!(*(cur_file+1) = my_fopen(buff, O_RDONLY | O_BINARY, MYF(MY_WME))))
681681
die(NullS);
682682
cur_file++;
683683
*++lineno=1;
@@ -1912,7 +1912,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
19121912
argument= buff;
19131913
}
19141914
fn_format(buff, argument, "", "", 4);
1915-
if (!(*++cur_file = my_fopen(buff, O_RDONLY, MYF(MY_WME))))
1915+
if (!(*++cur_file = my_fopen(buff, O_RDONLY | O_BINARY, MYF(MY_WME))))
19161916
die("Could not open %s: errno = %d", argument, errno);
19171917
break;
19181918
}

libmysql/Makefile.shared

+2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ clean-local:
8484
rm -f `echo $(mystringsobjects) | sed "s;\.lo;.c;g"` \
8585
`echo $(dbugobjects) | sed "s;\.lo;.c;g"` \
8686
`echo $(mysysobjects) | sed "s;\.lo;.c;g"` \
87+
`echo $(vio_objects) | sed "s;\.lo;.c;g"` \
88+
$(CHARSET_SRCS) $(CHARSET_OBJS) \
8789
$(mystringsextra) $(mystringsgen) $(mysysheaders) \
8890
ctype_extra_sources.c net.c ../linked_client_sources
8991

ltconfig

+10
Original file line numberDiff line numberDiff line change
@@ -3009,6 +3009,16 @@ hardcode_action=$hardcode_action
30093009
# This must work even if \$libdir does not exist.
30103010
hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec
30113011
3012+
# Check if debuild is being run by the current shell. If it is then,
3013+
# the DEB_BUILD_ARCH variable should be of non-zero length, indicating
3014+
# that we are in the middle of a Debian package build (assuming the
3015+
# user isn't doing anything strange with environment variables).
3016+
if test -n "`dpkg-architecture -qDEB_BUILD_ARCH`" && ps | grep debuild | grep -v grep > /dev/null; then
3017+
# Debian policy mandates that rpaths should not be encoded into a binary
3018+
# so it is overridden.
3019+
hardcode_libdir_flag_spec=" -D_DEBIAN_PATCHED_LIBTOOL_ "
3020+
fi
3021+
30123022
# Whether we need a single -rpath flag with a separated argument.
30133023
hardcode_libdir_separator=$hardcode_libdir_separator
30143024

man/isamchk.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH ISAMCHK 1 "19 December 2000"
1+
.TH isamchk 1 "19 December 2000" "MySQL 3.23" "MySQL database"
22
.SH NAME
33
.BR isamchk
44
\- Description, check and repair of ISAM tables.

man/isamlog.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH ISAMLOG 1 "20 December 2000"
1+
.TH isamlog 1 "19 December 2000" "MySQL 3.23" "MySQL database"
22
.SH NAME
33
isamlog - Write info about whats in a nisam log file.
44
.SH USAGE

man/mysql.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH MYSQL 1 "13 June 1997"
1+
.TH mysql 1 "19 December 2000" "MySQL 3.23" "MySQL database"
22
.SH NAME
33
mysql \- text-based client for mysqld, a SQL-based relational database daemon
44
.SH SYNOPSIS

man/mysql_zap.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH ZAP 1 "20 December 2000"
1+
.TH zap 1 "19 December 2000" "MySQL 3.23" "MySQL database"
22
.SH NAME
33
zap - a perl script used to kill processes
44
.SH USAGE

man/mysqlaccess.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH MYSQLACCESS 1 "19 December 2000"
1+
.TH mysqlaccess 1 "19 December 2000" "MySQL 3.23" "MySQL database"
22
.SH NAME
33
.BR mysqlaccess
44
\- Create new users to mysql.

man/mysqladmin.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH MYSQLADMIN 1 "18 December 2000"
1+
.TH mysqladmin 1 "19 December 2000" "MySQL 3.23" "MySQL database"
22
.SH NAME
33
mysqladmin [OPTIONS] command command.... \- A utility for performing administrative operations
44
.SH OPTION SYNOPSIS

man/mysqld.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH MYSQLD 1 "19 December 2000"
1+
.TH mysqld 1 "19 December 2000" "MySQL 3.23" "MySQL database"
22
.SH NAME
33
.BR mysqld
44
\- Starts the MySQL server demon

man/mysqld_multi.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH MYSQLD_MULTI 1 "20 December 2000"
1+
.TH mysqld_multi 1 "19 December 2000" "MySQL 3.23" "MySQL database"
22
.SH NAME
33
mysqld_multi - is meant for managing several mysqld processes running in different UNIX sockets and TCP/IP ports.
44
.SH USAGE

man/mysqld_safe.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH SAFE_MYSQLD 1 "19 December 2000" "safe_mysqld (mysql)" mysql.com
1+
.TH safe_mysqld 1 "19 December 2000" "MySQL 3.23" "MySQL database"
22
.SH NAME
33
mysqld_safe \- start the mysqld daemon on Unix.
44
.SH SYNOPSIS

man/mysqldump.1

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH MYSQLDUMP 1 "19 December 2000"
1+
.TH mysqldump 1 "19 December 2000" "MySQL 3.23" "MySQL database"
22
.SH NAME
33
mysqldump \- text-based client for dumping or backing up mysql databases , tables and or data.
44

@@ -123,7 +123,7 @@ Connect to host.
123123
Lock all tables for read.
124124
.TP
125125
.BR \-n | \-\-no\-create\-db
126-
'CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name;'
126+
\&'CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name;'
127127
will not be put in the output. The above line will
128128
be added otherwise, if
129129
.BR \-\-databases
@@ -270,4 +270,4 @@ Manual page by L. (Kill-9) Pedersen
270270
(kill-9@kill-9.dk), Mercurmedia Data Model Architect /
271271
system developer (http://www.mercurmedia.com)
272272

273-
.\" end of man page
273+
.\" end of man page

man/mysqlshow.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH MYSQLSHOW 1 "19 December 2000"
1+
.TH mysqlshow 1 "19 December 2000" "MySQL 3.23" "MySQL database"
22
.SH NAME
33
.BR mysqlshow
44
\- Shows the structure of a mysql database (databases,tables and columns)

man/perror.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH PERROR 1 "19 December 2000"
1+
.TH perror 1 "19 December 2000" "MySQL 3.23" "MySQL database"
22
.SH NAME
33
.BR perror
44
can be used to display a description for a system error code, or an MyISAM/ISAM table handler error code. The error messages are mostly system dependent.

man/replace.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH REPLACE 1 "20 December 2000"
1+
.TH replace 1 "19 December 2000" "MySQL 3.23" "MySQL database"
22
.SH NAME
33
.TP
44
replace - A utility program that is used by msql2mysql, but that has more general applicability as well. replace changes strings in place in files or on the standard input. Uses a finite state machine to match longer strings first. Can be used to swap strings.

myisam/mi_create.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
228228
if (uniques)
229229
{
230230
max_key_block_length= myisam_block_size;
231-
max_key_length= MI_UNIQUE_HASH_LENGTH;
231+
max_key_length= MI_UNIQUE_HASH_LENGTH + pointer;
232232
}
233233

234234
for (i=0, keydef=keydefs ; i < keys ; i++ , keydef++)
@@ -449,7 +449,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
449449
share.base.keystart = share.state.state.key_file_length=
450450
MY_ALIGN(info_length, myisam_block_size);
451451
share.base.max_key_block_length=max_key_block_length;
452-
share.base.max_key_length=ALIGN_SIZE(max_key_length+4);
452+
share.base.max_key_length=ALIGN_SIZE(max_key_length[+4);
453453
share.base.records=ci->max_rows;
454454
share.base.reloc= ci->reloc_rows;
455455
share.base.reclength=real_reclength;

myisam/mi_unique.c

+10-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, byte *record,
2424
{
2525
my_off_t lastpos=info->lastpos;
2626
MI_KEYDEF *key= &info->s->keyinfo[def->key];
27-
uchar *key_buff=info->lastkey+info->s->base.max_key_length;
27+
uchar *key_buff=info->lastkey2;
2828
DBUG_ENTER("mi_check_unique");
2929

3030
mi_unique_store(record+key->seg->start, unique_hash);
@@ -80,7 +80,16 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record)
8080
if (keyseg->null_bit)
8181
{
8282
if (record[keyseg->null_pos] & keyseg->null_bit)
83+
{
84+
/*
85+
Change crc in a way different from an empty string or 0.
86+
(This is an optimisation; The code will work even if this isn't
87+
done)
88+
*/
89+
crc=((crc << 8) + 511+
90+
(crc >> (8*sizeof(ha_checksum)-8)));
8391
continue;
92+
}
8493
}
8594
pos= record+keyseg->start;
8695
if (keyseg->flag & HA_VAR_LENGTH)

mysql-test/t/group_by.test

+11
Original file line numberDiff line numberDiff line change
@@ -354,3 +354,14 @@ m.c1id = c1.id AND c1.active = 'Yes' LEFT JOIN t3 AS c2 ON m.c2id =
354354
c2.id AND c2.active = 'Yes' WHERE m.pid=1 AND (c1.id IS NOT NULL OR c2.id IS
355355
NOT NULL);
356356
drop table t1,t2,t3;
357+
358+
#
359+
# Test bug in GROUP BY on BLOB that is NULL or empty
360+
#
361+
362+
create table t1 (a blob null);
363+
insert into t1 values (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(""),(""),(""),("b");
364+
select a,count(*) from t1 group by a;
365+
set option sql_big_tables=1;
366+
select a,count(*) from t1 group by a;
367+
drop table t1;

scripts/mysql_fix_privilege_tables.sh

+24-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
#!/bin/sh
22

33
echo "This scripts updates the mysql.user, mysql.db, mysql.host and the"
4-
echo "mysql.func table to MySQL 3.22.14 and above."
4+
echo "mysql.func tables to MySQL 3.22.14 and above."
55
echo ""
66
echo "This is needed if you want to use the new GRANT functions,"
7-
echo "CREATE AGGREAGATE FUNCTION or want to use the more secure passwords in 3.23"
7+
echo "CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 3.23"
88
echo ""
9-
echo "If you get Access denied errors, you should run this script again"
10-
echo "and give the MySQL root user password as a argument!"
9+
echo "If you get 'Access denied' errors, you should run this script again"
10+
echo "and give the MySQL root user password as an argument!"
1111

1212
root_password="$1"
1313
host="localhost"
14+
user="root"
15+
16+
if test -z $1 ; then
17+
cmd="@bindir@/mysql -f --user=$user --host=$host mysql"
18+
else
19+
root_password="$1"
20+
cmd="@bindir@/mysql -f --user=$user --password=$root_password --host=$host mysql"
21+
fi
1422

1523
echo "Converting all privilege tables to MyISAM format"
16-
@bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
24+
$cmd <<END_OF_DATA
1725
ALTER TABLE user type=MyISAM;
1826
ALTER TABLE db type=MyISAM;
1927
ALTER TABLE host type=MyISAM;
@@ -28,7 +36,7 @@ echo ""
2836
echo "If your tables are already up to date or partially up to date you will"
2937
echo "get some warnings about 'Duplicated column name'. You can safely ignore these!"
3038

31-
@bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
39+
$cmd <<END_OF_DATA
3240
alter table user change password password char(16) NOT NULL;
3341
alter table user add File_priv enum('N','Y') NOT NULL;
3442
CREATE TABLE if not exists func (
@@ -45,7 +53,7 @@ echo ""
4553

4654
echo "Creating Grant Alter and Index privileges if they don't exists"
4755
echo "You can ignore any Duplicate column errors"
48-
@bindir@/mysql --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
56+
$cmd <<END_OF_DATA
4957
alter table user add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL;
5058
alter table host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL;
5159
alter table db add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL;
@@ -59,7 +67,7 @@ echo ""
5967
if test $res = 0
6068
then
6169
echo "Setting default privileges for the new grant, index and alter privileges"
62-
@bindir@/mysql --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
70+
$cmd <<END_OF_DATA
6371
UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv;
6472
UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv;
6573
UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv;
@@ -72,7 +80,7 @@ fi
7280

7381
echo "Adding columns needed by GRANT .. REQUIRE (openssl)"
7482
echo "You can ignore any Duplicate column errors"
75-
@bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
83+
$cmd <<END_OF_DATA
7684
ALTER TABLE user
7785
ADD ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL,
7886
ADD ssl_cipher BLOB NOT NULL,
@@ -88,7 +96,7 @@ echo ""
8896

8997
echo "Creating the new table and column privilege tables"
9098

91-
@bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
99+
$cmd <<END_OF_DATA
92100
CREATE TABLE IF NOT EXISTS tables_priv (
93101
Host char(60) DEFAULT '' NOT NULL,
94102
Db char(60) DEFAULT '' NOT NULL,
@@ -119,7 +127,7 @@ END_OF_DATA
119127
echo "Changing name of columns_priv.Type -> columns_priv.Column_priv"
120128
echo "You can ignore any Unknown column errors from this"
121129

122-
@bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
130+
$cmd <<END_OF_DATA
123131
ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL;
124132
END_OF_DATA
125133
echo ""
@@ -131,7 +139,7 @@ echo ""
131139
echo "Fixing the func table"
132140
echo "You can ignore any Duplicate column errors"
133141

134-
@bindir@/mysql --user=root --password=$root_password mysql <<EOF
142+
$cmd <<EOF
135143
alter table func add type enum ('function','aggregate') NOT NULL;
136144
EOF
137145
echo ""
@@ -143,7 +151,7 @@ echo ""
143151
echo "Adding new fields used by MySQL 4.0.2 to the privilege tables"
144152
echo "You can ignore any Duplicate column errors"
145153

146-
@bindir@/mysql --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
154+
$cmd <<END_OF_DATA
147155
alter table user
148156
add Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER alter_priv,
149157
add Super_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_db_priv,
@@ -159,7 +167,7 @@ then
159167
# Convert privileges so that users have similar privileges as before
160168
echo ""
161169
echo "Updating new privileges in MySQL 4.0.2 from old ones"
162-
@bindir@/mysql --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
170+
$cmd <<END_OF_DATA
163171
update user set show_db_priv= select_priv, super_priv=process_priv, execute_priv=process_priv, create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=file_priv where user<>"";
164172
END_OF_DATA
165173
echo ""
@@ -168,7 +176,7 @@ fi
168176
# Add fields that can be used to limit number of questions and connections
169177
# for some users.
170178

171-
@bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
179+
$cmd <<END_OF_DATA
172180
alter table user
173181
add max_questions int(11) NOT NULL AFTER x509_subject,
174182
add max_updates int(11) unsigned NOT NULL AFTER max_questions,
@@ -179,7 +187,7 @@ END_OF_DATA
179187
# Add Create_tmp_table_priv and Lock_tables_priv to db and host
180188
#
181189

182-
@bindir@/mysql --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
190+
$cmd <<END_OF_DATA
183191
alter table db
184192
add Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,
185193
add Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL;

scripts/mysqlaccess.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ BEGIN {
1313
$script = $1;
1414
$script = 'MySQLAccess' unless $script;
1515
$script_conf = "$script.conf";
16-
$script_log = "~/$script.log";
16+
$script_log = $ENV{'HOME'}."/$script.log";
1717

1818
# ****************************
1919
# information on MySQL

scripts/mysqld_safe.sh

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
trap '' 1 2 3 15 # we shouldn't let anyone kill us
1414

15+
umask 007
16+
1517
defaults=
1618
case "$1" in
1719
--no-defaults|--defaults-file=*|--defaults-extra-file=*)

0 commit comments

Comments
 (0)