summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libmysqld/examples/Makefile.am2
-rw-r--r--mysql-test/r/func_str.result3
-rw-r--r--mysql-test/t/func_str.test1
-rw-r--r--netware/libmysqld.def65
-rw-r--r--netware/mysql.xdc (renamed from netware/mysqld.xdc)bin128 -> 128 bytes
-rwxr-xr-xnetware/nwbootstrap145
-rw-r--r--netware/nwconfigure23
-rw-r--r--sql/item_strfunc.cc4
-rw-r--r--sql/sql_acl.cc22
9 files changed, 29 insertions, 236 deletions
diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am
index 2b52b133133..f741ddf0191 100644
--- a/libmysqld/examples/Makefile.am
+++ b/libmysqld/examples/Makefile.am
@@ -10,7 +10,7 @@ link_sources:
DEFS = -DEMBEDDED_LIBRARY
INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include -I$(srcdir) \
-I$(top_srcdir) -I$(top_srcdir)/client $(openssl_includes)
-LIBS = @LIBS@
+LIBS = @LIBS@ @WRAPLIBS@
LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @innodb_system_libs@ @LIBDL@ $(CXXLDFLAGS)
mysqltest_SOURCES = mysqltest.c
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 9e8f2b90f07..a72d32d39f8 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -225,6 +225,9 @@ CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugstatus,submitter), '"'
SELECT CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified,bugstatus,submitter) FROM t1;
CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified,bugstatus,submitter)
Link";"1";"1";"1";"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";"2001-02-28 08:40:16";"20010228084016";"0";"4
+SELECT bugdesc, REPLACE(bugdesc, 'xxxxxxxxxxxxxxxxxxxx', 'bbbbbbbbbbbbbbbbbbbb') from t1 group by bugdesc;
+bugdesc REPLACE(bugdesc, 'xxxxxxxxxxxxxxxxxxxx', 'bbbbbbbbbbbbbbbbbbbb')
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
drop table t1;
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, tmp text NOT NULL, KEY id (id)) TYPE=MyISAM;
INSERT INTO t1 VALUES (1, 'a545f661efdd1fb66fdee3aab79945bf');
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index f95cd901dfb..118de6cd01e 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -114,6 +114,7 @@ INSERT INTO t1 VALUES (1,'Link',1,1,1,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
SELECT CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified,bugstatus,submitter), '"') FROM t1;
SELECT CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugstatus,submitter), '"') FROM t1;
SELECT CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified,bugstatus,submitter) FROM t1;
+SELECT bugdesc, REPLACE(bugdesc, 'xxxxxxxxxxxxxxxxxxxx', 'bbbbbbbbbbbbbbbbbbbb') from t1 group by bugdesc;
drop table t1;
#
diff --git a/netware/libmysqld.def b/netware/libmysqld.def
deleted file mode 100644
index c6615ee971c..00000000000
--- a/netware/libmysqld.def
+++ /dev/null
@@ -1,65 +0,0 @@
-LIBRARY LIBMYSQLD
-DESCRIPTION 'MySQL 4.0 Embedded Server Library'
-VERSION 4.0
-EXPORTS
- mysql_server_end
- mysql_server_init
- mysql_use_result
- mysql_thread_safe
- mysql_thread_id
- mysql_store_result
- mysql_stat
- mysql_shutdown
- mysql_select_db
- mysql_row_tell
- mysql_row_seek
- mysql_real_query
- mysql_real_connect
- mysql_query
- mysql_ping
- mysql_options
- mysql_num_rows
- mysql_num_fields
- mysql_list_tables
- mysql_list_processes
- mysql_list_fields
- mysql_list_dbs
- mysql_kill
- mysql_insert_id
- mysql_init
- mysql_info
- mysql_get_server_info
- mysql_get_proto_info
- mysql_get_host_info
- mysql_get_client_info
- mysql_free_result
- mysql_field_tell
- mysql_field_count
- mysql_field_seek
- mysql_fetch_row
- mysql_fetch_lengths
- mysql_fetch_fields
- mysql_fetch_field_direct
- mysql_fetch_field
- mysql_escape_string
- mysql_real_escape_string
- mysql_error
- mysql_errno
- mysql_eof
- mysql_dump_debug_info
- mysql_drop_db
- mysql_debug
- mysql_data_seek
- mysql_create_db
- mysql_character_set_name
- mysql_change_user
- mysql_connect
- mysql_close
- mysql_affected_rows
- mysql_thread_init
- mysql_thread_end
- mysql_send_query
- mysql_read_query_result
- mysql_refresh
- mysql_odbc_escape_string
- myodbc_remove_escape
diff --git a/netware/mysqld.xdc b/netware/mysql.xdc
index 12a7f6ba2df..a6c430f7314 100644
--- a/netware/mysqld.xdc
+++ b/netware/mysql.xdc
Binary files differ
diff --git a/netware/nwbootstrap b/netware/nwbootstrap
deleted file mode 100755
index 3e4b03de0f5..00000000000
--- a/netware/nwbootstrap
+++ /dev/null
@@ -1,145 +0,0 @@
-#! /bin/sh
-
-# show executed commands
-# set -x
-
-# stop on errors
-set -e
-
-BD=`pwd`
-
-build=0
-build_debug=0
-skip_linux=0
-
-# parse arguments
-for arg do
- case "$arg" in
- --build) build=1 ;;
- --build-debug) build_debug=1 ;;
- --skip-linux) skip_linux=1 ;;
- *) echo "$0: unrecognized option: $arg" ;;
- esac
-done
-
-# run the auto tools
-autotools()
-{
- for package in $BD $BD/innobase
- do
- echo "cd $package"
- cd $package
- rm -f config.cache
- echo "aclocal"
- aclocal
- echo "autoheader"
- autoheader
- echo "libtoolize --force"
- libtoolize --force
- echo "aclocal"
- aclocal
- echo "automake --add-missing --force-missing"
- automake --add-missing --force-missing
- echo "autoconf"
- autoconf
- done
-
- cd $BD
-}
-
-# check the source direcotry
-echo "looking for \"$BD/sql/mysqld.cc\"..."
-if test ! -r ./sql/mysqld.cc
-then
- echo "./netware/nwbootstrap must be started from the top source directory"
- exit 1
-fi
-
-# clean
-# make -j 2 -k distclean
-rm -f NEW-RPMS/*
-rm -f */.deps/*.P
-
-# make files writeable
-chmod -R u+rw,g+rw .
-
-# skip linux?
-if test $skip_linux -ne 1
-then
- echo "starting linux build..."
-
- echo "autotools..."
- autotools
-
- echo "configuring for linux..."
- ./configure --without-docs --without-innodb
-
- echo "building for linux..."
- make clean all
-
- echo "copying required linux binaries..."
- rm -f */*.linux
- cp extra/comp_err extra/comp_err.linux
- cp libmysql/conf_to_src libmysql/conf_to_src.linux
- cp libmysql/conf_to_src libmysql_r/conf_to_src.linux
- cp sql/gen_lex_hash sql/gen_lex_hash.linux
- cp strings/conf_to_src strings/conf_to_src.linux
-
- echo "cleaning linux build..."
- make clean distclean
-fi
-
-echo "starting netware build..."
-
-# remove stale Makefile.in.bk files
-rm -rf Makefile.in.bk
-
-# start mw enviornment
-chmod +x ./netware/nwconfigure
-chmod +x ./netware/mw/mwenv
-chmod +x ./netware/mw/mwasmnlm
-chmod +x ./netware/mw/mwccnlm
-chmod +x ./netware/mw/mwldnlm
-
-. ./netware/mw/mwenv
-
-# link nwconfigure
-rm -f ./nwconfigure
-ln ./netware/nwconfigure ./nwconfigure
-
-# save old builds from previous run
-if test -e *.tar.gz
-then
- rm -f *.tar.gz.old
- rename .tar.gz .tar.gz.old *.tar.gz
-fi
-
-echo "autotools..."
-autotools
-
-# debug build
-if test $build_debug -eq 1
-then
- echo "configuring for netware (debug)..."
- ./nwconfigure --with-debug=full
-
- echo "building for netware (debug)..."
- make clean bin-dist
-
- # mark the debug build
- rename .tar.gz -debug.tar.gz *.tar.gz
-fi
-
-# release build
-if test $build -eq 1
-then
- echo "configuring for netware..."
- ./nwconfigure
-
- echo "building for netware..."
- make clean bin-dist
-fi
-
-echo "done"
-
-
diff --git a/netware/nwconfigure b/netware/nwconfigure
deleted file mode 100644
index aeb68ada5b8..00000000000
--- a/netware/nwconfigure
+++ /dev/null
@@ -1,23 +0,0 @@
-#! /bin/sh
-CMD="\
- AR='mwldnlm' \
- AR_FLAGS='-type library -o' \
- AS='mwasmnlm' \
- CC='mwccnlm -gccincludes' \
- CFLAGS='-dialect c -proc 686 -bool on -relax_pointers -DUSE_OLD_FUNCTIONS' \
- CXX='mwccnlm -gccincludes' \
- CXXFLAGS='-dialect c++ -proc 686 -bool on -relax_pointers' \
- LD='mwldnlm' \
- LDFLAGS='-entry _LibCPrelude -exit _LibCPostlude -flags pseudopreemption' \
- RANLIB=: \
- STRIP=: \
- ./configure --host=i686-pc-netware $* \
- --without-docs \
- --enable-local-infile \
- --with-extra-charsets=all \
- --prefix=N:/mysql \
- "
-#rm -f config.cache config.log config.status
-echo $CMD
-eval $CMD
-
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index bff8bc7e3f4..0f1ce8adba6 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -780,8 +780,8 @@ void Item_func_replace::fix_length_and_dec()
int diff=(int) (args[2]->max_length - args[1]->max_length);
if (diff > 0 && args[1]->max_length)
{ // Calculate of maxreplaces
- max_length= max_length/args[1]->max_length;
- max_length= (max_length+1)*(uint) diff;
+ uint max_substrs= max_length/args[1]->max_length;
+ max_length+= max_substrs * (uint)diff;
}
if (max_length > MAX_BLOB_WIDTH)
{
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index ee9d3f1c1ea..e8cbba8aefa 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -28,6 +28,9 @@
#include "mysql_priv.h"
#include "sql_acl.h"
#include "hash_filo.h"
+#ifdef HAVE_REPLICATION
+#include "sql_repl.h" //for tables_ok()
+#endif
#include <m_ctype.h>
#include <assert.h>
#include <stdarg.h>
@@ -2052,6 +2055,15 @@ int mysql_table_grant (THD *thd, TABLE_LIST *table_list,
tables[0].lock_type=tables[1].lock_type=tables[2].lock_type=TL_WRITE;
tables[0].db=tables[1].db=tables[2].db=(char*) "mysql";
+#ifdef HAVE_REPLICATION
+ /*
+ GRANT and REVOKE are applied the slave in/exclusion rules as they are
+ some kind of updates to the mysql.% tables.
+ */
+ if (thd->slave_thread && table_rules_on && !tables_ok(0, tables))
+ DBUG_RETURN(0);
+#endif
+
if (open_and_lock_tables(thd,tables))
{ // Should never happen
close_thread_tables(thd); /* purecov: deadcode */
@@ -2214,6 +2226,16 @@ int mysql_grant (THD *thd, const char *db, List <LEX_USER> &list,
tables[0].lock_type=tables[1].lock_type=TL_WRITE;
tables[0].db=tables[1].db=(char*) "mysql";
tables[0].table=tables[1].table=0;
+
+#ifdef HAVE_REPLICATION
+ /*
+ GRANT and REVOKE are applied the slave in/exclusion rules as they are
+ some kind of updates to the mysql.% tables.
+ */
+ if (thd->slave_thread && table_rules_on && !tables_ok(0, tables))
+ DBUG_RETURN(0);
+#endif
+
if (open_and_lock_tables(thd,tables))
{ // This should never happen
close_thread_tables(thd); /* purecov: deadcode */