diff options
author | istruewing@stella.local <> | 2008-03-26 10:51:16 +0100 |
---|---|---|
committer | istruewing@stella.local <> | 2008-03-26 10:51:16 +0100 |
commit | 0eff6e7be5f290854e5810173b2239c41c7b75a5 (patch) | |
tree | acdb19e3d6b8269b0dd3c6eb62e483f583b2d033 /storage/federated | |
parent | 44fbe74e1e7c6055f10f5eb7ab6f467e0c4aa966 (diff) | |
parent | c82b842ad87b26f76bcafbc9448644f1e08da47f (diff) | |
download | mariadb-git-0eff6e7be5f290854e5810173b2239c41c7b75a5.tar.gz |
Merge stella.local:/home2/mydev/mysql-5.0-axmrg
into stella.local:/home2/mydev/mysql-5.1-axmrg
Diffstat (limited to 'storage/federated')
-rw-r--r-- | storage/federated/ha_federated.cc | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index d7040c44fe8..ec99b47ce65 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -794,9 +794,9 @@ static int parse_url(MEM_ROOT *mem_root, FEDERATED_SHARE *share, TABLE *table, goto error; /* Found that if the string is: -user:@hostname:port/db/table -Then password is a null string, so set to NULL - */ + user:@hostname:port/db/table + Then password is a null string, so set to NULL + */ if ((share->password[0] == '\0')) share->password= NULL; } @@ -833,14 +833,21 @@ Then password is a null string, so set to NULL if ((strchr(share->table_name, '/'))) goto error; + /* + If hostname is omitted, we set it to NULL. According to + mysql_real_connect() manual: + The value of host may be either a hostname or an IP address. + If host is NULL or the string "localhost", a connection to the + local host is assumed. + */ if (share->hostname[0] == '\0') share->hostname= NULL; } if (!share->port) { - if (strcmp(share->hostname, my_localhost) == 0) - share->socket= (char *) MYSQL_UNIX_ADDR; + if (!share->hostname || strcmp(share->hostname, my_localhost) == 0) + share->socket= (char*) MYSQL_UNIX_ADDR; else share->port= MYSQL_PORT; } |