diff options
author | Adam Harvey <aharvey@php.net> | 2010-03-09 05:08:31 +0000 |
---|---|---|
committer | Adam Harvey <aharvey@php.net> | 2010-03-09 05:08:31 +0000 |
commit | bdbb2e77ca3b0b00a511796595a2c8abf1d3541f (patch) | |
tree | e20bc20596067258271e829e9f1b20227290d112 /ext/mysqlnd/mysqlnd.c | |
parent | 68f805a6d027a605050542d83d5bda7071e7c3a6 (diff) | |
download | php-git-bdbb2e77ca3b0b00a511796595a2c8abf1d3541f.tar.gz |
Fixed bug #51242 (Empty mysql.default_port does not default to 3306 anymore, but 0).
Diffstat (limited to 'ext/mysqlnd/mysqlnd.c')
-rw-r--r-- | ext/mysqlnd/mysqlnd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 55d2f2468d..7940cead3a 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -527,9 +527,6 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND *conn, db = ""; db_len = 0; } - if (!port && !socket) { - port = 3306; - } host_len = strlen(host); #ifndef PHP_WIN32 if (host_len == sizeof("localhost") - 1 && !strncasecmp(host, "localhost", host_len)) { @@ -541,6 +538,10 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND *conn, } else #endif { + if (!port) { + port = 3306; + } + transport_len = spprintf(&transport, 0, "tcp://%s:%d", host, port); } DBG_INF_FMT("transport=%s", transport); |