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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
121555dc
Commit
121555dc
authored
Nov 27, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge trift2.:/MySQL/M51/mysql-5.1
into trift2.:/MySQL/M51/push-5.1
parents
a6fe4905
49009cf8
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
231 additions
and
80 deletions
+231
-80
mysql-test/r/ps.result
mysql-test/r/ps.result
+0
-14
mysql-test/r/ps_not_windows.result
mysql-test/r/ps_not_windows.result
+14
-0
mysql-test/r/windows.result
mysql-test/r/windows.result
+14
-0
mysql-test/t/ps.test
mysql-test/t/ps.test
+0
-14
mysql-test/t/ps_not_windows.test
mysql-test/t/ps_not_windows.test
+23
-0
mysql-test/t/windows.test
mysql-test/t/windows.test
+22
-0
sql/log_event.cc
sql/log_event.cc
+135
-48
sql/sql_binlog.cc
sql/sql_binlog.cc
+12
-0
sql/sql_class.cc
sql/sql_class.cc
+7
-1
storage/ndb/src/ndbapi/Ndbinit.cpp
storage/ndb/src/ndbapi/Ndbinit.cpp
+4
-3
No files found.
mysql-test/r/ps.result
View file @
121555dc
...
@@ -2090,14 +2090,6 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
...
@@ -2090,14 +2090,6 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
deallocate prepare abc;
deallocate prepare abc;
drop view v1;
drop view v1;
drop table t1;
drop table t1;
create procedure proc_1() install plugin my_plug soname '/root/some_plugin.so';
call proc_1();
ERROR HY000: No paths allowed for shared library
call proc_1();
ERROR HY000: No paths allowed for shared library
call proc_1();
ERROR HY000: No paths allowed for shared library
drop procedure proc_1;
create procedure proc_1() install plugin my_plug soname 'some_plugin.so';
create procedure proc_1() install plugin my_plug soname 'some_plugin.so';
call proc_1();
call proc_1();
ERROR HY000: Can't open shared library
ERROR HY000: Can't open shared library
...
@@ -2112,12 +2104,6 @@ select func_1(), func_1(), func_1() from dual;
...
@@ -2112,12 +2104,6 @@ select func_1(), func_1(), func_1() from dual;
ERROR 42000: FUNCTION test.func_1 does not exist
ERROR 42000: FUNCTION test.func_1 does not exist
drop function func_1;
drop function func_1;
ERROR 42000: FUNCTION test.func_1 does not exist
ERROR 42000: FUNCTION test.func_1 does not exist
prepare abc from "install plugin my_plug soname '/root/some_plugin.so'";
execute abc;
ERROR HY000: No paths allowed for shared library
execute abc;
ERROR HY000: No paths allowed for shared library
deallocate prepare abc;
prepare abc from "install plugin my_plug soname 'some_plugin.so'";
prepare abc from "install plugin my_plug soname 'some_plugin.so'";
deallocate prepare abc;
deallocate prepare abc;
create procedure proc_1() uninstall plugin my_plug;
create procedure proc_1() uninstall plugin my_plug;
...
...
mysql-test/r/ps_not_windows.result
0 → 100644
View file @
121555dc
create procedure proc_1() install plugin my_plug soname '/root/some_plugin.so';
call proc_1();
ERROR HY000: No paths allowed for shared library
call proc_1();
ERROR HY000: No paths allowed for shared library
call proc_1();
ERROR HY000: No paths allowed for shared library
drop procedure proc_1;
prepare abc from "install plugin my_plug soname '/root/some_plugin.so'";
execute abc;
ERROR HY000: No paths allowed for shared library
execute abc;
ERROR HY000: No paths allowed for shared library
deallocate prepare abc;
mysql-test/r/windows.result
View file @
121555dc
...
@@ -6,3 +6,17 @@ use prn;
...
@@ -6,3 +6,17 @@ use prn;
ERROR 42000: Unknown database 'prn'
ERROR 42000: Unknown database 'prn'
create table nu (a int);
create table nu (a int);
drop table nu;
drop table nu;
create procedure proc_1() install plugin my_plug soname '\\root\\some_plugin.dll';
call proc_1();
ERROR HY000: No paths allowed for shared library
call proc_1();
ERROR HY000: No paths allowed for shared library
call proc_1();
ERROR HY000: No paths allowed for shared library
drop procedure proc_1;
prepare abc from "install plugin my_plug soname '\\\\root\\\\some_plugin.dll'";
execute abc;
ERROR HY000: No paths allowed for shared library
execute abc;
ERROR HY000: No paths allowed for shared library
deallocate prepare abc;
mysql-test/t/ps.test
View file @
121555dc
...
@@ -2092,14 +2092,6 @@ drop view v1;
...
@@ -2092,14 +2092,6 @@ drop view v1;
drop
table
t1
;
drop
table
t1
;
create
procedure
proc_1
()
install
plugin
my_plug
soname
'/root/some_plugin.so'
;
--
error
ER_UDF_NO_PATHS
call
proc_1
();
--
error
ER_UDF_NO_PATHS
call
proc_1
();
--
error
ER_UDF_NO_PATHS
call
proc_1
();
drop
procedure
proc_1
;
create
procedure
proc_1
()
install
plugin
my_plug
soname
'some_plugin.so'
;
create
procedure
proc_1
()
install
plugin
my_plug
soname
'some_plugin.so'
;
--
replace_regex
/
(
Can
\
't open shared library).*$/\1/
--
replace_regex
/
(
Can
\
't open shared library).*$/\1/
--error ER_CANT_OPEN_LIBRARY
--error ER_CANT_OPEN_LIBRARY
...
@@ -2119,12 +2111,6 @@ delimiter ;|
...
@@ -2119,12 +2111,6 @@ delimiter ;|
select func_1(), func_1(), func_1() from dual;
select func_1(), func_1(), func_1() from dual;
--error ER_SP_DOES_NOT_EXIST
--error ER_SP_DOES_NOT_EXIST
drop function func_1;
drop function func_1;
prepare abc from "install plugin my_plug soname '
/
root
/
some_plugin
.
so
'";
--error ER_UDF_NO_PATHS
execute abc;
--error ER_UDF_NO_PATHS
execute abc;
deallocate prepare abc;
prepare abc from "install plugin my_plug soname '
some_plugin
.
so
'";
prepare abc from "install plugin my_plug soname '
some_plugin
.
so
'";
deallocate prepare abc;
deallocate prepare abc;
...
...
mysql-test/t/ps_not_windows.test
0 → 100644
View file @
121555dc
# Non-windows specific ps tests.
--
source
include
/
not_windows
.
inc
#
# Bug #20665: All commands supported in Stored Procedures should work in
# Prepared Statements
#
create
procedure
proc_1
()
install
plugin
my_plug
soname
'/root/some_plugin.so'
;
--
error
ER_UDF_NO_PATHS
call
proc_1
();
--
error
ER_UDF_NO_PATHS
call
proc_1
();
--
error
ER_UDF_NO_PATHS
call
proc_1
();
drop
procedure
proc_1
;
prepare
abc
from
"install plugin my_plug soname '/root/some_plugin.so'"
;
--
error
ER_UDF_NO_PATHS
execute
abc
;
--
error
ER_UDF_NO_PATHS
execute
abc
;
deallocate
prepare
abc
;
mysql-test/t/windows.test
View file @
121555dc
...
@@ -18,3 +18,25 @@ create table nu (a int);
...
@@ -18,3 +18,25 @@ create table nu (a int);
drop
table
nu
;
drop
table
nu
;
# End of 4.1 tests
# End of 4.1 tests
#
# Bug #20665: All commands supported in Stored Procedures should work in
# Prepared Statements
#
create
procedure
proc_1
()
install
plugin
my_plug
soname
'\\root\\some_plugin.dll'
;
--
error
ER_UDF_NO_PATHS
call
proc_1
();
--
error
ER_UDF_NO_PATHS
call
proc_1
();
--
error
ER_UDF_NO_PATHS
call
proc_1
();
drop
procedure
proc_1
;
prepare
abc
from
"install plugin my_plug soname '
\\\\
root
\\\\
some_plugin.dll'"
;
--
error
ER_UDF_NO_PATHS
execute
abc
;
--
error
ER_UDF_NO_PATHS
execute
abc
;
deallocate
prepare
abc
;
sql/log_event.cc
View file @
121555dc
...
@@ -140,6 +140,21 @@ static void pretty_print_str(IO_CACHE* cache, char* str, int len)
...
@@ -140,6 +140,21 @@ static void pretty_print_str(IO_CACHE* cache, char* str, int len)
}
}
#endif
/* MYSQL_CLIENT */
#endif
/* MYSQL_CLIENT */
#ifdef HAVE_purify
static
void
valgrind_check_mem
(
void
*
ptr
,
size_t
len
)
{
static
volatile
uchar
dummy
;
for
(
volatile
uchar
*
p
=
(
uchar
*
)
ptr
;
p
!=
(
uchar
*
)
ptr
+
len
;
++
p
)
{
int
const
c
=
*
p
;
if
(
c
<
128
)
dummy
=
c
+
1
;
else
dummy
=
c
-
1
;
}
}
#endif
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
...
@@ -5402,7 +5417,13 @@ int Rows_log_event::do_add_row_data(byte *const row_data,
...
@@ -5402,7 +5417,13 @@ int Rows_log_event::do_add_row_data(byte *const row_data,
DBUG_ENTER
(
"Rows_log_event::do_add_row_data"
);
DBUG_ENTER
(
"Rows_log_event::do_add_row_data"
);
DBUG_PRINT
(
"enter"
,
(
"row_data: 0x%lx length: %lu"
,
(
ulong
)
row_data
,
DBUG_PRINT
(
"enter"
,
(
"row_data: 0x%lx length: %lu"
,
(
ulong
)
row_data
,
length
));
length
));
/*
Don't print debug messages when running valgrind since they can
trigger false warnings.
*/
#ifndef HAVE_purify
DBUG_DUMP
(
"row_data"
,
(
const
char
*
)
row_data
,
min
(
length
,
32
));
DBUG_DUMP
(
"row_data"
,
(
const
char
*
)
row_data
,
min
(
length
,
32
));
#endif
DBUG_ASSERT
(
m_rows_buf
<=
m_rows_cur
);
DBUG_ASSERT
(
m_rows_buf
<=
m_rows_cur
);
DBUG_ASSERT
(
!
m_rows_buf
||
m_rows_end
&&
m_rows_buf
<
m_rows_end
);
DBUG_ASSERT
(
!
m_rows_buf
||
m_rows_end
&&
m_rows_buf
<
m_rows_end
);
...
@@ -5446,14 +5467,13 @@ int Rows_log_event::do_add_row_data(byte *const row_data,
...
@@ -5446,14 +5467,13 @@ int Rows_log_event::do_add_row_data(byte *const row_data,
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
/*
/*
Unpack a row into
a record
.
Unpack a row into
table->record[0]
.
SYNOPSIS
SYNOPSIS
unpack_row()
unpack_row()
rli Relay log info
rli Relay log info
table Table to unpack into
table Table to unpack into
colcnt Number of columns to read from record
colcnt Number of columns to read from record
record Record where the data should be unpacked
row Packed row data
row Packed row data
cols Pointer to columns data to fill in
cols Pointer to columns data to fill in
row_end Pointer to variable that will hold the value of the
row_end Pointer to variable that will hold the value of the
...
@@ -5466,6 +5486,11 @@ int Rows_log_event::do_add_row_data(byte *const row_data,
...
@@ -5466,6 +5486,11 @@ int Rows_log_event::do_add_row_data(byte *const row_data,
DESCRIPTION
DESCRIPTION
The function will always unpack into the table->record[0]
record. This is because there are too many dependencies on
where the various member functions of Field and subclasses
expect to write.
The row is assumed to only consist of the fields for which the
The row is assumed to only consist of the fields for which the
bitset represented by 'arr' and 'bits'; the other parts of the
bitset represented by 'arr' and 'bits'; the other parts of the
record are left alone.
record are left alone.
...
@@ -5484,13 +5509,15 @@ int Rows_log_event::do_add_row_data(byte *const row_data,
...
@@ -5484,13 +5509,15 @@ int Rows_log_event::do_add_row_data(byte *const row_data,
*/
*/
static
int
static
int
unpack_row
(
RELAY_LOG_INFO
*
rli
,
unpack_row
(
RELAY_LOG_INFO
*
rli
,
TABLE
*
table
,
uint
const
colcnt
,
byte
*
record
,
TABLE
*
table
,
uint
const
colcnt
,
char
const
*
row
,
MY_BITMAP
const
*
cols
,
char
const
*
row
,
MY_BITMAP
const
*
cols
,
char
const
**
row_end
,
ulong
*
master_reclength
,
char
const
**
row_end
,
ulong
*
master_reclength
,
MY_BITMAP
*
const
rw_set
,
Log_event_type
const
event_type
)
MY_BITMAP
*
const
rw_set
,
Log_event_type
const
event_type
)
{
{
byte
*
const
record
=
table
->
record
[
0
];
DBUG_ENTER
(
"unpack_row"
);
DBUG_ASSERT
(
record
&&
row
);
DBUG_ASSERT
(
record
&&
row
);
my_ptrdiff_t
const
offset
=
record
-
(
byte
*
)
table
->
record
[
0
]
;
DBUG_PRINT
(
"enter"
,
(
"row=0x%lx; table->record[0]=0x%lx"
,
row
,
record
))
;
my_size_t
master_null_bytes
=
table
->
s
->
null_bytes
;
my_size_t
master_null_bytes
=
table
->
s
->
null_bytes
;
if
(
colcnt
!=
table
->
s
->
fields
)
if
(
colcnt
!=
table
->
s
->
fields
)
...
@@ -5530,9 +5557,11 @@ unpack_row(RELAY_LOG_INFO *rli,
...
@@ -5530,9 +5557,11 @@ unpack_row(RELAY_LOG_INFO *rli,
if
(
bitmap_is_set
(
cols
,
field_ptr
-
begin_ptr
))
if
(
bitmap_is_set
(
cols
,
field_ptr
-
begin_ptr
))
{
{
f
->
move_field_offset
(
offset
);
DBUG_ASSERT
(
table
->
record
[
0
]
<=
f
->
ptr
);
DBUG_ASSERT
(
f
->
ptr
<
table
->
record
[
0
]
+
table
->
s
->
reclength
+
(
f
->
pack_length_in_rec
()
==
0
));
DBUG_PRINT
(
"info"
,
(
"unpacking column '%s' to 0x%lx"
,
f
->
field_name
,
f
->
ptr
));
ptr
=
f
->
unpack
(
f
->
ptr
,
ptr
);
ptr
=
f
->
unpack
(
f
->
ptr
,
ptr
);
f
->
move_field_offset
(
-
offset
);
/* Field...::unpack() cannot return 0 */
/* Field...::unpack() cannot return 0 */
DBUG_ASSERT
(
ptr
!=
NULL
);
DBUG_ASSERT
(
ptr
!=
NULL
);
}
}
...
@@ -5563,13 +5592,10 @@ unpack_row(RELAY_LOG_INFO *rli,
...
@@ -5563,13 +5592,10 @@ unpack_row(RELAY_LOG_INFO *rli,
for
(
;
*
field_ptr
;
++
field_ptr
)
for
(
;
*
field_ptr
;
++
field_ptr
)
{
{
uint32
const
mask
=
NOT_NULL_FLAG
|
NO_DEFAULT_VALUE_FLAG
;
uint32
const
mask
=
NOT_NULL_FLAG
|
NO_DEFAULT_VALUE_FLAG
;
Field
*
const
f
=
*
field_ptr
;
DBUG_PRINT
(
"debug"
,
(
"flags = 0x%x, mask = 0x%x, flags & mask = 0x%x"
,
DBUG_PRINT
(
"info"
,
(
"processing column '%s' @ 0x%lx"
,
f
->
field_name
,
f
->
ptr
));
(
*
field_ptr
)
->
flags
,
mask
,
if
(
event_type
==
WRITE_ROWS_EVENT
&&
(
f
->
flags
&
mask
)
==
mask
)
(
*
field_ptr
)
->
flags
&
mask
));
if
(
event_type
==
WRITE_ROWS_EVENT
&&
((
*
field_ptr
)
->
flags
&
mask
)
==
mask
)
{
{
slave_print_msg
(
ERROR_LEVEL
,
rli
,
ER_NO_DEFAULT_FOR_FIELD
,
slave_print_msg
(
ERROR_LEVEL
,
rli
,
ER_NO_DEFAULT_FOR_FIELD
,
"Field `%s` of table `%s`.`%s` "
"Field `%s` of table `%s`.`%s` "
...
@@ -5579,10 +5605,10 @@ unpack_row(RELAY_LOG_INFO *rli,
...
@@ -5579,10 +5605,10 @@ unpack_row(RELAY_LOG_INFO *rli,
error
=
ER_NO_DEFAULT_FOR_FIELD
;
error
=
ER_NO_DEFAULT_FOR_FIELD
;
}
}
else
else
(
*
field_ptr
)
->
set_default
();
f
->
set_default
();
}
}
return
error
;
DBUG_RETURN
(
error
)
;
}
}
int
Rows_log_event
::
exec_event
(
st_relay_log_info
*
rli
)
int
Rows_log_event
::
exec_event
(
st_relay_log_info
*
rli
)
...
@@ -5690,7 +5716,6 @@ int Rows_log_event::exec_event(st_relay_log_info *rli)
...
@@ -5690,7 +5716,6 @@ int Rows_log_event::exec_event(st_relay_log_info *rli)
We also invalidate the query cache for all the tables, since
We also invalidate the query cache for all the tables, since
they will now be changed.
they will now be changed.
*/
*/
TABLE_LIST
*
ptr
;
TABLE_LIST
*
ptr
;
for
(
ptr
=
rli
->
tables_to_lock
;
ptr
;
ptr
=
ptr
->
next_global
)
for
(
ptr
=
rli
->
tables_to_lock
;
ptr
;
ptr
=
ptr
->
next_global
)
{
{
...
@@ -6048,7 +6073,13 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len,
...
@@ -6048,7 +6073,13 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len,
DBUG_PRINT
(
"info"
,(
"event_len=%ld, common_header_len=%d, post_header_len=%d"
,
DBUG_PRINT
(
"info"
,(
"event_len=%ld, common_header_len=%d, post_header_len=%d"
,
event_len
,
common_header_len
,
post_header_len
));
event_len
,
common_header_len
,
post_header_len
));
/*
Don't print debug messages when running valgrind since they can
trigger false warnings.
*/
#ifndef HAVE_purify
DBUG_DUMP
(
"event buffer"
,
buf
,
event_len
);
DBUG_DUMP
(
"event buffer"
,
buf
,
event_len
);
#endif
/* Read the post-header */
/* Read the post-header */
const
char
*
post_start
=
buf
+
common_header_len
;
const
char
*
post_start
=
buf
+
common_header_len
;
...
@@ -6423,17 +6454,15 @@ int Write_rows_log_event::do_after_row_operations(TABLE *table, int error)
...
@@ -6423,17 +6454,15 @@ int Write_rows_log_event::do_after_row_operations(TABLE *table, int error)
int
Write_rows_log_event
::
do_prepare_row
(
THD
*
thd
,
RELAY_LOG_INFO
*
rli
,
int
Write_rows_log_event
::
do_prepare_row
(
THD
*
thd
,
RELAY_LOG_INFO
*
rli
,
TABLE
*
table
,
TABLE
*
table
,
char
const
*
row_start
,
char
const
*
const
row_start
,
char
const
**
row_end
)
char
const
**
const
row_end
)
{
{
DBUG_ASSERT
(
table
!=
NULL
);
DBUG_ASSERT
(
table
!=
NULL
);
DBUG_ASSERT
(
row_start
&&
row_end
);
DBUG_ASSERT
(
row_start
&&
row_end
);
int
error
;
int
error
;
error
=
unpack_row
(
rli
,
error
=
unpack_row
(
rli
,
table
,
m_width
,
row_start
,
&
m_cols
,
row_end
,
table
,
m_width
,
table
->
record
[
0
],
&
m_master_reclength
,
table
->
write_set
,
WRITE_ROWS_EVENT
);
row_start
,
&
m_cols
,
row_end
,
&
m_master_reclength
,
table
->
write_set
,
WRITE_ROWS_EVENT
);
bitmap_copy
(
table
->
read_set
,
table
->
write_set
);
bitmap_copy
(
table
->
read_set
,
table
->
write_set
);
return
error
;
return
error
;
}
}
...
@@ -6495,7 +6524,7 @@ copy_extra_record_fields(TABLE *table,
...
@@ -6495,7 +6524,7 @@ copy_extra_record_fields(TABLE *table,
my_ptrdiff_t
master_fields
)
my_ptrdiff_t
master_fields
)
{
{
DBUG_PRINT
(
"info"
,
(
"Copying to %p "
DBUG_PRINT
(
"info"
,
(
"Copying to %p "
"from field %d at offset %u "
"from field %
l
d at offset %u "
"to field %d at offset %u"
,
"to field %d at offset %u"
,
table
->
record
[
0
],
table
->
record
[
0
],
master_fields
,
master_reclength
,
master_fields
,
master_reclength
,
...
@@ -6733,8 +6762,26 @@ static bool record_compare(TABLE *table)
...
@@ -6733,8 +6762,26 @@ static bool record_compare(TABLE *table)
/*
/*
Find the row given by 'key', if the table has keys, or else use a table scan
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
to find (and fetch) the row.
records, a combination of position() and rnd_pos() will be used.
If the engine allows random access of the records, a combination of
position() and rnd_pos() will be used.
@param table Pointer to table to search
@param key Pointer to key to use for search, if table has key
@pre <code>table->record[0]</code> shall contain the row to locate
and <code>key</code> shall contain a key to use for searching, if
the engine has a key.
@post If the return value is zero, <code>table->record[1]</code>
will contain the fetched row and the internal "cursor" will refer to
the row. If the return value is non-zero,
<code>table->record[1]</code> is undefined. In either case,
<code>table->record[0]</code> is undefined.
@return Zero if the row was successfully fetched into
<code>table->record[1]</code>, error code otherwise.
*/
*/
static
int
find_and_fetch_row
(
TABLE
*
table
,
byte
*
key
)
static
int
find_and_fetch_row
(
TABLE
*
table
,
byte
*
key
)
...
@@ -6754,13 +6801,28 @@ static int find_and_fetch_row(TABLE *table, byte *key)
...
@@ -6754,13 +6801,28 @@ static int find_and_fetch_row(TABLE *table, byte *key)
row reference using the position() member function (it will be
row reference using the position() member function (it will be
stored in table->file->ref) and the use rnd_pos() to position
stored in table->file->ref) and the use rnd_pos() to position
the "cursor" (i.e., record[0] in this case) at the correct row.
the "cursor" (i.e., record[0] in this case) at the correct row.
TODO: Add a check that the correct record has been fetched by
comparing with the original record. Take into account that the
record on the master and slave can be of different
length. Something along these lines should work:
ADD>>> store_record(table,record[1]);
int error= table->file->rnd_pos(table->record[0], table->file->ref);
ADD>>> DBUG_ASSERT(memcmp(table->record[1], table->record[0],
table->s->reclength) == 0);
*/
*/
table
->
file
->
position
(
table
->
record
[
0
]);
table
->
file
->
position
(
table
->
record
[
0
]);
DBUG_RETURN
(
table
->
file
->
rnd_pos
(
table
->
record
[
0
],
table
->
file
->
ref
));
int
error
=
table
->
file
->
rnd_pos
(
table
->
record
[
0
],
table
->
file
->
ref
);
/*
rnd_pos() returns the record in table->record[0], so we have to
move it to table->record[1].
*/
bmove_align
(
table
->
record
[
1
],
table
->
record
[
0
],
table
->
s
->
reclength
);
DBUG_RETURN
(
error
);
}
}
DBUG_ASSERT
(
table
->
record
[
1
]);
/* We need to retrieve all fields */
/* We need to retrieve all fields */
/* TODO: Move this out from this function to main loop */
/* TODO: Move this out from this function to main loop */
table
->
use_all_columns
();
table
->
use_all_columns
();
...
@@ -6770,7 +6832,16 @@ static int find_and_fetch_row(TABLE *table, byte *key)
...
@@ -6770,7 +6832,16 @@ static int find_and_fetch_row(TABLE *table, byte *key)
int
error
;
int
error
;
/* We have a key: search the table using the index */
/* We have a key: search the table using the index */
if
(
!
table
->
file
->
inited
&&
(
error
=
table
->
file
->
ha_index_init
(
0
,
FALSE
)))
if
(
!
table
->
file
->
inited
&&
(
error
=
table
->
file
->
ha_index_init
(
0
,
FALSE
)))
return
error
;
DBUG_RETURN
(
error
);
/*
Don't print debug messages when running valgrind since they can
trigger false warnings.
*/
#ifndef HAVE_purify
DBUG_DUMP
(
"table->record[0]"
,
table
->
record
[
0
],
table
->
s
->
reclength
);
DBUG_DUMP
(
"table->record[1]"
,
table
->
record
[
1
],
table
->
s
->
reclength
);
#endif
/*
/*
We need to set the null bytes to ensure that the filler bit are
We need to set the null bytes to ensure that the filler bit are
...
@@ -6790,6 +6861,14 @@ static int find_and_fetch_row(TABLE *table, byte *key)
...
@@ -6790,6 +6861,14 @@ static int find_and_fetch_row(TABLE *table, byte *key)
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
}
}
/*
Don't print debug messages when running valgrind since they can
trigger false warnings.
*/
#ifndef HAVE_purify
DBUG_DUMP
(
"table->record[0]"
,
table
->
record
[
0
],
table
->
s
->
reclength
);
DBUG_DUMP
(
"table->record[1]"
,
table
->
record
[
1
],
table
->
s
->
reclength
);
#endif
/*
/*
Below is a minor "optimization". If the key (i.e., key number
Below is a minor "optimization". If the key (i.e., key number
0) has the HA_NOSAME flag set, we know that we have found the
0) has the HA_NOSAME flag set, we know that we have found the
...
@@ -6974,8 +7053,8 @@ int Delete_rows_log_event::do_after_row_operations(TABLE *table, int error)
...
@@ -6974,8 +7053,8 @@ int Delete_rows_log_event::do_after_row_operations(TABLE *table, int error)
int
Delete_rows_log_event
::
do_prepare_row
(
THD
*
thd
,
RELAY_LOG_INFO
*
rli
,
int
Delete_rows_log_event
::
do_prepare_row
(
THD
*
thd
,
RELAY_LOG_INFO
*
rli
,
TABLE
*
table
,
TABLE
*
table
,
char
const
*
row_start
,
char
const
*
const
row_start
,
char
const
**
row_end
)
char
const
**
const
row_end
)
{
{
int
error
;
int
error
;
DBUG_ASSERT
(
row_start
&&
row_end
);
DBUG_ASSERT
(
row_start
&&
row_end
);
...
@@ -6985,10 +7064,8 @@ int Delete_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO *rli,
...
@@ -6985,10 +7064,8 @@ int Delete_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO *rli,
*/
*/
DBUG_ASSERT
(
table
->
s
->
fields
>=
m_width
);
DBUG_ASSERT
(
table
->
s
->
fields
>=
m_width
);
error
=
unpack_row
(
rli
,
error
=
unpack_row
(
rli
,
table
,
m_width
,
row_start
,
&
m_cols
,
row_end
,
table
,
m_width
,
table
->
record
[
0
],
&
m_master_reclength
,
table
->
read_set
,
DELETE_ROWS_EVENT
);
row_start
,
&
m_cols
,
row_end
,
&
m_master_reclength
,
table
->
read_set
,
DELETE_ROWS_EVENT
);
/*
/*
If we will access rows using the random access method, m_key will
If we will access rows using the random access method, m_key will
be set to NULL, so we do not need to make a key copy in that case.
be set to NULL, so we do not need to make a key copy in that case.
...
@@ -7111,8 +7188,8 @@ int Update_rows_log_event::do_after_row_operations(TABLE *table, int error)
...
@@ -7111,8 +7188,8 @@ int Update_rows_log_event::do_after_row_operations(TABLE *table, int error)
int
Update_rows_log_event
::
do_prepare_row
(
THD
*
thd
,
RELAY_LOG_INFO
*
rli
,
int
Update_rows_log_event
::
do_prepare_row
(
THD
*
thd
,
RELAY_LOG_INFO
*
rli
,
TABLE
*
table
,
TABLE
*
table
,
char
const
*
row_start
,
char
const
*
const
row_start
,
char
const
**
row_end
)
char
const
**
const
row_end
)
{
{
int
error
;
int
error
;
DBUG_ASSERT
(
row_start
&&
row_end
);
DBUG_ASSERT
(
row_start
&&
row_end
);
...
@@ -7122,21 +7199,31 @@ int Update_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO *rli,
...
@@ -7122,21 +7199,31 @@ int Update_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO *rli,
*/
*/
DBUG_ASSERT
(
table
->
s
->
fields
>=
m_width
);
DBUG_ASSERT
(
table
->
s
->
fields
>=
m_width
);
/*
We need to perform some juggling below since unpack_row() always
unpacks into table->record[0]. For more information, see the
comments for unpack_row().
*/
/* record[0] is the before image for the update */
/* record[0] is the before image for the update */
error
=
unpack_row
(
rli
,
error
=
unpack_row
(
rli
,
table
,
m_width
,
row_start
,
&
m_cols
,
row_end
,
table
,
m_width
,
table
->
record
[
0
],
&
m_master_reclength
,
table
->
read_set
,
UPDATE_ROWS_EVENT
);
row_start
,
&
m_cols
,
row_end
,
&
m_master_reclength
,
store_record
(
table
,
record
[
1
]);
table
->
read_set
,
UPDATE_ROWS_EVENT
);
char
const
*
next_start
=
*
row_end
;
row_start
=
*
row_end
;
/* m_after_image is the after image for the update */
/* m_after_image is the after image for the update */
error
=
unpack_row
(
rli
,
error
=
unpack_row
(
rli
,
table
,
m_width
,
next_start
,
&
m_cols
,
row_end
,
table
,
m_width
,
m_after_image
,
&
m_master_reclength
,
table
->
write_set
,
UPDATE_ROWS_EVENT
);
row_start
,
&
m_cols
,
row_end
,
&
m_master_reclength
,
bmove_align
(
m_after_image
,
table
->
record
[
0
],
table
->
s
->
reclength
);
table
->
write_set
,
UPDATE_ROWS_EVENT
);
restore_record
(
table
,
record
[
1
]
);
/*
Don't print debug messages when running valgrind since they can
trigger false warnings.
*/
#ifndef HAVE_purify
DBUG_DUMP
(
"record[0]"
,
(
const
char
*
)
table
->
record
[
0
],
table
->
s
->
reclength
);
DBUG_DUMP
(
"record[0]"
,
(
const
char
*
)
table
->
record
[
0
],
table
->
s
->
reclength
);
DBUG_DUMP
(
"m_after_image"
,
(
const
char
*
)
m_after_image
,
table
->
s
->
reclength
);
DBUG_DUMP
(
"m_after_image"
,
(
const
char
*
)
m_after_image
,
table
->
s
->
reclength
);
#endif
/*
/*
If we will access rows using the random access method, m_key will
If we will access rows using the random access method, m_key will
...
...
sql/sql_binlog.cc
View file @
121555dc
...
@@ -79,9 +79,15 @@ void mysql_client_binlog_statement(THD* thd)
...
@@ -79,9 +79,15 @@ void mysql_client_binlog_statement(THD* thd)
char
const
*
endptr
=
0
;
char
const
*
endptr
=
0
;
int
bytes_decoded
=
base64_decode
(
strptr
,
coded_len
,
buf
,
&
endptr
);
int
bytes_decoded
=
base64_decode
(
strptr
,
coded_len
,
buf
,
&
endptr
);
#ifndef HAVE_purify
/*
This debug printout should not be used for valgrind builds
since it will read from unassigned memory.
*/
DBUG_PRINT
(
"info"
,
DBUG_PRINT
(
"info"
,
(
"bytes_decoded=%d; strptr=0x%lu; endptr=0x%lu ('%c':%d)"
,
(
"bytes_decoded=%d; strptr=0x%lu; endptr=0x%lu ('%c':%d)"
,
bytes_decoded
,
strptr
,
endptr
,
*
endptr
,
*
endptr
));
bytes_decoded
,
strptr
,
endptr
,
*
endptr
,
*
endptr
));
#endif
if
(
bytes_decoded
<
0
)
if
(
bytes_decoded
<
0
)
{
{
...
@@ -147,8 +153,14 @@ void mysql_client_binlog_statement(THD* thd)
...
@@ -147,8 +153,14 @@ void mysql_client_binlog_statement(THD* thd)
DBUG_PRINT
(
"info"
,(
"ev->get_type_code()=%d"
,
ev
->
get_type_code
()));
DBUG_PRINT
(
"info"
,(
"ev->get_type_code()=%d"
,
ev
->
get_type_code
()));
DBUG_PRINT
(
"info"
,(
"bufptr+EVENT_TYPE_OFFSET=0x%lx"
,
DBUG_PRINT
(
"info"
,(
"bufptr+EVENT_TYPE_OFFSET=0x%lx"
,
bufptr
+
EVENT_TYPE_OFFSET
));
bufptr
+
EVENT_TYPE_OFFSET
));
#ifndef HAVE_purify
/*
This debug printout should not be used for valgrind builds
since it will read from unassigned memory.
*/
DBUG_PRINT
(
"info"
,
(
"bytes_decoded=%d; bufptr=0x%lx; buf[EVENT_LEN_OFFSET]=%u"
,
DBUG_PRINT
(
"info"
,
(
"bytes_decoded=%d; bufptr=0x%lx; buf[EVENT_LEN_OFFSET]=%u"
,
bytes_decoded
,
bufptr
,
uint4korr
(
bufptr
+
EVENT_LEN_OFFSET
)));
bytes_decoded
,
bufptr
,
uint4korr
(
bufptr
+
EVENT_LEN_OFFSET
)));
#endif
ev
->
thd
=
thd
;
ev
->
thd
=
thd
;
if
(
int
err
=
ev
->
exec_event
(
thd
->
rli_fake
))
if
(
int
err
=
ev
->
exec_event
(
thd
->
rli_fake
))
{
{
...
...
sql/sql_class.cc
View file @
121555dc
...
@@ -2728,10 +2728,16 @@ int THD::binlog_update_row(TABLE* table, bool is_trans,
...
@@ -2728,10 +2728,16 @@ int THD::binlog_update_row(TABLE* table, bool is_trans,
my_size_t
const
after_size
=
pack_row
(
table
,
cols
,
after_row
,
my_size_t
const
after_size
=
pack_row
(
table
,
cols
,
after_row
,
after_record
);
after_record
);
/*
Don't print debug messages when running valgrind since they can
trigger false warnings.
*/
#ifndef HAVE_purify
DBUG_DUMP
(
"before_record"
,
(
const
char
*
)
before_record
,
table
->
s
->
reclength
);
DBUG_DUMP
(
"before_record"
,
(
const
char
*
)
before_record
,
table
->
s
->
reclength
);
DBUG_DUMP
(
"after_record"
,
(
const
char
*
)
after_record
,
table
->
s
->
reclength
);
DBUG_DUMP
(
"after_record"
,
(
const
char
*
)
after_record
,
table
->
s
->
reclength
);
DBUG_DUMP
(
"before_row"
,
(
const
char
*
)
before_row
,
before_size
);
DBUG_DUMP
(
"before_row"
,
(
const
char
*
)
before_row
,
before_size
);
DBUG_DUMP
(
"after_row"
,
(
const
char
*
)
after_row
,
after_size
);
DBUG_DUMP
(
"after_row"
,
(
const
char
*
)
after_row
,
after_size
);
#endif
Rows_log_event
*
const
ev
=
Rows_log_event
*
const
ev
=
binlog_prepare_pending_rows_event
(
table
,
server_id
,
cols
,
colcnt
,
binlog_prepare_pending_rows_event
(
table
,
server_id
,
cols
,
colcnt
,
...
...
storage/ndb/src/ndbapi/Ndbinit.cpp
View file @
121555dc
...
@@ -146,12 +146,13 @@ Ndb::~Ndb()
...
@@ -146,12 +146,13 @@ Ndb::~Ndb()
}
}
doDisconnect
();
doDisconnect
();
delete
theEventBuffer
;
/* Disconnect from transporter to stop signals from coming in */
if
(
theImpl
->
m_transporter_facade
!=
NULL
&&
theNdbBlockNumber
>
0
){
if
(
theImpl
->
m_transporter_facade
!=
NULL
&&
theNdbBlockNumber
>
0
){
theImpl
->
m_transporter_facade
->
close
(
theNdbBlockNumber
,
theFirstTransId
);
theImpl
->
m_transporter_facade
->
close
(
theNdbBlockNumber
,
theFirstTransId
);
}
}
delete
theEventBuffer
;
releaseTransactionArrays
();
releaseTransactionArrays
();
delete
[]
theConnectionArray
;
delete
[]
theConnectionArray
;
...
...
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