summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2001-02-15 03:43:14 +0200
committerunknown <monty@donna.mysql.com>2001-02-15 03:43:14 +0200
commitc1488c7e5896920e5f66e28de38964ae9b5ff22e (patch)
tree48461790e73014dbea005fbd6ef8d48e83cc6f14 /client
parent8ece82e4dcef6b7dd097350890e27b593ec079b1 (diff)
downloadmariadb-git-c1488c7e5896920e5f66e28de38964ae9b5ff22e.tar.gz
Changed --replace to --replace_result in mysqltest
Changed errmsg -> my_errmsg (portability issue) Fixed that mysqlbinlog writes SET TIMESTAMP before all queries Fixed comments in default my.cnf files Docs/manual.texi: Updated information about character sets client/mysqladmin.c: Added missing help text client/mysqltest.c: Changed --replace to --replace_result to not conflict with SQL replace command include/my_sys.h: change errmsg -> my_errmsg (portability issue) libmysql/errmsg.c: change errmsg -> my_errmsg (portability issue) myisam/mi_cache.c: Changed seek+read to pread myisam/mi_check.c: Fix bug that caused myisamchk to be very slow under some specific error conditions myisam/mi_dynrec.c: cleanup myisam/myisamchk.c: Write out value of checksum myisam/myisamdef.h: cleanup mysql-test/r/backup.result: Fixed the case where backup caused different error messages mysql-test/r/bdb.result: Added new test case mysql-test/r/fulltext.result: Fix for new CREATE TABLE format mysql-test/t/backup.test: Use --replace_result and --send mysql-test/t/bdb.test: New test case mysql-test/t/status.test: Use --send mysys/errors.c: change errmsg -> my_errmsg (portability issue) mysys/my_error.c: change errmsg -> my_errmsg (portability issue) mysys/typelib.c: Only accept full type names sql/derror.cc: change errmsg -> my_errmsg (portability issue) sql/ha_berkeley.cc: Fixed bug when using key parts that could be NULL sql/log_event.cc: Log SET TIMESTAMP before all queries sql/mysqlbinlog.cc: Incremented version number sql/mysqld.cc: change errmsg -> my_errmsg (portability issue) Always accept --skip-gemeni, --skip-bdb and --skip-innobase sql/slave.cc: cleanup sql/sql_base.cc: cleanup sql/sql_db.cc: cleanup support-files/my-huge.cnf.sh: Remove usage of # at end of line support-files/my-large.cnf.sh: Remove usage of # at end of line support-files/my-medium.cnf.sh: Remove usage of # at end of line support-files/my-small.cnf.sh: Remove usage of # at end of line
Diffstat (limited to 'client')
-rw-r--r--client/mysqladmin.c4
-rw-r--r--client/mysqltest.c38
2 files changed, 25 insertions, 17 deletions
diff --git a/client/mysqladmin.c b/client/mysqladmin.c
index 7420593591e..98da2df3aba 100644
--- a/client/mysqladmin.c
+++ b/client/mysqladmin.c
@@ -28,7 +28,7 @@
#include <my_pthread.h> /* because of signal() */
#endif
-#define ADMIN_VERSION "8.15"
+#define ADMIN_VERSION "8.16"
#define MAX_MYSQL_VAR 64
#define MAX_TIME_TO_WAIT 3600 /* Wait for shutdown */
#define MAX_TRUNC_LENGTH 3
@@ -853,6 +853,8 @@ static void usage(void)
refresh Flush all tables and close and open logfiles\n\
shutdown Take server down\n\
status Gives a short status message from the server\n\
+ start-slave Start slave\n\
+ stop-slave Stop slave\n\
variables Prints variables available\n\
version Get version info from server");
}
diff --git a/client/mysqltest.c b/client/mysqltest.c
index bb6011650e7..0130374892a 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -157,7 +157,7 @@ struct st_query
const char *command_names[] = {
"connection", "query","connect","sleep","inc","dec","source","disconnect",
"let","echo","while","end","system","result", "require", "save_master_pos",
- "sync_with_master", "error", "send", "reap", "dirty_close", "replace", 0
+ "sync_with_master", "error", "send", "reap", "dirty_close", "replace_result", 0
};
TYPELIB command_typelib= {array_elements(command_names),"",
@@ -723,22 +723,22 @@ static void get_replace(struct st_query *q)
{
uint i;
char *from=q->first_argument;
- char *buff=my_malloc(strlen(from),MYF(MY_WME | MY_FAE));
+ char *buff,*start;
char word_end_chars[256],*pos;
POINTER_ARRAY to_array,from_array;
DBUG_ENTER("get_replace");
bzero((char*) &to_array,sizeof(to_array));
bzero((char*) &from_array,sizeof(from_array));
-
if (!*from)
die("Missing argument in %s\n", q->query);
+ start=buff=my_malloc(strlen(from)+1,MYF(MY_WME | MY_FAE));
while (*from)
{
char *to=buff;
get_string(&buff, &from, q);
if (!*from)
- die("Wrong number of arguments in %s\n", q->query);
+ 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);
@@ -747,6 +747,7 @@ static void get_replace(struct st_query *q)
for (i=1,pos=word_end_chars ; i < 256 ; i++)
if (isspace(i))
*pos++=i;
+ *pos=0; /* End pointer */
if (!(glob_replace=init_replace((char**) from_array.typelib.type_names,
(char**) to_array.typelib.type_names,
(uint) from_array.typelib.count,
@@ -755,13 +756,16 @@ static void get_replace(struct st_query *q)
die("Can't initialize replace from %s\n", q->query);
free_pointer_array(&from_array);
free_pointer_array(&to_array);
- my_free(buff, MYF(0));
+ my_free(start, MYF(0));
}
void free_replace()
{
+ DBUG_ENTER("free_replace");
my_free((char*) glob_replace,MYF(0));
+ glob_replace=0;
free_replace_buffer();
+ DBUG_VOID_RETURN;
}
@@ -1270,7 +1274,7 @@ int parse_args(int argc, char **argv)
{
switch(c) {
case '#':
- DBUG_PUSH(optarg ? optarg : "d:t:o,/tmp/mysqltest.trace");
+ DBUG_PUSH(optarg ? optarg : "d:t:O,/tmp/mysqltest.trace");
break;
case 'v':
verbose = 1;
@@ -1530,7 +1534,7 @@ void get_query_type(struct st_query* q)
save=q->query[q->first_word_len];
q->query[q->first_word_len]=0;
- type=find_type(q->query, &command_typelib, 1);
+ type=find_type(q->query, &command_typelib, 1+2);
q->query[q->first_word_len]=save;
if (type > 0)
q->type=type; /* Found command */
@@ -1541,7 +1545,7 @@ int main(int argc, char** argv)
{
int error = 0;
struct st_query* q;
- my_bool require_file=0;
+ my_bool require_file=0,q_send_flag=0;
char save_file[FN_REFLEN];
MY_INIT(argv[0]);
@@ -1579,7 +1583,7 @@ int main(int argc, char** argv)
0))
die("Failed in mysql_real_connect(): %s", mysql_error(&cur_con->mysql));
- for(;!read_query(&q);)
+ while (!read_query(&q))
{
int current_line_inc = 1, processed = 0;
if (q->type == Q_UNKNOWN || q->type == Q_COMMENT_WITH_COMMAND)
@@ -1604,9 +1608,13 @@ int main(int argc, char** argv)
case Q_REAP:
{
int flags = QUERY_REAP;
- if(q->type == Q_QUERY)
+ if (q->type == Q_QUERY)
flags |= QUERY_SEND;
-
+ if (q_send_flag)
+ {
+ flags=QUERY_SEND;
+ q_send_flag=0;
+ }
if (save_file[0])
{
strmov(q->record_file,save_file);
@@ -1617,8 +1625,7 @@ int main(int argc, char** argv)
break;
}
case Q_SEND:
- q->query += q->first_word_len;
- error |= run_query(&cur_con->mysql, q, QUERY_SEND);
+ q_send_flag=1;
break;
case Q_RESULT:
get_file_name(save_file,q);
@@ -1673,8 +1680,8 @@ int main(int argc, char** argv)
}
free_used_memory();
- exit(error);
- return error;
+ exit(error ? 1 : 0);
+ return error ? 1 : 0; /* Keep compiler happy */
}
@@ -1789,7 +1796,6 @@ void free_pointer_array(POINTER_ARRAY *pa)
pa->typelib.type_names=0;
my_free((gptr) pa->str,MYF(0));
}
- return;
} /* free_pointer_array */