From c6979413068e165de4471e0b9389baf9a9543a44 Mon Sep 17 00:00:00 2001
From: "ingo@mysql.com" <>
Date: Tue, 24 Aug 2004 12:58:12 +0200
Subject: [PATCH 1/5] Enabled mysqltest for MASTER_PORT replacement. Replaced
fixed port numbers by MASTER_PORT replacement. This allows for a set of ports
per tree and hence parallel testing on multiple trees.
---
BitKeeper/etc/logging_ok | 1 +
client/mysqltest.c | 46 +++++++++++++++++++++--------
mysql-test/r/rpl000014.result | 8 ++---
mysql-test/r/rpl000015.result | 6 ++--
mysql-test/r/rpl_rotate_logs.result | 6 ++--
mysql-test/t/rpl000001.test | 2 +-
mysql-test/t/rpl000014.test | 8 ++---
mysql-test/t/rpl000015.test | 6 ++--
mysql-test/t/rpl_rotate_logs.test | 6 ++--
9 files changed, 55 insertions(+), 34 deletions(-)
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok
index e0a0f4304fb..d025a25f5c5 100644
--- a/BitKeeper/etc/logging_ok
+++ b/BitKeeper/etc/logging_ok
@@ -11,6 +11,7 @@ greg@mysql.com
guilhem@mysql.com
heikki@donna.mysql.fi
heikki@hundin.mysql.fi
+ingo@mysql.com
jani@hynda.mysql.fi
jorge@linux.jorge.mysql.com
konstantin@mysql.com
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 18fafff275e..afd78ac6fb4 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -220,7 +220,8 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char* fname);
void reject_dump(const char* record_file, char* buf, int size);
int close_connection(struct st_query* q);
-VAR* var_get(const char* var_name, const char** var_name_end, int raw);
+VAR* var_get(const char* var_name, const char** var_name_end, int raw,
+ my_bool ignore_not_existing);
int eval_expr(VAR* v, const char* p, const char** p_end);
/* Definitions for replace */
@@ -277,7 +278,7 @@ static void do_eval(DYNAMIC_STRING* query_eval, const char* query)
}
else
{
- if(!(v = var_get(p, &p, 0)))
+ if(!(v = var_get(p, &p, 0, 0)))
die("Bad variable in eval");
dynstr_append_mem(query_eval, v->str_val, v->str_val_len);
}
@@ -486,7 +487,8 @@ static int check_result(DYNAMIC_STRING* ds, const char* fname,
return error;
}
-VAR* var_get(const char* var_name, const char** var_name_end, int raw)
+VAR* var_get(const char* var_name, const char** var_name_end, int raw,
+ my_bool ignore_not_existing)
{
int digit;
VAR* v;
@@ -507,7 +509,11 @@ VAR* var_get(const char* var_name, const char** var_name_end, int raw)
++var_name;
}
if(var_name == save_var_name)
+ {
+ if (ignore_not_existing)
+ return 0;
die("Empty variable");
+ }
if(!(v = (VAR*)hash_search(&var_hash, save_var_name,
var_name - save_var_name)))
@@ -629,7 +635,7 @@ int eval_expr(VAR* v, const char* p, const char** p_end)
VAR* vp;
if (*p == '$')
{
- if ((vp = var_get(p,p_end,0)))
+ if ((vp = var_get(p,p_end,0, 0)))
{
memcpy(v, vp, sizeof(*v));
return 0;
@@ -671,7 +677,7 @@ int do_inc(struct st_query* q)
{
char* p=q->first_argument;
VAR* v;
- v = var_get(p, 0, 1);
+ v = var_get(p, 0, 1, 0);
v->int_val++;
v->int_dirty = 1;
return 0;
@@ -681,7 +687,7 @@ int do_dec(struct st_query* q)
{
char* p=q->first_argument;
VAR* v;
- v = var_get(p, 0, 1);
+ v = var_get(p, 0, 1, 0);
v->int_val--;
v->int_dirty = 1;
return 0;
@@ -909,14 +915,16 @@ static void get_ints(uint *to,struct st_query* q)
/*
Get a string; Return ptr to end of string
Strings may be surrounded by " or '
+
+ If string is a '$variable', return the value of the variable.
*/
-static void get_string(char **to_ptr, char **from_ptr,
- struct st_query* q)
+static char *get_string(char **to_ptr, char **from_ptr,
+ struct st_query* q)
{
reg1 char c,sep;
- char *to= *to_ptr, *from= *from_ptr;
+ char *to= *to_ptr, *from= *from_ptr, *start=to;
DBUG_ENTER("get_string");
/* Find separator */
@@ -969,6 +977,19 @@ static void get_string(char **to_ptr, char **from_ptr,
*to++ =0; /* End of string marker */
*to_ptr= to;
*from_ptr= from;
+
+ /* Check if this was a variable */
+ if (*start == '$')
+ {
+ const char *end= --to;
+ VAR *var=var_get(start, &end, 0, 1);
+ if (var && to == (char*) end+1)
+ {
+ DBUG_PRINT("info",("get_string: '%s' -> '%s'", start, var->str_val));
+ DBUG_RETURN(var->str_val); /* return found variable value */
+ }
+ }
+ DBUG_RETURN(start);
}
@@ -994,13 +1015,12 @@ static void get_replace(struct st_query *q)
start=buff=my_malloc(strlen(from)+1,MYF(MY_WME | MY_FAE));
while (*from)
{
- char *to=buff;
- get_string(&buff, &from, q);
+ char *to;
+ to= get_string(&buff, &from, q);
if (!*from)
die("Wrong number of arguments to replace in %s\n", q->query);
insert_pointer_name(&from_array,to);
- to=buff;
- get_string(&buff, &from, q);
+ to= get_string(&buff, &from, q);
insert_pointer_name(&to_array,to);
}
for (i=1,pos=word_end_chars ; i < 256 ; i++)
diff --git a/mysql-test/r/rpl000014.result b/mysql-test/r/rpl000014.result
index a47c3c91c1d..2a2a9bafa11 100644
--- a/mysql-test/r/rpl000014.result
+++ b/mysql-test/r/rpl000014.result
@@ -1,13 +1,13 @@
File Position Binlog_do_db Binlog_ignore_db
master-bin.001 73
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter
-127.0.0.1 root 9999 1 master-bin.001 73 Yes 0 0
+127.0.0.1 root MASTER_PORT 1 master-bin.001 73 Yes 0 0
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter
-127.0.0.1 root 9999 1 master-bin.001 73 No 0 0
+127.0.0.1 root MASTER_PORT 1 master-bin.001 73 No 0 0
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter
-127.0.0.1 root 9999 1 master-bin.001 73 Yes 0 0
+127.0.0.1 root MASTER_PORT 1 master-bin.001 73 Yes 0 0
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter
-127.0.0.1 root 9999 1 master-bin.001 173 Yes 0 0
+127.0.0.1 root MASTER_PORT 1 master-bin.001 173 Yes 0 0
File Position Binlog_do_db Binlog_ignore_db
master-bin.001 73
n
diff --git a/mysql-test/r/rpl000015.result b/mysql-test/r/rpl000015.result
index 58487af27f8..79856748f58 100644
--- a/mysql-test/r/rpl000015.result
+++ b/mysql-test/r/rpl000015.result
@@ -3,11 +3,11 @@ master-bin.001 73
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter
0 0 0 No 0 0
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter
-127.0.0.1 test 9998 60 4 No 0 0
+127.0.0.1 test MASTER_PORT 60 4 No 0 0
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter
-127.0.0.1 root 9999 60 4 No 0 0
+127.0.0.1 root MASTER_PORT 60 4 No 0 0
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter
-127.0.0.1 root 9999 60 master-bin.001 73 Yes 0 0
+127.0.0.1 root MASTER_PORT 60 master-bin.001 73 Yes 0 0
n
10
45
diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result
index cf432d07b08..a711811d768 100644
--- a/mysql-test/r/rpl_rotate_logs.result
+++ b/mysql-test/r/rpl_rotate_logs.result
@@ -1,5 +1,5 @@
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter
-127.0.0.1 root 9999 60 master-bin.001 387 Yes 0 0
+127.0.0.1 root MASTER_PORT 60 master-bin.001 387 Yes 0 0
s
Could not break slave
Tried hard
@@ -12,7 +12,7 @@ testing temporary tables
Log_name
master-bin.003
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter
-127.0.0.1 root 9999 60 master-bin.003 329 Yes 0 0
+127.0.0.1 root MASTER_PORT 60 master-bin.003 329 Yes 0 0
m
34
65
@@ -29,6 +29,6 @@ master-bin.006 490
a
testing temporary tables part 2
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter
-127.0.0.1 root 9999 60 master-bin.006 490 Yes 0 0
+127.0.0.1 root MASTER_PORT 60 master-bin.006 490 Yes 0 0
count(*)
100
diff --git a/mysql-test/t/rpl000001.test b/mysql-test/t/rpl000001.test
index 6a827368fa4..e69ed9987d1 100644
--- a/mysql-test/t/rpl000001.test
+++ b/mysql-test/t/rpl000001.test
@@ -61,7 +61,7 @@ sleep 2;
# The following test can't be done because the result of Pos will differ
# on different computers
-# --replace_result 9306 9999 3334 9999 3335 9999
+# --replace_result $MASTER_MYPORT MASTER_PORT
# show slave status;
set sql_slave_skip_counter=1;
diff --git a/mysql-test/t/rpl000014.test b/mysql-test/t/rpl000014.test
index b501d63b10e..e98471657ac 100644
--- a/mysql-test/t/rpl000014.test
+++ b/mysql-test/t/rpl000014.test
@@ -4,18 +4,18 @@ show master status;
save_master_pos;
connection slave;
sync_with_master;
---replace_result 9306 9999 3334 9999 3335 9999
+--replace_result $MASTER_MYPORT MASTER_PORT
show slave status;
change master to master_log_pos=73;
slave stop;
change master to master_log_pos=73;
---replace_result 9306 9999 3334 9999 3335 9999
+--replace_result $MASTER_MYPORT MASTER_PORT
show slave status;
slave start;
---replace_result 9306 9999 3334 9999 3335 9999
+--replace_result $MASTER_MYPORT MASTER_PORT
show slave status;
change master to master_log_pos=173;
---replace_result 9306 9999 3334 9999 3335 9999
+--replace_result $MASTER_MYPORT MASTER_PORT
show slave status;
connection master;
show master status;
diff --git a/mysql-test/t/rpl000015.test b/mysql-test/t/rpl000015.test
index 73a10bed7b3..d3c30c19cc1 100644
--- a/mysql-test/t/rpl000015.test
+++ b/mysql-test/t/rpl000015.test
@@ -8,15 +8,15 @@ connection slave;
reset slave;
show slave status;
change master to master_host='127.0.0.1';
---replace_result 3306 9998 9306 9999 3334 9999 3335 9999
+--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT
show slave status;
eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$MASTER_MYPORT;
---replace_result 9306 9999 3334 9999 3335 9999
+--replace_result $MASTER_MYPORT MASTER_PORT
show slave status;
slave start;
sync_with_master;
---replace_result 9306 9999 3334 9999 3335 9999
+--replace_result $MASTER_MYPORT MASTER_PORT
show slave status;
connection master;
drop table if exists t1;
diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test
index ab88def5b2d..92baba5f737 100644
--- a/mysql-test/t/rpl_rotate_logs.test
+++ b/mysql-test/t/rpl_rotate_logs.test
@@ -40,7 +40,7 @@ insert into t1 values('Could not break slave'),('Tried hard');
save_master_pos;
connection slave;
sync_with_master;
---replace_result 9306 9999 3334 9999 3335 9999
+--replace_result $MASTER_MYPORT MASTER_PORT
show slave status;
select * from t1;
connection master;
@@ -96,7 +96,7 @@ insert into t2 values (65);
save_master_pos;
connection slave;
sync_with_master;
---replace_result 9306 9999 3334 9999 3335 9999
+--replace_result $MASTER_MYPORT MASTER_PORT
show slave status;
select * from t2;
@@ -126,7 +126,7 @@ connection slave;
sync_with_master;
select * from t4;
---replace_result 9306 9999 3334 9999 3335 9999
+--replace_result $MASTER_MYPORT MASTER_PORT
show slave status;
# because of concurrent insert, the table may not be up to date
# if we do not lock
From 1d3fea70f89b7b7cf1d820c79924be400d1bec75 Mon Sep 17 00:00:00 2001
From: "paul@ice.snake.net" <>
Date: Fri, 15 Oct 2004 23:12:15 -0500
Subject: [PATCH 2/5] texi2html: Changes parsing of @image argument.
---
BitKeeper/etc/logging_ok | 1 +
Docs/Support/texi2html | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok
index d025a25f5c5..7a4086b9711 100644
--- a/BitKeeper/etc/logging_ok
+++ b/BitKeeper/etc/logging_ok
@@ -36,6 +36,7 @@ mwagner@cash.mwagner.org
nick@mysql.com
nick@nick.leippe.com
paul@central.snake.net
+paul@ice.snake.net
paul@teton.kitebird.com
salle@geopard.(none)
salle@geopard.online.bg
diff --git a/Docs/Support/texi2html b/Docs/Support/texi2html
index 5dda7c8bbd5..8067d8f72ce 100755
--- a/Docs/Support/texi2html
+++ b/Docs/Support/texi2html
@@ -1811,7 +1811,7 @@ sub fix_image
{
my($text) = @_;
my($arg1, $ext);
- $text =~ /^([^,]*)$/;
+ $text =~ /^([^,]*)/;
die "error in image: '$text'" unless defined($1);
$arg1 = $1;
$arg1 =~ s/@@/@/g;
From b4773b590a8826bb927ec0a676304586f014053e Mon Sep 17 00:00:00 2001
From: "paul@kite-hub.kitebird.com" <>
Date: Thu, 21 Oct 2004 12:08:51 -0500
Subject: [PATCH 3/5] texi2html: Update texi2html with version from mysqldoc
repository. (Please merge this forward to 4.0, 4.1, 5.0.)
---
BitKeeper/etc/logging_ok | 1 +
Docs/Support/texi2html | 98 ++++++++++++++++++++++------------------
2 files changed, 54 insertions(+), 45 deletions(-)
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok
index 7a4086b9711..b82221bfb95 100644
--- a/BitKeeper/etc/logging_ok
+++ b/BitKeeper/etc/logging_ok
@@ -37,6 +37,7 @@ nick@mysql.com
nick@nick.leippe.com
paul@central.snake.net
paul@ice.snake.net
+paul@kite-hub.kitebird.com
paul@teton.kitebird.com
salle@geopard.(none)
salle@geopard.online.bg
diff --git a/Docs/Support/texi2html b/Docs/Support/texi2html
index 8067d8f72ce..f13c006c7dc 100755
--- a/Docs/Support/texi2html
+++ b/Docs/Support/texi2html
@@ -1,4 +1,4 @@
-#!PATH_TO_PERL -*- perl -*-
+#!/usr/bin/perl
# Add path to perl on the previous line and make this executable
# if you want to use this as a normal script.
'di ';
@@ -12,7 +12,7 @@
#-##############################################################################
# @(#)texi2html 1.52 971230 Written (mainly) by Lionel Cons, Lionel.Cons@cern.ch
-# Enhanced by David Axmark, david@detron.se
+# Enhanced by David Axmark
# The man page for this program is included at the end of this file and can be
# viewed using the command 'nroff -man texi2html'.
@@ -40,8 +40,7 @@ $NODESRE = '[^@{}:\'`"]+'; # RE for a list of node names
$XREFRE = '[^@{}]+'; # RE for a xref (should use NODERE)
$ERROR = "***"; # prefix for errors and warnings
-$THISPROG = "texi2html 1.52 (hacked by david\@detron.se)"; # program name and version
-$HOMEPAGE = "http://www.mathematik.uni-kl.de/~obachman/Texi2html/"; # program home page
+$THISPROG = "texi2html 1.52 (with additions by MySQL AB)"; # program name and version
$TODAY = &pretty_date; # like "20 September 1993"
$SPLITTAG = "\n"; # tag to know where to split
$PROTECTTAG = "_ThisIsProtected_"; # tag to recognize protected sections
@@ -114,10 +113,12 @@ $html2_doctype = '", # HTML+
+ "*", "
", # HTML+
" ", " ",
"\n", "\n",
"|", "",
@@ -134,6 +135,8 @@ $html2_doctype = '', # paragraph break
+ 'br', '
', # paragraph break 'bullet', '*', 'copyright', '(C)', + 'registeredsymbol', '(R)', 'dots', '...', 'equiv', '==', 'error', 'error-->', @@ -161,27 +165,28 @@ $html2_doctype = '\n", __LINE__)); + push(@lines, &debug("
|g if ($in_multitable); + s/(^|\s+)\@tab\s*/ <\/TD> | /g if ($in_multitable); # # analyze the tag again @@ -885,7 +899,7 @@ READ_LINE: while ($_ = &next_line) $name =~ s/\s+$//; $level = $sec2level{$tag}; $name = &update_sec_num($tag, $level) . " $name" - if $number_sections && $tag !~ /^unnumbered/; + if $number_sections && $tag !~ /^unnumbered/ && $tag ne 'subsubheading'; if ($tag =~ /heading$/) { push(@lines, &html_debug("\n", __LINE__)); if ($html_element ne 'body') { @@ -1079,7 +1093,7 @@ EOC push(@lines, &debug(" | \n", __LINE__)) unless $html_element eq 'TABLE'; &html_pop_if('TR'); - $what =~ s|\s+\@tab\s*||g; + $what =~ s/(^|\s+)\@tab\s*/ <\/TD> | /g; push(@lines, &debug(" |
$what\n", __LINE__));
&html_push('TR');
if ($deferred_ref)
@@ -1463,11 +1477,7 @@ print "# end of pass 4\n" if $verbose;
# #
#---############################################################################
-$header = < |