Commit 8d2d1520 authored by unknown's avatar unknown

Merge maint1.mysql.com:/data/localhome/tsmith/bk/50

into  maint1.mysql.com:/data/localhome/tsmith/bk/maint/50

parents 7edcebc9 416a49a6
......@@ -161,7 +161,7 @@ IF(EMBED_MANIFESTS)
ENDIF(NOT tmp_manifest)
# Set the processor architecture.
IF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
SET(PROCESSOR_ARCH "X64")
SET(PROCESSOR_ARCH "amd64")
ELSE(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
SET(PROCESSOR_ARCH "X86")
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
......
......@@ -686,6 +686,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case 'T':
opt_disable_keys=0;
if (strlen(argument) >= FN_REFLEN)
{
/*
This check is made because the some the file functions below
have FN_REFLEN sized stack allocated buffers and will cause
a crash even if the input destination buffer is large enough
to hold the output.
*/
die(EX_USAGE, "Input filename too long: %s", argument);
}
break;
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);
......@@ -2324,17 +2336,6 @@ static void dump_table(char *table, char *db)
{
char filename[FN_REFLEN], tmp_path[FN_REFLEN];
if (strlen(path) >= FN_REFLEN)
{
/*
This check is made because the some the file functions below
have FN_REFLEN sized stack allocated buffers and will cause
a crash even if the input destination buffer is large enough
to hold the output.
*/
die(EX_USAGE, "Input filename or options too long: %s", path);
}
/*
Convert the path to native os format
and resolve to the full filepath.
......
......@@ -895,7 +895,12 @@ typedef unsigned long uint32; /* Short for unsigned integer >= 32 bits */
typedef unsigned long ulong; /* Short for unsigned long */
#endif
#ifndef longlong_defined
#if defined(HAVE_LONG_LONG) && SIZEOF_LONG != 8
/*
Using [unsigned] long long is preferable as [u]longlong because we use
[unsigned] long long unconditionally in many places,
for example in constants with [U]LL suffix.
*/
#if defined(HAVE_LONG_LONG) && SIZEOF_LONG_LONG == 8
typedef unsigned long long int ulonglong; /* ulong or unsigned long long */
typedef long long int longlong;
#else
......
-- require r/have_outfile.require
disable_query_log;
select load_file(concat(@tmpdir,"/outfile.test"));
--exec rm $MYSQLTEST_VARDIR/tmp/outfile.test
--remove_file $MYSQLTEST_VARDIR/tmp/outfile.test
enable_query_log;
......@@ -142,6 +142,7 @@ sub spawn_impl ($$$$$$$) {
if ( $pid )
{
select(STDOUT) if $::glob_win32_perl;
return spawn_parent_impl($pid,$mode,$path);
}
else
......@@ -163,9 +164,6 @@ sub spawn_impl ($$$$$$$) {
{
# Don't redirect stdout on ActiveState perl since this is
# just another thread in the same process.
# Should be fixed so that the thread that is created with fork
# executes the exe in another process and wait's for it to return.
# In the meanwhile, we get all the output from mysqld's to screen
}
elsif ( ! open(STDOUT,$log_file_open_mode,$output) )
{
......@@ -175,7 +173,7 @@ sub spawn_impl ($$$$$$$) {
if ( $error )
{
if ( $output eq $error )
if ( !$::glob_win32_perl and $output eq $error )
{
if ( ! open(STDERR,">&STDOUT") )
{
......@@ -184,15 +182,7 @@ sub spawn_impl ($$$$$$$) {
}
else
{
if ( $::glob_win32_perl )
{
# Don't redirect stdout on ActiveState perl since this is
# just another thread in the same process.
# Should be fixed so that the thread that is created with fork
# executes the exe in another process and wait's for it to return.
# In the meanwhile, we get all the output from mysqld's to screen
}
elsif ( ! open(STDERR,$log_file_open_mode,$error) )
if ( ! open(STDERR,$log_file_open_mode,$error) )
{
mtr_child_error("can't redirect STDERR to \"$error\": $!");
}
......@@ -611,6 +601,11 @@ sub mtr_check_stop_servers ($) {
if ( $pid )
{
# Server is still alive, put it in list to be hard killed
if ($::glob_win32_perl)
{
# Kill the real process if it's known
$pid= $srv->{'real_pid'} if ($srv->{'real_pid'});
}
$kill_pids{$pid}= 1;
# Write a message to the process's error log (if it has one)
......@@ -664,6 +659,16 @@ sub mtr_check_stop_servers ($) {
}
}
if ($::glob_win32_perl and $srv->{'real_pid'})
{
# Wait for the pseudo pid - if the real_pid was known
# the pseudo pid has not been waited for yet, wai blocking
# since it's "such a simple program"
mtr_verbose("Wait for pseudo process $srv->{'pid'}");
my $ret_pid= waitpid($srv->{'pid'}, 0);
mtr_verbose("Pseudo process $ret_pid died");
}
$srv->{'pid'}= 0;
}
}
......@@ -1041,7 +1046,7 @@ sub sleep_until_file_created ($$$) {
{
if ( -r $pidfile )
{
return $pid;
return 1;
}
# Check if it died after the fork() was successful
......
......@@ -97,9 +97,14 @@ sub mtr_timer_start($$$) {
# clearing the signal handler.
$SIG{INT}= 'DEFAULT';
$SIG{TERM}= sub {
mtr_verbose("timer woke up, exiting!");
exit(0);
};
$0= "mtr_timer(timers,$name,$duration)";
mtr_verbose("timer child $name, sleep $duration");
sleep($duration);
mtr_verbose("timer expired after $duration seconds");
exit(0);
}
}
......@@ -118,7 +123,7 @@ sub mtr_timer_stop ($$) {
# FIXME as Cygwin reuses pids fast, maybe check that is
# the expected process somehow?!
kill(9, $tpid);
kill(15, $tpid);
# As the timers are so simple programs, we trust them to terminate,
# and use blocking wait for it. We wait just to avoid a zombie.
......
......@@ -2579,10 +2579,19 @@ sub ndbcluster_wait_started($$){
sub mysqld_wait_started($){
my $mysqld= shift;
my $res= sleep_until_file_created($mysqld->{'path_pid'},
if (sleep_until_file_created($mysqld->{'path_pid'},
$mysqld->{'start_timeout'},
$mysqld->{'pid'});
return $res == 0;
$mysqld->{'pid'}) == 0)
{
# Failed to wait for pid file
return 1;
}
# Get the "real pid" of the process, it will be used for killing
# the process in ActiveState's perl on windows
$mysqld->{'real_pid'}= mtr_get_pid_from_file($mysqld->{'path_pid'});
return 0;
}
......@@ -3720,7 +3729,6 @@ sub mysqld_arguments ($$$$) {
mtr_add_arg($args, "%s--no-defaults", $prefix);
mtr_add_arg($args, "%s--console", $prefix);
mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
......@@ -4093,6 +4101,7 @@ sub stop_all_servers () {
push(@kill_pids,{
pid => $mysqld->{'pid'},
real_pid => $mysqld->{'real_pid'},
pidfile => $mysqld->{'path_pid'},
sockfile => $mysqld->{'path_sock'},
port => $mysqld->{'port'},
......@@ -4300,6 +4309,7 @@ sub run_testcase_stop_servers($$$) {
push(@kill_pids,{
pid => $mysqld->{'pid'},
real_pid => $mysqld->{'real_pid'},
pidfile => $mysqld->{'path_pid'},
sockfile => $mysqld->{'path_sock'},
port => $mysqld->{'port'},
......@@ -4351,6 +4361,7 @@ sub run_testcase_stop_servers($$$) {
push(@kill_pids,{
pid => $mysqld->{'pid'},
real_pid => $mysqld->{'real_pid'},
pidfile => $mysqld->{'path_pid'},
sockfile => $mysqld->{'path_sock'},
port => $mysqld->{'port'},
......@@ -4775,12 +4786,10 @@ sub run_mysqltest ($) {
mtr_add_arg($args, "%s", $_) for @args_saved;
}
mtr_add_arg($args, "--test-file");
mtr_add_arg($args, $tinfo->{'path'});
mtr_add_arg($args, "--test-file=%s", $tinfo->{'path'});
if ( defined $tinfo->{'result_file'} ) {
mtr_add_arg($args, "--result-file");
mtr_add_arg($args, $tinfo->{'result_file'});
mtr_add_arg($args, "--result-file=%s", $tinfo->{'result_file'});
}
if ( $opt_record )
......
This diff is collapsed.
......@@ -3206,7 +3206,7 @@ DROP TABLE t1;
#
CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (1), (2);
mysqldump: Input filename or options too long: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
mysqldump: Input filename too long: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
DROP TABLE t1;
CREATE TABLE t2 (a int);
CREATE TABLE t3 (a int);
......
......@@ -40,7 +40,15 @@ CALL test_replication_sp2();
INSERT INTO t1 VALUES (test_replication_sf());
INSERT INTO t1 VALUES (test_replication_sf());
INSERT INTO t1 VALUES (test_replication_sf());
DROP PROCEDURE IF EXISTS test_replication_sp1;
DROP PROCEDURE IF EXISTS test_replication_sp2;
DROP FUNCTION IF EXISTS test_replication_sf;
DROP TABLE IF EXISTS t1;
select * from t1 into outfile "../tmp/t1_slave.txt";
create temporary table t1_slave select * from t1 where 1=0;
load data infile '../tmp/t1_slave.txt' into table t1_slave;
select count(*) into @aux from t1, t1_slave
where ABS(t1.col_a - t1_slave.col_a) < 0.0001 ;
SELECT @aux;
@aux
12
DROP PROCEDURE test_replication_sp1;
DROP PROCEDURE test_replication_sp2;
DROP FUNCTION test_replication_sf;
DROP TABLE t1, t1_slave;
mysqld is alive
End of 5.0 tests.
......@@ -3,16 +3,14 @@
#
-- source include/have_log_bin.inc
-- source include/not_embedded.inc
-- source include/have_bdb.inc
-- source include/have_innodb.inc
-- source include/have_log_bin.inc
--disable_warnings
drop table if exists t1, t2;
--enable_warnings
reset master;
create table t1 (a int) engine=bdb;
create table t1 (a int) engine=innodb;
create table t2 (a int) engine=innodb;
begin;
insert t1 values (5);
......@@ -49,3 +47,124 @@ show binlog events in 'master-bin.000001' from 98;
--replace_column 2 # 5 #
show binlog events in 'master-bin.000002' from 98;
#
# Bug#22540 - Incorrect value in column End_log_pos of
# SHOW BINLOG EVENTS using InnoDB
#
# the following tests will show that certain queries now return
# absolute offsets (from binlog start, rather than relative to
# the beginning of the current transaction). under what
# conditions it should be allowed / is sensible to put the
# slider into the middle of a transaction is not our concern
# here; we just guarantee that if and when it's done, the
# user has valid offsets to use. if the setter function still
# wants to throw a "positioning into middle of transaction"
# warning, that's its prerogative and handled elsewhere.
set @ac = @@autocommit;
# first show this to work for SHOW BINLOG EVENTS
set autocommit= 0;
reset master;
create table t1(n int) engine=innodb;
begin;
insert into t1 values (1);
insert into t1 values (2);
insert into t1 values (3);
commit;
drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;
set autocommit= 1;
reset master;
create table t1(n int) engine=innodb;
insert into t1 values (1);
insert into t1 values (2);
insert into t1 values (3);
commit;
drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;
reset master;
create table t1(n int) engine=myisam;
begin;
insert into t1 values (4);
insert into t1 values (5);
insert into t1 values (6);
commit;
drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;
# now show this also works for SHOW MASTER STATUS
# as this is what "mysqldump --master-data=1" uses.
set autocommit= 1;
reset master;
create table t1(n int) engine=innodb;
show master status;
insert into t1 values (1);
show master status;
insert into t1 values (2);
insert into t1 values (3);
show master status;
commit;
show master status;
drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;
set autocommit= 0;
reset master;
create table t1(n int) engine=myisam;
show master status;
insert into t1 values (4);
show master status;
insert into t1 values (5);
insert into t1 values (6);
show master status;
commit;
show master status;
drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;
set session autocommit = @ac;
# now show that nothing breaks if we need to read from the cache more
# than once, resulting in split event-headers
set @bcs = @@binlog_cache_size;
set @ac = @@autocommit;
set global binlog_cache_size=4096;
set autocommit= 0;
reset master;
create table t1 (a int) engine=innodb;
let $1=400;
disable_query_log;
begin;
while ($1)
{
eval insert into t1 values( $1 );
dec $1;
}
commit;
enable_query_log;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;
drop table t1;
set global binlog_cache_size=@bcs;
set session autocommit = @ac;
--echo End of 5.0 tests
......@@ -77,27 +77,37 @@ INSERT INTO t1 VALUES (test_replication_sf());
INSERT INTO t1 VALUES (test_replication_sf());
INSERT INTO t1 VALUES (test_replication_sf());
# Record the results of the query on the master
--exec $MYSQL --port=$MASTER_MYPORT test -e "SELECT * FROM test.t1" > $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql
--sync_slave_with_master
# Record the results of the query on the slave
--exec $MYSQL --port=$SLAVE_MYPORT test -e "SELECT * FROM test.t1" > $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql
# Dump table on slave
select * from t1 into outfile "../tmp/t1_slave.txt";
# Compare the results from the master to the slave.
--exec diff $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql
# Load data from slave into temp table on master
connection master;
create temporary table t1_slave select * from t1 where 1=0;
load data infile '../tmp/t1_slave.txt' into table t1_slave;
--remove_file $MYSQLTEST_VARDIR/tmp/t1_slave.txt
# Compare master and slave temp table, use subtraction
# for floating point comparison of "double"
select count(*) into @aux from t1, t1_slave
where ABS(t1.col_a - t1_slave.col_a) < 0.0001 ;
SELECT @aux;
if (`SELECT @aux <> 12 OR @aux IS NULL`)
{
--echo # ERROR: We expected to get count(*) = 12.
SELECT col_a FROM t1;
SELECT col_a FROM t1_slave;
--echo # abort
exit;
}
# Cleanup
connection master;
--disable_warnings
DROP PROCEDURE IF EXISTS test_replication_sp1;
DROP PROCEDURE IF EXISTS test_replication_sp2;
DROP FUNCTION IF EXISTS test_replication_sf;
DROP TABLE IF EXISTS t1;
--enable_warnings
DROP PROCEDURE test_replication_sp1;
DROP PROCEDURE test_replication_sp2;
DROP FUNCTION test_replication_sf;
DROP TABLE t1, t1_slave;
--sync_slave_with_master
# If all is good, when can cleanup our dump files.
--system rm $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql
--system rm $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql
......@@ -705,9 +705,11 @@ begin
insert into test.t1 values (concat(x, "2"), y+2);
end|
--system rm -f $MYSQLTEST_VARDIR/tmp/spout
# Check that file does not exists
--error 1
--file_exists $MYSQLTEST_VARDIR/tmp/spout
call into_outfile("ofile", 1)|
--system rm -f $MYSQLTEST_VARDIR/tmp/spout
--remove_file $MYSQLTEST_VARDIR/tmp/spout
delete from t1|
drop procedure into_outfile|
......@@ -722,9 +724,11 @@ begin
insert into test.t1 values (concat(x, "2"), y+2);
end|
--system rm -f $MYSQLTEST_VARDIR/tmp/spdump
# Check that file does not exists
--error 1
--file_exists $MYSQLTEST_VARDIR/tmp/spdump
call into_dumpfile("dfile", 1)|
--system rm -f $MYSQLTEST_VARDIR/tmp/spdump
--remove_file $MYSQLTEST_VARDIR/tmp/spdump
delete from t1|
drop procedure into_dumpfile|
......
......@@ -25,7 +25,7 @@ connection con1;
--send
update t1 set n = 3;
connection con2;
sleep 0.5;
sleep 1;
unlock tables;
connection con1;
reap;
......
--skip-grant-tables --loose-shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --loose-shared-memory=1
# Windows-specific tests
--source include/windows.inc
#
# Bug #24924: shared-memory-base-name that is too long causes buffer overflow
#
--exec $MYSQLADMIN --no-defaults --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ping
--echo End of 5.0 tests.
......@@ -43,8 +43,7 @@ mysqld_LDADD = @MYSQLD_EXTRA_LDFLAGS@ \
@innodb_system_libs@ \
@ndbcluster_libs@ @ndbcluster_system_libs@ \
$(LDADD) $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ \
$(yassl_libs) $(openssl_libs) \
@MYSQLD_EXTRA_LIBS@
$(yassl_libs) $(openssl_libs) @MYSQLD_EXTRA_LIBS@
noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
item_strfunc.h item_timefunc.h item_uniq.h \
......
......@@ -1835,7 +1835,8 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event)
if (likely(is_open())) // Should always be true
{
uint length;
uint length, group, carry, hdr_offs, val;
byte header[LOG_EVENT_HEADER_LEN];
/*
Log "BEGIN" at the beginning of the transaction.
......@@ -1867,10 +1868,113 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event)
/* Read from the file used to cache the queries .*/
if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0))
goto err;
length=my_b_bytes_in_cache(cache);
length= my_b_bytes_in_cache(cache);
DBUG_EXECUTE_IF("half_binlogged_transaction", length-=100;);
/*
The events in the buffer have incorrect end_log_pos data
(relative to beginning of group rather than absolute),
so we'll recalculate them in situ so the binlog is always
correct, even in the middle of a group. This is possible
because we now know the start position of the group (the
offset of this cache in the log, if you will); all we need
to do is to find all event-headers, and add the position of
the group to the end_log_pos of each event. This is pretty
straight forward, except that we read the cache in segments,
so an event-header might end up on the cache-border and get
split.
*/
group= (uint)my_b_tell(&log_file);
hdr_offs= carry= 0;
do
{
/*
if we only got a partial header in the last iteration,
get the other half now and process a full header.
*/
if (unlikely(carry > 0))
{
DBUG_ASSERT(carry < LOG_EVENT_HEADER_LEN);
/* assemble both halves */
memcpy(&header[carry], (char *)cache->read_pos, LOG_EVENT_HEADER_LEN - carry);
/* fix end_log_pos */
val= uint4korr(&header[LOG_POS_OFFSET]) + group;
int4store(&header[LOG_POS_OFFSET], val);
/* write the first half of the split header */
if (my_b_write(&log_file, header, carry))
goto err;
/*
copy fixed second half of header to cache so the correct
version will be written later.
*/
memcpy((char *)cache->read_pos, &header[carry], LOG_EVENT_HEADER_LEN - carry);
/* next event header at ... */
hdr_offs = uint4korr(&header[EVENT_LEN_OFFSET]) - carry;
carry= 0;
}
/* if there is anything to write, process it. */
if (likely(length > 0))
{
/*
process all event-headers in this (partial) cache.
if next header is beyond current read-buffer,
we'll get it later (though not necessarily in the
very next iteration, just "eventually").
*/
while (hdr_offs < length)
{
/*
partial header only? save what we can get, process once
we get the rest.
*/
if (hdr_offs + LOG_EVENT_HEADER_LEN > length)
{
carry= length - hdr_offs;
memcpy(header, (char *)cache->read_pos + hdr_offs, carry);
length= hdr_offs;
}
else
{
/* we've got a full event-header, and it came in one piece */
uchar *log_pos= (uchar *)cache->read_pos + hdr_offs + LOG_POS_OFFSET;
/* fix end_log_pos */
val= uint4korr(log_pos) + group;
int4store(log_pos, val);
/* next event header at ... */
log_pos= (uchar *)cache->read_pos + hdr_offs + EVENT_LEN_OFFSET;
hdr_offs += uint4korr(log_pos);
}
}
/*
Adjust hdr_offs. Note that this doesn't mean it will necessarily
be valid in the next iteration; if the current event is very long,
it may take a couple of read-iterations (and subsequent fixings
of hdr_offs) for it to become valid again.
if we had a split header, hdr_offs was already fixed above.
*/
if (carry == 0)
hdr_offs -= length;
}
/* Write data to the binary log file */
if (my_b_write(&log_file, cache->read_pos, length))
goto err;
......
/*
manifest.js - Writes a custom XML manifest for each executable/library
6 command line options must be supplied:
5 command line options must be supplied:
name - Name of the executable/library into which the mainfest will be
embedded.
version - Version of the executable
arch - Architecture intended.
type - Application type.
exe_level - Application execution level.
[asInvoker|highestAvailable|requireAdministrator]
outfile - Final destination where mainfest will be written.
......@@ -37,9 +36,6 @@ try
case "arch":
var app_arch= parts[1];
break;
case "type":
var app_type= parts[1];
break;
case "exe_level":
var app_exe_level= parts[1];
break;
......@@ -50,7 +46,7 @@ try
WScript.echo("Invalid argument supplied.");
}
}
if (i != 6)
if (i != 5)
throw new Error(1, "Incorrect number of arguments.");
var manifest_xml= "<?xml version=\'1.0\' encoding=\'UTF-8\' standalone=\'yes\'?>\r\n";
......@@ -61,7 +57,7 @@ try
manifest_xml+= " version=\'" + app_version + "\'";
manifest_xml+= " processorArchitecture=\'" + app_arch + "\'";
// TOADD - Add publicKeyToken attribute once we have Authenticode key.
manifest_xml+= " type=\'" + app_type + "\' />\r\n";
manifest_xml+= " type=\'win32\' />\r\n";
// Identify the application security requirements.
manifest_xml+= "\t<trustInfo xmlns=\'urn:schemas-microsoft-com:asm.v2\'>\r\n";
manifest_xml+= "\t\t<security>\r\n\t\t\t<requestedPrivileges>\r\n\t\t\t\t";
......
......@@ -9,7 +9,7 @@ MACRO(MYSQL_EMBED_MANIFEST _target_name _required_privs)
TARGET ${_target_name}
PRE_LINK
COMMAND cscript.exe
ARGS "${PROJECT_SOURCE_DIR}/win/create_manifest.js" name=$(ProjectName) version=${VERSION} arch=${PROCESSOR_ARCH} type=$(PlatformName) exe_level=${_required_privs} outfile=$(IntDir)\\$(TargetFileName).intermediate.manifest
ARGS "${PROJECT_SOURCE_DIR}/win/create_manifest.js" name=$(ProjectName) version=${VERSION} arch=${PROCESSOR_ARCH} exe_level=${_required_privs} outfile=$(IntDir)\\$(TargetFileName).intermediate.manifest
COMMENT "Generates the contents of the manifest contents.")
ADD_CUSTOM_COMMAND(
TARGET ${_target_name}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment