diff options
author | unknown <sasha@mysql.sashanet.com> | 2001-11-17 17:23:46 -0700 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2001-11-17 17:23:46 -0700 |
commit | 4bcb4f4dae07d3ceca01f17ce97012c1d6046c6a (patch) | |
tree | c21577a3e1e1590e9241dd9b406c046d31a17123 /client | |
parent | f5a488eef458ee68a8a20fc4e06503eba6d013f8 (diff) | |
download | mariadb-git-4bcb4f4dae07d3ceca01f17ce97012c1d6046c6a.tar.gz |
use env vars for socket/port in connect in mysqltest
--local-master option in mysql-test-run
do not log CREATE TABLE when doing table dump
fix replication to slave off 3.23 master
client/mysqltest.c:
fix to be able to use env vars for socket and port in connect
mysql-test/include/master-slave.inc:
connect to port specified in environment
mysql-test/mysql-test-run.sh:
added --local-master option - will assume master is on port 3306 on localhost
sql/log_event.cc:
fixes to slave off 3.23 master
sql/log_event.h:
fixes to slave off 3.23 master
sql/slave.cc:
do not log CREATE TABLE when doing table dump
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqltest.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index fc326a31115..71b4e886f91 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1280,6 +1280,7 @@ int do_connect(struct st_query* q) char buff[FN_REFLEN]; int con_port; int con_error; + int free_con_sock = 0; DBUG_ENTER("do_connect"); DBUG_PRINT("enter",("connect: %s",p)); @@ -1299,10 +1300,29 @@ int do_connect(struct st_query* q) } else { + VAR* var_port, *var_sock; p = safe_get_param(p, &con_port_str, "missing connection port"); - con_port=atoi(con_port_str); + if (*con_port_str == '$') + { + if (!(var_port = var_get(con_port_str, 0, 0))) + die("Unknown variable '%s'", con_port_str+1); + con_port = var_port->int_val; + } + else + con_port=atoi(con_port_str); p = safe_get_param(p, &con_sock, "missing connection socket"); + if (*con_sock == '$') + { + if (!(var_sock = var_get(con_sock, 0, 0))) + die("Unknown variable '%s'", con_sock+1); + if (!(con_sock = (char*)my_malloc(var_sock->str_val_len+1, MYF(0)))) + die("Out of memory"); + free_con_sock = 1; + memcpy(con_sock, var_sock->str_val, var_sock->str_val_len); + con_sock[var_sock->str_val_len] = 0; + } } + if (next_con == cons_end) die("Connection limit exhausted - increase MAX_CONS in mysqltest.c"); @@ -1310,20 +1330,21 @@ int do_connect(struct st_query* q) die("Failed on mysql_init()"); if (opt_compress) mysql_options(&next_con->mysql,MYSQL_OPT_COMPRESS,NullS); - if (con_sock) + if (con_sock && !free_con_sock && *con_sock && *con_sock != FN_LIBCHAR) con_sock=fn_format(buff, con_sock, TMPDIR, "",0); if (!con_db[0]) con_db=db; if((con_error = safe_connect(&next_con->mysql, con_host, con_user, con_pass, - con_db, con_port, con_sock))) + con_db, con_port, *con_sock ? con_sock: 0))) die("Could not open connection '%s': %s", con_name, mysql_error(&next_con->mysql)); if (!(next_con->name = my_strdup(con_name, MYF(MY_WME)))) die(NullS); cur_con = next_con++; - + if (free_con_sock) + my_free(con_sock, MYF(MY_WME)); DBUG_RETURN(0); } |