Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
bc5c1868
Commit
bc5c1868
authored
Mar 01, 2006
by
kent@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into mysql.com:/Users/kent/mysql/bk/mysql-5.1-new
parents
e38822d2
5d722a84
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
310 additions
and
149 deletions
+310
-149
VC++Files/mysql.sln
VC++Files/mysql.sln
+5
-22
VC++Files/storage/example/example.vcproj
VC++Files/storage/example/example.vcproj
+4
-4
client/Makefile.am
client/Makefile.am
+26
-18
config/ac-macros/replication.m4
config/ac-macros/replication.m4
+2
-2
configure.in
configure.in
+7
-4
include/config-win.h
include/config-win.h
+1
-0
mysql-test/include/drop-on-restart.inc
mysql-test/include/drop-on-restart.inc
+3
-0
mysql-test/r/partition.result
mysql-test/r/partition.result
+33
-0
mysql-test/r/rpl_alter_db.result
mysql-test/r/rpl_alter_db.result
+8
-0
mysql-test/r/rpl_bit_npk.result
mysql-test/r/rpl_bit_npk.result
+46
-18
mysql-test/t/disabled.def
mysql-test/t/disabled.def
+1
-1
mysql-test/t/partition.test
mysql-test/t/partition.test
+40
-0
mysql-test/t/rpl_alter_db.test
mysql-test/t/rpl_alter_db.test
+10
-0
scripts/mysql_fix_privilege_tables.sh
scripts/mysql_fix_privilege_tables.sh
+1
-5
scripts/mysql_fix_privilege_tables.sql
scripts/mysql_fix_privilege_tables.sql
+5
-0
sql/field.h
sql/field.h
+19
-2
sql/log_event.cc
sql/log_event.cc
+53
-50
sql/log_event.h
sql/log_event.h
+3
-3
sql/sql_acl.cc
sql/sql_acl.cc
+2
-2
sql/sql_parse.cc
sql/sql_parse.cc
+3
-3
sql/sql_partition.cc
sql/sql_partition.cc
+29
-6
storage/ndb/src/common/transporter/Transporter.cpp
storage/ndb/src/common/transporter/Transporter.cpp
+6
-6
storage/ndb/src/mgmsrv/Services.cpp
storage/ndb/src/mgmsrv/Services.cpp
+3
-3
No files found.
VC++Files/mysql.sln
View file @
bc5c1868
...
...
@@ -823,32 +823,21 @@ Global
{62E85884-3ACF-4F4C-873B-60B878147890}.TLS_DEBUG.ActiveCfg = Debug|Win32
{62E85884-3ACF-4F4C-873B-60B878147890}.TLS_DEBUG.Build.0 = Debug|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.classic.ActiveCfg = classic|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.classic.Build.0 = classic|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.classic nt.ActiveCfg = classic|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.classic nt.Build.0 = classic|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Debug.ActiveCfg = Debug|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Debug.Build.0 = Debug|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Classic.ActiveCfg = classic|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Debug.ActiveCfg = Debug|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Pro.ActiveCfg = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_ProGPL.ActiveCfg = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Release.ActiveCfg = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max.ActiveCfg = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max.Build.0 = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max nt.ActiveCfg = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max nt.Build.0 = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.nt.ActiveCfg = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.nt.Build.0 = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro.ActiveCfg = pro|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro.Build.0 = pro|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro gpl.ActiveCfg = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro gpl.Build.0 = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro gpl nt.ActiveCfg = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro gpl nt.Build.0 = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro nt.ActiveCfg = pro|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro nt.Build.0 = pro|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Release.ActiveCfg = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Release.Build.0 = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.TLS.ActiveCfg = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.TLS.Build.0 = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.TLS_DEBUG.ActiveCfg = Debug|Win32
...
...
@@ -916,32 +905,26 @@ Global
{AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.TLS_DEBUG.ActiveCfg = Debug|Win32
{AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.TLS_DEBUG.Build.0 = Debug|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.classic.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.classic.Build.0 = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.classic nt.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.classic nt.Build.0 = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Debug.ActiveCfg = Debug|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Debug.Build.0 = Debug|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Classic.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Classic.Build.0 = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Debug.ActiveCfg = Debug|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Debug.Build.0 = Debug|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Pro.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Pro.Build.0 = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_ProGPL.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_ProGPL.Build.0 = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Release.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Release.Build.0 = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Max.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Max.Build.0 = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Max nt.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Max nt.Build.0 = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.nt.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.nt.Build.0 = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.pro.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.pro.Build.0 = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.pro gpl.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.pro gpl.Build.0 = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.pro gpl nt.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.pro gpl nt.Build.0 = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.pro nt.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.pro nt.Build.0 = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Release.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Release.Build.0 = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.TLS.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.TLS.Build.0 = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.TLS_DEBUG.ActiveCfg = Debug|Win32
...
...
VC++Files/storage/example/example.vcproj
View file @
bc5c1868
...
...
@@ -24,7 +24,7 @@
InlineFunctionExpansion=
"1"
OptimizeForProcessor=
"2"
AdditionalIncludeDirectories=
"../../include,../../regex,../../sql"
PreprocessorDefinitions=
"DBUG_OFF;_WINDOWS;NDEBUG"
PreprocessorDefinitions=
"DBUG_OFF;_WINDOWS;NDEBUG
;WITH_PARTITION_STORAGE_ENGINE
"
StringPooling=
"TRUE"
RuntimeLibrary=
"0"
EnableFunctionLevelLinking=
"TRUE"
...
...
@@ -73,7 +73,7 @@
Optimization=
"0"
OptimizeForProcessor=
"2"
AdditionalIncludeDirectories=
"../../include,../../regex,../../sql"
PreprocessorDefinitions=
"_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS;USE_TLS"
PreprocessorDefinitions=
"_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS;USE_TLS
;WITH_PARTITION_STORAGE_ENGINE
"
StringPooling=
"TRUE"
RuntimeLibrary=
"1"
PrecompiledHeaderFile=
".\example___Win32_TLS_DEBUG/example.pch"
...
...
@@ -123,7 +123,7 @@
InlineFunctionExpansion=
"1"
OptimizeForProcessor=
"2"
AdditionalIncludeDirectories=
"../../include,../../regex,../../sql"
PreprocessorDefinitions=
"DBUG_OFF;_WINDOWS;NDEBUG;USE_TLS"
PreprocessorDefinitions=
"DBUG_OFF;_WINDOWS;NDEBUG;USE_TLS
;WITH_PARTITION_STORAGE_ENGINE
"
StringPooling=
"TRUE"
RuntimeLibrary=
"0"
EnableFunctionLevelLinking=
"TRUE"
...
...
@@ -172,7 +172,7 @@
Optimization=
"0"
OptimizeForProcessor=
"2"
AdditionalIncludeDirectories=
"../../include,../../regex,../../sql"
PreprocessorDefinitions=
"_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS"
PreprocessorDefinitions=
"_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS
;WITH_PARTITION_STORAGE_ENGINE
"
StringPooling=
"TRUE"
RuntimeLibrary=
"1"
PrecompiledHeaderFile=
".\debug/example.pch"
...
...
client/Makefile.am
View file @
bc5c1868
...
...
@@ -21,17 +21,21 @@ if HAVE_YASSL
else
yassl_dummy_link_fix
=
endif
if
THREAD_SAFE_CLIENT
LIBMYSQLCLIENT_LA
=
$(top_builddir)
/libmysql_r/libmysqlclient_r.la
else
LIBMYSQLCLIENT_LA
=
$(top_builddir)
/libmysql/libmysqlclient.la
endif
#AUTOMAKE_OPTIONS = nostdinc
INCLUDES
=
-I
$(top_builddir)
/include
\
-I
$(top_srcdir)
/include
\
-I
$(top_srcdir)
/regex
\
$(openssl_includes)
$(yassl_includes)
$(openssl_includes)
$(yassl_includes)
LIBS
=
@CLIENT_LIBS@
LDADD
=
@CLIENT_EXTRA_LDFLAGS@
$(CLIENT_THREAD_LIBS)
\
$(top_builddir)
/libmysql/libmysqlclient.la
LDADD_R
=
@CLIENT_EXTRA_LDFLAGS@
\
$(CLIENT_THREAD_LIBS)
\
$(top_builddir)
/libmysql_r/libmysqlclient_r.la
$(top_builddir)
/libmysql/libmysqlclient.la
bin_PROGRAMS
=
mysql mysqladmin mysqlcheck mysqlshow
\
mysqldump mysqlimport mysqltest mysqlbinlog
\
mysqltestmanagerc mysqltestmanager-pwgen
\
...
...
@@ -41,8 +45,8 @@ noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \
mysql_SOURCES
=
mysql.cc readline.cc sql_string.cc completion_hash.cc
mysqladmin_SOURCES
=
mysqladmin.cc
mysql_LDADD
=
@readline_link@ @TERMCAP_LIB@
$(LDADD)
$(CXXLDFLAGS)
mysqltest_SOURCES
=
mysqltest.c
$(top_srcdir)
/mysys/my_getsystime.c
\
$(yassl_dummy_link_fix)
mysqltest_SOURCES
=
mysqltest.c
$(top_srcdir)
/mysys/my_getsystime.c
\
$(yassl_dummy_link_fix)
mysqltest_LDADD
=
$(top_builddir)
/regex/libregex.a
$(LDADD)
mysqlbinlog_SOURCES
=
mysqlbinlog.cc
$(top_srcdir)
/mysys/mf_tempdir.c
\
$(top_srcdir)
/mysys/my_new.cc
\
...
...
@@ -51,18 +55,22 @@ mysqlbinlog_SOURCES = mysqlbinlog.cc $(top_srcdir)/mysys/mf_tempdir.c \
$(top_srcdir)
/mysys/my_vle.c
\
$(top_srcdir)
/mysys/base64.c
mysqlbinlog_LDADD
=
$(LDADD)
$(CXXLDFLAGS)
mysqlslap_LDADD
=
$(CXXLDFLAGS)
$(LDADD_R)
\
$(top_builddir)
/mysys/libmysys.a
mysqlimport_LDADD
=
$(CXXLDFLAGS)
$(LDADD_R)
\
$(top_builddir)
/mysys/libmysys.a
mysqltestmanager_pwgen_SOURCES
=
mysqlmanager-pwgen.c
mysqltestmanagerc_SOURCES
=
mysqlmanagerc.c
$(yassl_dummy_link_fix)
mysqlcheck_SOURCES
=
mysqlcheck.c
$(yassl_dummy_link_fix)
mysqlshow_SOURCES
=
mysqlshow.c
$(yassl_dummy_link_fix)
mysqlslap_SOURCES
=
mysqlslap.c
\
mysqlslap_LDADD
=
$(CXXLDFLAGS)
$(CLIENT_THREAD_LIBS)
\
@CLIENT_EXTRA_LDFLAGS@
\
$(LIBMYSQLCLIENT_LA)
\
$(top_builddir)
/mysys/libmysys.a
mysqlimport_LDADD
=
$(CXXLDFLAGS)
$(CLIENT_THREAD_LIBS)
\
@CLIENT_EXTRA_LDFLAGS@
\
$(LIBMYSQLCLIENT_LA)
\
$(top_builddir)
/mysys/libmysys.a
mysqltestmanager_pwgen_SOURCES
=
mysqlmanager-pwgen.c
mysqltestmanagerc_SOURCES
=
mysqlmanagerc.c
$(yassl_dummy_link_fix)
mysqlcheck_SOURCES
=
mysqlcheck.c
$(yassl_dummy_link_fix)
mysqlshow_SOURCES
=
mysqlshow.c
$(yassl_dummy_link_fix)
mysqlslap_SOURCES
=
mysqlslap.c
\
$(yassl_dummy_link_fix)
mysqldump_SOURCES
=
mysqldump.c my_user.c
$(yassl_dummy_link_fix)
mysqlimport_SOURCES
=
mysqlimport.c
\
mysqldump_SOURCES
=
mysqldump.c my_user.c
$(yassl_dummy_link_fix)
mysqlimport_SOURCES
=
mysqlimport.c
\
$(yassl_dummy_link_fix)
sql_src
=
log_event.h mysql_priv.h log_event.cc my_decimal.h my_decimal.cc
strings_src
=
decimal.c
...
...
config/ac-macros/replication.m4
View file @
bc5c1868
...
...
@@ -7,8 +7,8 @@ dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_CHECK_REPLICATION], [
AC_ARG_WITH([row-based-replication],
AC_HELP_STRING([--with-row-based-replication],
[
I
nclude row-based replication]),
AC_HELP_STRING([--with
out
-row-based-replication],
[
Don't i
nclude row-based replication]),
[row_based="$withval"],
[row_based=yes])
AC_MSG_CHECKING([for row-based replication])
...
...
configure.in
View file @
bc5c1868
...
...
@@ -592,10 +592,10 @@ AC_ARG_WITH(named-curses-libs,
# Make thread safe client
AC_ARG_ENABLE
(
thread-safe-client,
[
--
en
able-thread-safe-client
Compile the client with threads.],
[
--
dis
able-thread-safe-client
Compile the client with
out
threads.],
[
THREAD_SAFE_CLIENT
=
$enableval
]
,
[
THREAD_SAFE_CLIENT
=
no
]
[
THREAD_SAFE_CLIENT
=
yes
]
)
# compile with strings functions in assembler
...
...
@@ -1567,7 +1567,8 @@ then
fi
AC_ARG_WITH
(
debug,
[
--without-debug
Build a production version without debugging code],
[
--with-debug
Add debug code
--with-debug
=
full Add debug code
(
adds memory checker, very slow
)]
,
[
with_debug
=
$withval
]
,
[
with_debug
=
no]
)
if
test
"
$with_debug
"
=
"yes"
...
...
@@ -2475,6 +2476,8 @@ dnl client is just using plain-old libs.
sql_client_dirs
=
"strings regex mysys libmysql client"
linked_client_targets
=
"linked_libmysql_sources"
AM_CONDITIONAL
(
THREAD_SAFE_CLIENT,
test
"
$THREAD_SAFE_CLIENT
"
!=
"no"
)
if
test
"
$THREAD_SAFE_CLIENT
"
!=
"no"
then
sql_client_dirs
=
"libmysql_r
$sql_client_dirs
"
...
...
include/config-win.h
View file @
bc5c1868
...
...
@@ -427,6 +427,7 @@ inline double ulonglong2double(ulonglong value)
#define HAVE_SPATIAL 1
#define HAVE_RTREE_KEYS 1
#define HAVE_ROW_BASED_REPLICATION 1
/* #undef HAVE_OPENSSL */
/* #undef HAVE_YASSL */
...
...
mysql-test/include/drop-on-restart.inc
View file @
bc5c1868
...
...
@@ -23,6 +23,7 @@ drop database if exists db1_secret;
drop
database
if
exists
db2
;
drop
database
if
exists
federated
;
drop
database
if
exists
mysqldump_test_db
;
drop
database
if
exists
mysqlslap
;
drop
database
if
exists
mysqltest1
;
drop
database
if
exists
mysqltest2
;
drop
database
if
exists
mysqltest3
;
...
...
@@ -34,6 +35,7 @@ drop database if exists mysqltest_bob;
drop
database
if
exists
mysqltest_db1
;
drop
database
if
exists
mysqltest_prometheus
;
drop
database
if
exists
mysqltest_sisyfos
;
drop
database
if
exists
ndbsynctest
;
drop
database
if
exists
ndbtest1
;
drop
database
if
exists
rewrite
;
drop
database
if
exists
test2
;
...
...
@@ -429,6 +431,7 @@ drop table if exists new_t2;
drop
table
if
exists
not_exist
;
drop
table
if
exists
r1
;
drop
table
if
exists
t0
,
t1
,
t2
,
t3
,
t4
,
t5
,
t6
,
t7
,
t8
,
t9
,
t10
,
t11
,
t12
,
t21
,
t70
;
drop
table
if
exists
t00
,
t03
,
t04
;
drop
table
if
exists
t0_template
;
drop
table
if
exists
t1Aa
,
t2Aa
,
v1Aa
,
v2Aa
;
drop
table
if
exists
t1_1
,
t1_2
,
t9_1
,
t9_2
,
t1aa
,
t2aa
;
...
...
mysql-test/r/partition.result
View file @
bc5c1868
...
...
@@ -315,4 +315,37 @@ drop table t1;
create table t1 (s1 int, unique (s1)) partition by list (s1) (partition x1 VALUES in (10), partition x2 values in (20));
alter table t1 add partition (partition x3 values in (30));
drop table t1;
CREATE TABLE t1 (
f_int1 INTEGER, f_int2 INTEGER,
f_char1 CHAR(10), f_char2 CHAR(10), f_charbig VARCHAR(1000)
)
PARTITION BY RANGE(f_int1 DIV 2)
SUBPARTITION BY HASH(f_int1)
SUBPARTITIONS 2
(PARTITION parta VALUES LESS THAN (0),
PARTITION partb VALUES LESS THAN (5),
PARTITION parte VALUES LESS THAN (10),
PARTITION partf VALUES LESS THAN (2147483647));
INSERT INTO t1 SET f_int1 = NULL , f_int2 = -20, f_char1 = CAST(-20 AS CHAR),
f_char2 = CAST(-20 AS CHAR), f_charbig = '#NULL#';
SELECT * FROM t1 WHERE f_int1 IS NULL;
f_int1 f_int2 f_char1 f_char2 f_charbig
NULL -20 -20 -20 #NULL#
SELECT * FROM t1;
f_int1 f_int2 f_char1 f_char2 f_charbig
NULL -20 -20 -20 #NULL#
drop table t1;
CREATE TABLE t1 (
f_int1 INTEGER, f_int2 INTEGER,
f_char1 CHAR(10), f_char2 CHAR(10), f_charbig VARCHAR(1000) )
PARTITION BY LIST(MOD(f_int1,2))
SUBPARTITION BY KEY(f_int1)
(PARTITION part1 VALUES IN (-1) (SUBPARTITION sp1, SUBPARTITION sp2),
PARTITION part2 VALUES IN (0) (SUBPARTITION sp3, SUBPARTITION sp5),
PARTITION part3 VALUES IN (1) (SUBPARTITION sp4, SUBPARTITION sp6));
INSERT INTO t1 SET f_int1 = 2, f_int2 = 2, f_char1 = '2', f_char2 = '2', f_charbig = '===2===';
INSERT INTO t1 SET f_int1 = 2, f_int2 = 2, f_char1 = '2', f_char2 = '2', f_charbig = '===2===';
SELECT * FROM t1 WHERE f_int1 IS NULL;
f_int1 f_int2 f_char1 f_char2 f_charbig
drop table t1;
End of 5.1 tests
mysql-test/r/rpl_alter_db.result
0 → 100644
View file @
bc5c1868
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
use mysql;
alter database collate latin1_bin;
mysql-test/r/rpl_bit_npk.result
View file @
bc5c1868
...
...
@@ -45,25 +45,27 @@ GSuppDf TINYINT,
VNotSupp TINYINT,
x034 TINYINT);
LOCK TABLES test.t1 WRITE;
INSERT INTO test.t1 VALUES (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'111110',b'110101',4,5,5,5,5,5,5,5,5,5,3,
2
,1);
INSERT INTO test.t1 VALUES (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'111110',b'110101',4,5,5,5,5,5,5,5,5,5,3,
NULL
,1);
INSERT INTO test.t1 VALUES (1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'000000',b'100100',4,5,5,5,5,5,5,5,5,5,3,2,1);
INSERT INTO test.t1 VALUES (2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000000',b'101010',b'010101',4,5,5,5,5,5,5,5,5,5,3,2,1);
INSERT INTO test.t1 VALUES (3,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'101010',b'111111',b'000000',4,5,5,5,5,5,5,5,5,5,3,2,1);
INSERT INTO test.t1 VALUES (4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0
,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
INSERT INTO test.t1 VALUES (4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
b'0'
,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
INSERT INTO test.t1 VALUES (5,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
INSERT INTO test.t1 VALUES (7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
INSERT INTO test.t1 VALUES (8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
UNLOCK TABLES;
UPDATE test.t1 set x034 = 50 where bit3 = b'000000';
UPDATE test.t1 set VNotSupp = 33 where bit1 = b'0';
SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
oSupp sSuppD GSuppDf VNotSupp x034
5 5 3
2
1
5 5 3 2 1
5 5 3
2
1
5 5 3 2
1
5 5 3
2
1
5 5 3
2
1
5 5 3
2
1
5 5 3
2
1
5 5 3
NULL
1
5 5 3 2 1
5 5 3
33
1
5 5 3 2
50
5 5 3
33
1
5 5 3
33
1
5 5 3
33
1
5 5 3
33
1
SELECT hex(bit1) from test.t1;
hex(bit1)
3F
...
...
@@ -96,14 +98,14 @@ hex(bit3)
1
SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
oSupp sSuppD GSuppDf VNotSupp x034
5 5 3
2
1
5 5 3 2 1
5 5 3
2
1
5 5 3 2
1
5 5 3
2
1
5 5 3
2
1
5 5 3
2
1
5 5 3
2
1
5 5 3
NULL
1
5 5 3 2 1
5 5 3
33
1
5 5 3 2
50
5 5 3
33
1
5 5 3
33
1
5 5 3
33
1
5 5 3
33
1
SELECT hex(bit1) from test.t1;
hex(bit1)
3F
...
...
@@ -134,4 +136,30 @@ hex(bit3)
1
1
1
CREATE TABLE test.t2 (a INT, b BIT(1));
INSERT INTO test.t2 VALUES (1, b'0');
INSERT INTO test.t2 VALUES (1, b'1');
UPDATE test.t2 SET a = 2 WHERE b = b'1';
CREATE TABLE test.t3 (a INT, b INT);
INSERT INTO test.t3 VALUES (1, NULL);
INSERT INTO test.t3 VALUES (1, 0);
UPDATE test.t3 SET a = 2 WHERE b = 0;
SELECT a, hex(b) FROM test.t2;
a hex(b)
1 0
2 1
SELECT * FROM test.t3;
a b
1 NULL
2 0
SELECT a, hex(b) FROM test.t2;
a hex(b)
1 0
2 1
SELECT * FROM test.t3;
a b
1 NULL
2 0
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
mysql-test/t/disabled.def
View file @
bc5c1868
...
...
@@ -20,7 +20,7 @@ ndb_binlog_ddl_multi : Bug#17038 [PATCH PENDING]
ndb_load : Bug#17233
partition_03ndb : Bug#16385
ps_7ndb : dbug assert in RBR mode when executing test suite
rpl_bit_npk : Bug#13418
#
rpl_bit_npk : Bug#13418
rpl_ddl : Bug#15963 SBR does not show "Definer" correctly
rpl_ndb_2innodb : Bugs#17400, 17687, 17701
rpl_ndb_2myisam : Bugs#17400, 17687, 17701
...
...
mysql-test/t/partition.test
View file @
bc5c1868
...
...
@@ -408,4 +408,44 @@ create table t1 (s1 int, unique (s1)) partition by list (s1) (partition x1 VALUE
alter
table
t1
add
partition
(
partition
x3
values
in
(
30
));
drop
table
t1
;
#
# Bug #17432: Partition functions containing NULL values should return
# LONGLONG_MIN
#
CREATE
TABLE
t1
(
f_int1
INTEGER
,
f_int2
INTEGER
,
f_char1
CHAR
(
10
),
f_char2
CHAR
(
10
),
f_charbig
VARCHAR
(
1000
)
)
PARTITION
BY
RANGE
(
f_int1
DIV
2
)
SUBPARTITION
BY
HASH
(
f_int1
)
SUBPARTITIONS
2
(
PARTITION
parta
VALUES
LESS
THAN
(
0
),
PARTITION
partb
VALUES
LESS
THAN
(
5
),
PARTITION
parte
VALUES
LESS
THAN
(
10
),
PARTITION
partf
VALUES
LESS
THAN
(
2147483647
));
INSERT
INTO
t1
SET
f_int1
=
NULL
,
f_int2
=
-
20
,
f_char1
=
CAST
(
-
20
AS
CHAR
),
f_char2
=
CAST
(
-
20
AS
CHAR
),
f_charbig
=
'#NULL#'
;
SELECT
*
FROM
t1
WHERE
f_int1
IS
NULL
;
SELECT
*
FROM
t1
;
drop
table
t1
;
#
# Bug 17430: Crash when SELECT * from t1 where field IS NULL
#
CREATE
TABLE
t1
(
f_int1
INTEGER
,
f_int2
INTEGER
,
f_char1
CHAR
(
10
),
f_char2
CHAR
(
10
),
f_charbig
VARCHAR
(
1000
)
)
PARTITION
BY
LIST
(
MOD
(
f_int1
,
2
))
SUBPARTITION
BY
KEY
(
f_int1
)
(
PARTITION
part1
VALUES
IN
(
-
1
)
(
SUBPARTITION
sp1
,
SUBPARTITION
sp2
),
PARTITION
part2
VALUES
IN
(
0
)
(
SUBPARTITION
sp3
,
SUBPARTITION
sp5
),
PARTITION
part3
VALUES
IN
(
1
)
(
SUBPARTITION
sp4
,
SUBPARTITION
sp6
));
INSERT
INTO
t1
SET
f_int1
=
2
,
f_int2
=
2
,
f_char1
=
'2'
,
f_char2
=
'2'
,
f_charbig
=
'===2==='
;
INSERT
INTO
t1
SET
f_int1
=
2
,
f_int2
=
2
,
f_char1
=
'2'
,
f_char2
=
'2'
,
f_charbig
=
'===2==='
;
SELECT
*
FROM
t1
WHERE
f_int1
IS
NULL
;
drop
table
t1
;
--
echo
End
of
5.1
tests
mysql-test/t/rpl_alter_db.test
0 → 100644
View file @
bc5c1868
source
include
/
master
-
slave
.
inc
;
connection
master
;
use
mysql
;
# to be different from initial `test' db of mysqltest client
alter
database
collate
latin1_bin
;
save_master_pos
;
connection
slave
;
sync_with_master
;
scripts/mysql_fix_privilege_tables.sh
View file @
bc5c1868
...
...
@@ -163,11 +163,7 @@ s_echo()
}
s_echo
"This script updates all the mysql privilege tables to be usable by"
s_echo
"MySQL 4.0 and above."
s_echo
""
s_echo
"This is needed if you want to use the new GRANT functions,"
s_echo
"CREATE AGGREGATE FUNCTION, stored procedures, or"
s_echo
"more secure passwords in 4.1"
s_echo
"MySQL 5.1 and above."
s_echo
""
if
test
$verbose
=
1
...
...
scripts/mysql_fix_privilege_tables.sql
View file @
bc5c1868
...
...
@@ -630,6 +630,9 @@ CREATE TABLE event (
# EVENT privilege
#
SET @hadEventPriv := 0;
SELECT @hadEventPriv :=1 FROM user WHERE Event_priv LIKE '
%
';
ALTER TABLE user add Event_priv enum('
N
','
Y
') character set utf8 DEFAULT '
N
' NOT NULL AFTER Create_user_priv;
ALTER TABLE db add Event_priv enum('
N
','
Y
') character set utf8 DEFAULT '
N
' NOT NULL;
ALTER TABLE event DROP PRIMARY KEY;
...
...
@@ -667,6 +670,8 @@ ALTER TABLE event ADD sql_mode
'
HIGH_NOT_PRECEDENCE
'
) DEFAULT
''
NOT NULL AFTER on_completion;
UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0;
--
-- TRIGGER privilege
--
...
...
sql/field.h
View file @
bc5c1868
...
...
@@ -173,8 +173,9 @@ class Field
virtual
int
cmp
(
const
char
*
,
const
char
*
)
=
0
;
virtual
int
cmp_binary
(
const
char
*
a
,
const
char
*
b
,
uint32
max_length
=~
0L
)
{
return
memcmp
(
a
,
b
,
pack_length
());
}
int
cmp_offset
(
uint
row_offset
)
{
return
cmp
(
ptr
,
ptr
+
row_offset
);
}
int
cmp_binary_offset
(
uint
row_offset
)
virtual
int
cmp_offset
(
uint
row_offset
)
{
return
cmp
(
ptr
,
ptr
+
row_offset
);
}
virtual
int
cmp_binary_offset
(
uint
row_offset
)
{
return
cmp_binary
(
ptr
,
ptr
+
row_offset
);
};
virtual
int
key_cmp
(
const
byte
*
a
,
const
byte
*
b
)
{
return
cmp
((
char
*
)
a
,(
char
*
)
b
);
}
...
...
@@ -1317,6 +1318,20 @@ class Field_set :public Field_enum {
};
/*
Note:
To use Field_bit::cmp_binary() you need to copy the bits stored in
the beginning of the record (the NULL bytes) to each memory you
want to compare (where the arguments point).
This is the reason:
- Field_bit::cmp_binary() is only implemented in the base class
(Field::cmp_binary()).
- Field::cmp_binary() currenly use pack_length() to calculate how
long the data is.
- pack_length() includes size of the bits stored in the NULL bytes
of the record.
*/
class
Field_bit
:
public
Field
{
public:
uchar
*
bit_ptr
;
// position in record where 'uneven' bits store
...
...
@@ -1342,6 +1357,8 @@ class Field_bit :public Field {
my_decimal
*
val_decimal
(
my_decimal
*
);
int
cmp
(
const
char
*
a
,
const
char
*
b
)
{
return
cmp_binary
(
a
,
b
);
}
int
cmp_binary_offset
(
uint
row_offset
)
{
return
cmp_offset
(
row_offset
);
}
int
cmp_max
(
const
char
*
a
,
const
char
*
b
,
uint
max_length
);
int
key_cmp
(
const
byte
*
a
,
const
byte
*
b
)
{
return
cmp_binary
((
char
*
)
a
,
(
char
*
)
b
);
}
...
...
sql/log_event.cc
View file @
bc5c1868
...
...
@@ -5601,7 +5601,7 @@ bool Rows_log_event::write_data_body(IO_CACHE*file)
char
sbuf
[
sizeof
(
m_width
)];
my_ptrdiff_t
const
data_size
=
m_rows_cur
-
m_rows_buf
;
char
*
const
sbuf_end
=
net_store_length
(
sbuf
,
(
uint
)
m_width
);
char
*
const
sbuf_end
=
net_store_length
(
(
char
*
)
sbuf
,
(
uint
)
m_width
);
DBUG_ASSERT
(
static_cast
<
my_size_t
>
(
sbuf_end
-
sbuf
)
<=
sizeof
(
sbuf
));
return
(
my_b_safe_write
(
file
,
reinterpret_cast
<
byte
*>
(
sbuf
),
...
...
@@ -6050,7 +6050,7 @@ bool Table_map_log_event::write_data_body(IO_CACHE *file)
byte
const
tbuf
[]
=
{
m_tbllen
};
char
cbuf
[
sizeof
(
m_colcnt
)];
char
*
const
cbuf_end
=
net_store_length
(
cbuf
,
(
uint
)
m_colcnt
);
char
*
const
cbuf_end
=
net_store_length
(
(
char
*
)
cbuf
,
(
uint
)
m_colcnt
);
DBUG_ASSERT
(
static_cast
<
my_size_t
>
(
cbuf_end
-
cbuf
)
<=
sizeof
(
cbuf
));
return
(
my_b_safe_write
(
file
,
dbuf
,
sizeof
(
dbuf
))
||
...
...
@@ -6058,7 +6058,7 @@ bool Table_map_log_event::write_data_body(IO_CACHE *file)
my_b_safe_write
(
file
,
tbuf
,
sizeof
(
tbuf
))
||
my_b_safe_write
(
file
,
(
const
byte
*
)
m_tblnam
,
m_tbllen
+
1
)
||
my_b_safe_write
(
file
,
reinterpret_cast
<
byte
*>
(
cbuf
),
cbuf_end
-
cbuf
)
||
cbuf_end
-
(
char
*
)
cbuf
)
||
my_b_safe_write
(
file
,
reinterpret_cast
<
byte
*>
(
m_coltype
),
m_colcnt
));
}
#endif
...
...
@@ -6365,18 +6365,27 @@ void Write_rows_log_event::print(FILE *file, PRINT_EVENT_INFO* print_event_info)
**************************************************************************/
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
static
int
record_compare
(
TABLE
*
table
,
char
const
*
a
,
char
const
*
b
)
/*
Compares table->record[0] and table->record[1]
Returns TRUE if different.
*/
static
bool
record_compare
(
TABLE
*
table
)
{
for
(
my_size_t
i
=
0
;
i
<
table
->
s
->
fields
;
++
i
)
if
(
table
->
s
->
blob_fields
+
table
->
s
->
varchar_fields
==
0
)
return
cmp_record
(
table
,
record
[
1
]);
/* Compare null bits */
if
(
memcmp
(
table
->
null_flags
,
table
->
null_flags
+
table
->
s
->
rec_buff_length
,
table
->
s
->
null_bytes
))
return
TRUE
;
// Diff in NULL value
/* Compare updated fields */
for
(
Field
**
ptr
=
table
->
field
;
*
ptr
;
ptr
++
)
{
uint
const
off
=
table
->
field
[
i
]
->
offset
();
uint
const
res
=
table
->
field
[
i
]
->
cmp_binary
(
a
+
off
,
b
+
off
);
if
(
res
!=
0
)
{
return
res
;
}
if
((
*
ptr
)
->
cmp_binary_offset
(
table
->
s
->
rec_buff_length
))
return
TRUE
;
}
return
0
;
return
FALSE
;
}
...
...
@@ -6384,15 +6393,12 @@ static int record_compare(TABLE *table, char const *a, char const *b)
Find the row given by 'key', if the table has keys, or else use a table scan
to find (and fetch) the row. If the engine allows random access of the
records, a combination of position() and rnd_pos() will be used.
The 'record_buf' will be used as buffer for records while locating the
correct row.
*/
static
int
find_and_fetch_row
(
TABLE
*
table
,
byte
*
key
,
byte
*
record_buf
)
static
int
find_and_fetch_row
(
TABLE
*
table
,
byte
*
key
)
{
DBUG_ENTER
(
"find_and_fetch_row(TABLE *table, byte *key, byte *record)"
);
DBUG_PRINT
(
"enter"
,
(
"table=%p, key=%p, record=%p"
,
table
,
key
,
record_buf
));
table
,
key
,
table
->
record
[
1
]
));
DBUG_ASSERT
(
table
->
in_use
!=
NULL
);
...
...
@@ -6410,7 +6416,7 @@ static int find_and_fetch_row(TABLE *table, byte *key, byte *record_buf)
DBUG_RETURN
(
table
->
file
->
rnd_pos
(
table
->
record
[
0
],
table
->
file
->
ref
));
}
DBUG_ASSERT
(
record_buf
);
DBUG_ASSERT
(
table
->
record
[
1
]
);
/* We need to retrieve all fields */
table
->
file
->
ha_set_all_bits_in_read_set
();
...
...
@@ -6418,7 +6424,7 @@ static int find_and_fetch_row(TABLE *table, byte *key, byte *record_buf)
if
(
table
->
s
->
keys
>
0
)
{
int
error
;
if
((
error
=
table
->
file
->
index_read_idx
(
record_buf
,
0
,
key
,
if
((
error
=
table
->
file
->
index_read_idx
(
table
->
record
[
1
]
,
0
,
key
,
table
->
key_info
->
key_length
,
HA_READ_KEY_EXACT
)))
{
...
...
@@ -6443,10 +6449,10 @@ static int find_and_fetch_row(TABLE *table, byte *key, byte *record_buf)
if
(
table
->
key_info
->
flags
&
HA_NOSAME
)
DBUG_RETURN
(
0
);
while
(
record_compare
(
table
,
(
const
char
*
)
table
->
record
[
0
],
(
const
char
*
)
record_buf
)
!=
0
)
while
(
record_compare
(
table
)
)
{
int
error
;
if
((
error
=
table
->
file
->
index_next
(
record_buf
)))
if
((
error
=
table
->
file
->
index_next
(
table
->
record
[
1
]
)))
{
table
->
file
->
print_error
(
error
,
MYF
(
0
));
DBUG_RETURN
(
error
);
...
...
@@ -6460,7 +6466,7 @@ static int find_and_fetch_row(TABLE *table, byte *key, byte *record_buf)
int
error
=
0
;
do
{
error
=
table
->
file
->
rnd_next
(
record_buf
);
error
=
table
->
file
->
rnd_next
(
table
->
record
[
1
]
);
switch
(
error
)
{
case
0
:
...
...
@@ -6477,9 +6483,7 @@ static int find_and_fetch_row(TABLE *table, byte *key, byte *record_buf)
DBUG_RETURN
(
error
);
}
}
while
(
restart_count
<
2
&&
record_compare
(
table
,
(
const
char
*
)
table
->
record
[
0
],
(
const
char
*
)
record_buf
)
!=
0
);
while
(
restart_count
<
2
&&
record_compare
(
table
));
DBUG_ASSERT
(
error
==
HA_ERR_END_OF_FILE
||
error
==
0
);
DBUG_RETURN
(
error
);
...
...
@@ -6499,7 +6503,7 @@ Delete_rows_log_event::Delete_rows_log_event(THD *thd_arg, TABLE *tbl_arg,
bool
is_transactional
)
:
Rows_log_event
(
thd_arg
,
tbl_arg
,
tid
,
cols
,
is_transactional
)
#ifdef HAVE_REPLICATION
,
m_memory
(
NULL
),
m_key
(
NULL
),
m_
search_record
(
NULL
)
,
m_memory
(
NULL
),
m_key
(
NULL
),
m_
after_image
(
NULL
)
#endif
{
}
...
...
@@ -6516,7 +6520,7 @@ Delete_rows_log_event::Delete_rows_log_event(const char *buf, uint event_len,
:
Rows_log_event
(
buf
,
event_len
,
DELETE_ROWS_EVENT
,
description_event
)
#else
:
Rows_log_event
(
buf
,
event_len
,
DELETE_ROWS_EVENT
,
description_event
),
m_memory
(
NULL
),
m_key
(
NULL
),
m_
search_record
(
NULL
)
m_memory
(
NULL
),
m_key
(
NULL
),
m_
after_image
(
NULL
)
#endif
{
}
...
...
@@ -6531,7 +6535,7 @@ int Delete_rows_log_event::do_before_row_operations(TABLE *table)
table
->
s
->
primary_key
<
MAX_KEY
)
{
/*
We don't need to allocate any memory for m_
search_record
and
We don't need to allocate any memory for m_
after_image
and
m_key since they are not used.
*/
return
0
;
...
...
@@ -6543,14 +6547,14 @@ int Delete_rows_log_event::do_before_row_operations(TABLE *table)
{
m_memory
=
my_multi_malloc
(
MYF
(
MY_WME
),
&
m_
search_record
,
table
->
s
->
reclength
,
&
m_
after_image
,
table
->
s
->
reclength
,
&
m_key
,
table
->
key_info
->
key_length
,
NULL
);
}
else
{
m_
search_record
=
(
byte
*
)
my_malloc
(
table
->
s
->
reclength
,
MYF
(
MY_WME
));
m_memory
=
(
gptr
)
m_
search_record
;
m_
after_image
=
(
byte
*
)
my_malloc
(
table
->
s
->
reclength
,
MYF
(
MY_WME
));
m_memory
=
(
gptr
)
m_
after_image
;
m_key
=
NULL
;
}
if
(
!
m_memory
)
...
...
@@ -6577,7 +6581,7 @@ int Delete_rows_log_event::do_after_row_operations(TABLE *table, int error)
table
->
file
->
ha_index_or_rnd_end
();
my_free
(
m_memory
,
MYF
(
MY_ALLOW_ZERO_PTR
));
// Free for multi_malloc
m_memory
=
NULL
;
m_
search_record
=
NULL
;
m_
after_image
=
NULL
;
m_key
=
NULL
;
return
error
;
...
...
@@ -6615,7 +6619,7 @@ int Delete_rows_log_event::do_exec_row(TABLE *table)
{
DBUG_ASSERT
(
table
!=
NULL
);
int
error
=
find_and_fetch_row
(
table
,
m_key
,
m_search_record
);
int
error
=
find_and_fetch_row
(
table
,
m_key
);
if
(
error
)
return
error
;
...
...
@@ -6687,30 +6691,20 @@ int Update_rows_log_event::do_before_row_operations(TABLE *table)
{
DBUG_ASSERT
(
m_memory
==
NULL
);
if
((
table
->
file
->
table_flags
()
&
HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS
)
&&
table
->
s
->
primary_key
<
MAX_KEY
)
{
/*
We don't need to allocate any memory for m_search_record and
m_key since they are not used.
*/
return
0
;
}
int
error
=
0
;
if
(
table
->
s
->
keys
>
0
)
{
m_memory
=
my_multi_malloc
(
MYF
(
MY_WME
),
&
m_
search_record
,
table
->
s
->
reclength
,
&
m_
after_image
,
table
->
s
->
reclength
,
&
m_key
,
table
->
key_info
->
key_length
,
NULL
);
}
else
{
m_
search_record
=
(
byte
*
)
my_malloc
(
table
->
s
->
reclength
,
MYF
(
MY_WME
));
m_memory
=
(
gptr
)
m_
search_record
;
m_
after_image
=
(
byte
*
)
my_malloc
(
table
->
s
->
reclength
,
MYF
(
MY_WME
));
m_memory
=
(
gptr
)
m_
after_image
;
m_key
=
NULL
;
}
if
(
!
m_memory
)
...
...
@@ -6738,7 +6732,7 @@ int Update_rows_log_event::do_after_row_operations(TABLE *table, int error)
table
->
file
->
ha_index_or_rnd_end
();
my_free
(
m_memory
,
MYF
(
MY_ALLOW_ZERO_PTR
));
m_memory
=
NULL
;
m_
search_record
=
NULL
;
m_
after_image
=
NULL
;
m_key
=
NULL
;
return
error
;
...
...
@@ -6758,8 +6752,8 @@ char const *Update_rows_log_event::do_prepare_row(THD *thd, TABLE *table,
/* record[0] is the before image for the update */
ptr
=
unpack_row
(
table
,
table
->
record
[
0
],
ptr
,
&
m_cols
);
DBUG_ASSERT
(
ptr
!=
NULL
);
/*
record[1]
is the after image for the update */
ptr
=
unpack_row
(
table
,
table
->
record
[
1
]
,
ptr
,
&
m_cols
);
/*
m_after_image
is the after image for the update */
ptr
=
unpack_row
(
table
,
m_after_image
,
ptr
,
&
m_cols
);
/*
If we will access rows using the random access method, m_key will
...
...
@@ -6779,10 +6773,19 @@ int Update_rows_log_event::do_exec_row(TABLE *table)
{
DBUG_ASSERT
(
table
!=
NULL
);
int
error
=
find_and_fetch_row
(
table
,
m_key
,
m_search_record
);
int
error
=
find_and_fetch_row
(
table
,
m_key
);
if
(
error
)
return
error
;
/*
This is only a precaution to make sure that the call to
ha_update_row is using record[1].
If this is not needed/required, then we could use m_after_image in
that call instead.
*/
bmove_align
(
table
->
record
[
1
],
m_after_image
,(
size_t
)
table
->
s
->
reclength
);
/*
Now we should have the right row to update. The record that has
been fetched is guaranteed to be in record[0], so we use that.
...
...
sql/log_event.h
View file @
bc5c1868
...
...
@@ -2005,7 +2005,7 @@ class Write_rows_log_event : public Rows_log_event
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
gptr
m_memory
;
byte
*
m_
search_record
;
byte
*
m_
after_image
;
virtual
int
do_before_row_operations
(
TABLE
*
table
);
virtual
int
do_after_row_operations
(
TABLE
*
table
,
int
error
);
...
...
@@ -2069,7 +2069,7 @@ class Update_rows_log_event : public Rows_log_event
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
gptr
m_memory
;
byte
*
m_key
;
byte
*
m_
search_record
;
byte
*
m_
after_image
;
virtual
int
do_before_row_operations
(
TABLE
*
table
);
virtual
int
do_after_row_operations
(
TABLE
*
table
,
int
error
);
...
...
@@ -2139,7 +2139,7 @@ class Delete_rows_log_event : public Rows_log_event
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
gptr
m_memory
;
byte
*
m_key
;
byte
*
m_
search_record
;
byte
*
m_
after_image
;
virtual
int
do_before_row_operations
(
TABLE
*
table
);
virtual
int
do_after_row_operations
(
TABLE
*
table
,
int
error
);
...
...
sql/sql_acl.cc
View file @
bc5c1868
...
...
@@ -471,10 +471,10 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
/*
if it is pre 5.1.
4
privilege table then map CREATE privilege on
if it is pre 5.1.
6
privilege table then map CREATE privilege on
CREATE|ALTER|DROP|EXECUTE EVENT
*/
if
(
table
->
s
->
fields
<=
37
&&
(
user
.
access
&
CREATE
_ACL
))
if
(
table
->
s
->
fields
<=
37
&&
(
user
.
access
&
SUPER
_ACL
))
user
.
access
|=
EVENT_ACL
;
/*
...
...
sql/sql_parse.cc
View file @
bc5c1868
...
...
@@ -3717,7 +3717,7 @@ mysql_execute_command(THD *thd)
}
if
(
!
strip_sp
(
db
)
||
check_db_name
(
db
))
{
my_error
(
ER_WRONG_DB_NAME
,
MYF
(
0
),
lex
->
name
);
my_error
(
ER_WRONG_DB_NAME
,
MYF
(
0
),
db
);
break
;
}
/*
...
...
@@ -3729,8 +3729,8 @@ mysql_execute_command(THD *thd)
*/
#ifdef HAVE_REPLICATION
if
(
thd
->
slave_thread
&&
(
!
rpl_filter
->
db_ok
(
lex
->
name
)
||
!
rpl_filter
->
db_ok_with_wild_table
(
lex
->
name
)))
(
!
rpl_filter
->
db_ok
(
db
)
||
!
rpl_filter
->
db_ok_with_wild_table
(
db
)))
{
my_message
(
ER_SLAVE_IGNORED_TABLE
,
ER
(
ER_SLAVE_IGNORED_TABLE
),
MYF
(
0
));
break
;
...
...
sql/sql_partition.cc
View file @
bc5c1868
...
...
@@ -2341,6 +2341,29 @@ bool partition_key_modified(TABLE *table, List<Item> &fields)
}
/*
A function to handle correct handling of NULL values in partition
functions.
SYNOPSIS
part_val_int()
item_expr The item expression to evaluate
RETURN VALUES
The value of the partition function, LONGLONG_MIN if any null value
in function
*/
static
inline
longlong
part_val_int
(
Item
*
item_expr
)
{
longlong
value
=
item_expr
->
val_int
();
if
(
item_expr
->
null_value
)
value
=
LONGLONG_MIN
;
return
value
;
}
/*
The next set of functions are used to calculate the partition identity.
A handler sets up a variable that corresponds to one of these functions
...
...
@@ -2437,7 +2460,7 @@ static uint32 get_part_id_hash(uint no_parts,
longlong
*
func_value
)
{
DBUG_ENTER
(
"get_part_id_hash"
);
*
func_value
=
part_
expr
->
val_int
(
);
*
func_value
=
part_
val_int
(
part_expr
);
longlong
int_hash_id
=
*
func_value
%
no_parts
;
DBUG_RETURN
(
int_hash_id
<
0
?
-
int_hash_id
:
int_hash_id
);
}
...
...
@@ -2466,7 +2489,7 @@ static uint32 get_part_id_linear_hash(partition_info *part_info,
{
DBUG_ENTER
(
"get_part_id_linear_hash"
);
*
func_value
=
part_
expr
->
val_int
(
);
*
func_value
=
part_
val_int
(
part_expr
);
DBUG_RETURN
(
get_part_id_from_linear_hash
(
*
func_value
,
part_info
->
linear_hash_mask
,
no_parts
));
...
...
@@ -2604,7 +2627,7 @@ int get_partition_id_list(partition_info *part_info,
longlong
list_value
;
int
min_list_index
=
0
;
int
max_list_index
=
part_info
->
no_list_values
-
1
;
longlong
part_func_value
=
part_
info
->
part_expr
->
val_int
(
);
longlong
part_func_value
=
part_
val_int
(
part_info
->
part_expr
);
DBUG_ENTER
(
"get_partition_id_list"
);
*
func_value
=
part_func_value
;
...
...
@@ -2680,7 +2703,7 @@ uint32 get_list_array_idx_for_endpoint(partition_info *part_info,
longlong
list_value
;
uint
min_list_index
=
0
,
max_list_index
=
part_info
->
no_list_values
-
1
;
/* Get the partitioning function value for the endpoint */
longlong
part_func_value
=
part_
info
->
part_expr
->
val_int
(
);
longlong
part_func_value
=
part_
val_int
(
part_info
->
part_expr
);
while
(
max_list_index
>=
min_list_index
)
{
list_index
=
(
max_list_index
+
min_list_index
)
>>
1
;
...
...
@@ -2714,7 +2737,7 @@ int get_partition_id_range(partition_info *part_info,
uint
min_part_id
=
0
;
uint
max_part_id
=
max_partition
;
uint
loc_part_id
;
longlong
part_func_value
=
part_
info
->
part_expr
->
val_int
(
);
longlong
part_func_value
=
part_
val_int
(
part_info
->
part_expr
);
DBUG_ENTER
(
"get_partition_id_int_range"
);
while
(
max_part_id
>
min_part_id
)
...
...
@@ -2789,7 +2812,7 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info,
uint
max_partition
=
part_info
->
no_parts
-
1
;
uint
min_part_id
=
0
,
max_part_id
=
max_partition
,
loc_part_id
;
/* Get the partitioning function value for the endpoint */
longlong
part_func_value
=
part_
info
->
part_expr
->
val_int
(
);
longlong
part_func_value
=
part_
val_int
(
part_info
->
part_expr
);
while
(
max_part_id
>
min_part_id
)
{
loc_part_id
=
(
max_part_id
+
min_part_id
+
1
)
>>
1
;
...
...
storage/ndb/src/common/transporter/Transporter.cpp
View file @
bc5c1868
...
...
@@ -105,10 +105,10 @@ Transporter::connect_server(NDB_SOCKET_TYPE sockfd) {
}
{
struct
sockaddr
addr
;
struct
sockaddr
_in
addr
;
SOCKET_SIZE_TYPE
addrlen
=
sizeof
(
addr
);
int
r
=
getpeername
(
sockfd
,
&
addr
,
&
addrlen
);
m_connect_address
=
(
(
struct
sockaddr_in
*
)
&
addr
)
->
sin_addr
;
int
r
=
getpeername
(
sockfd
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
);
m_connect_address
=
(
&
addr
)
->
sin_addr
;
}
bool
res
=
connect_server_impl
(
sockfd
);
...
...
@@ -198,10 +198,10 @@ Transporter::connect_client(NDB_SOCKET_TYPE sockfd) {
}
{
struct
sockaddr
addr
;
struct
sockaddr
_in
addr
;
SOCKET_SIZE_TYPE
addrlen
=
sizeof
(
addr
);
int
r
=
getpeername
(
sockfd
,
&
addr
,
&
addrlen
);
m_connect_address
=
(
(
struct
sockaddr_in
*
)
&
addr
)
->
sin_addr
;
int
r
=
getpeername
(
sockfd
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
);
m_connect_address
=
(
&
addr
)
->
sin_addr
;
}
bool
res
=
connect_client_impl
(
sockfd
);
...
...
storage/ndb/src/mgmsrv/Services.cpp
View file @
bc5c1868
...
...
@@ -451,9 +451,9 @@ MgmApiSession::get_nodeid(Parser_t::Context &,
return
;
}
struct
sockaddr
addr
;
struct
sockaddr
_in
addr
;
SOCKET_SIZE_TYPE
addrlen
=
sizeof
(
addr
);
int
r
=
getpeername
(
m_socket
,
&
addr
,
&
addrlen
);
int
r
=
getpeername
(
m_socket
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
);
if
(
r
!=
0
)
{
m_output
->
println
(
cmd
);
m_output
->
println
(
"result: getpeername(%d) failed, err= %d"
,
m_socket
,
r
);
...
...
@@ -465,7 +465,7 @@ MgmApiSession::get_nodeid(Parser_t::Context &,
if
(
tmp
==
0
||
!
m_allocated_resources
->
is_reserved
(
tmp
)){
BaseString
error_string
;
if
(
!
m_mgmsrv
.
alloc_node_id
(
&
tmp
,
(
enum
ndb_mgm_node_type
)
nodetype
,
&
addr
,
&
addrlen
,
error_string
)){
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
,
error_string
)){
const
char
*
alias
;
const
char
*
str
;
alias
=
ndb_mgm_get_node_type_alias_string
((
enum
ndb_mgm_node_type
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment