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
22285bb7
Commit
22285bb7
authored
Jun 26, 2006
by
knielsen@rt.int.sifira.dk
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/usr/local/mysql/mysql-5.1-bug20549
into mysql.com:/usr/local/mysql/tmp-5.1
parents
72e8a44d
bd5f334b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
sql/ha_ndbcluster_binlog.cc
sql/ha_ndbcluster_binlog.cc
+18
-3
sql/sql_class.cc
sql/sql_class.cc
+6
-2
No files found.
sql/ha_ndbcluster_binlog.cc
View file @
22285bb7
...
...
@@ -311,8 +311,10 @@ ndbcluster_binlog_open_table(THD *thd, NDB_SHARE *share,
if
(
!
reopen
)
{
// allocate memory on ndb share so it can be reused after online alter table
share
->
record
[
0
]
=
(
byte
*
)
alloc_root
(
&
share
->
mem_root
,
table
->
s
->
rec_buff_length
);
share
->
record
[
1
]
=
(
byte
*
)
alloc_root
(
&
share
->
mem_root
,
table
->
s
->
rec_buff_length
);
(
void
)
multi_alloc_root
(
&
share
->
mem_root
,
&
(
share
->
record
[
0
]),
table
->
s
->
rec_buff_length
,
&
(
share
->
record
[
1
]),
table
->
s
->
rec_buff_length
,
NULL
);
}
{
my_ptrdiff_t
row_offset
=
share
->
record
[
0
]
-
table
->
record
[
0
];
...
...
@@ -2159,6 +2161,9 @@ int ndb_add_binlog_index(THD *thd, void *_row)
break
;
}
// Set all fields non-null.
if
(
binlog_index
->
s
->
null_bytes
>
0
)
bzero
(
binlog_index
->
record
[
0
],
binlog_index
->
s
->
null_bytes
);
binlog_index
->
field
[
0
]
->
store
(
row
.
master_log_pos
);
binlog_index
->
field
[
1
]
->
store
(
row
.
master_log_file
,
strlen
(
row
.
master_log_file
),
...
...
@@ -3275,6 +3280,13 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
thd
=
new
THD
;
/* note that contructor of THD uses DBUG_ */
THD_CHECK_SENTRY
(
thd
);
/* We need to set thd->thread_id before thd->store_globals, or it will
set an invalid value for thd->variables.pseudo_thread_id.
*/
pthread_mutex_lock
(
&
LOCK_thread_count
);
thd
->
thread_id
=
thread_id
++
;
pthread_mutex_unlock
(
&
LOCK_thread_count
);
thd
->
thread_stack
=
(
char
*
)
&
thd
;
/* remember where our stack is */
if
(
thd
->
store_globals
())
{
...
...
@@ -3307,7 +3319,6 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
pthread_detach_this_thread
();
thd
->
real_id
=
pthread_self
();
pthread_mutex_lock
(
&
LOCK_thread_count
);
thd
->
thread_id
=
thread_id
++
;
threads
.
append
(
thd
);
pthread_mutex_unlock
(
&
LOCK_thread_count
);
thd
->
lex
->
start_transaction_opt
=
0
;
...
...
@@ -3643,6 +3654,10 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
injector
::
transaction
::
table
tbl
(
table
,
TRUE
);
int
ret
=
trans
.
use_table
(
::
server_id
,
tbl
);
DBUG_ASSERT
(
ret
==
0
);
// Set all fields non-null.
if
(
table
->
s
->
null_bytes
>
0
)
bzero
(
table
->
record
[
0
],
table
->
s
->
null_bytes
);
table
->
field
[
0
]
->
store
((
longlong
)
::
server_id
);
table
->
field
[
1
]
->
store
((
longlong
)
gci
);
trans
.
write_row
(
::
server_id
,
...
...
sql/sql_class.cc
View file @
22285bb7
...
...
@@ -2506,15 +2506,19 @@ my_size_t THD::pack_row(TABLE *table, MY_BITMAP const* cols, byte *row_data,
int
n_null_bytes
=
table
->
s
->
null_bytes
;
byte
*
ptr
;
uint
i
;
my_ptrdiff_t
const
offset
=
(
my_ptrdiff_t
)
(
record
-
(
byte
*
)
table
->
record
[
0
])
;
my_ptrdiff_t
const
rec_offset
=
record
-
table
->
record
[
0
];
my_ptrdiff_t
const
def_offset
=
table
->
s
->
default_values
-
table
->
record
[
0
]
;
memcpy
(
row_data
,
record
,
n_null_bytes
);
ptr
=
row_data
+
n_null_bytes
;
for
(
i
=
0
;
(
field
=
*
p_field
)
;
i
++
,
p_field
++
)
{
if
(
bitmap_is_set
(
cols
,
i
))
{
my_ptrdiff_t
const
offset
=
field
->
is_null
(
rec_offset
)
?
def_offset
:
rec_offset
;
ptr
=
(
byte
*
)
field
->
pack
((
char
*
)
ptr
,
field
->
ptr
+
offset
);
}
}
return
(
static_cast
<
my_size_t
>
(
ptr
-
row_data
));
}
...
...
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