Skip to content

Commit 0131f24

Browse files
lawrinlawrin
authored andcommitted
uri patch reviewers requested changes
1 parent 3388bbb commit 0131f24

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

driver/mysql_connection.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,9 @@ void MySQL_Connection::init(ConnectOptionsMap & properties)
232232
if (it != properties.end())
233233
{
234234
if ((p_s = boost::get< sql::SQLString >(&it->second))) {
235-
236-
parseUri(*p_s, uri);
235+
/* Parsing uri prior to processing all parameters, so indivudually
236+
specified parameters precede over those in the uri */
237+
parseUri(*p_s, uri);
237238
} else {
238239
throw sql::InvalidArgumentException("No string value passed for hostName");
239240
}

driver/mysql_uri.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void MySQL_Uri::setPipe(const sql::SQLString &p)
115115

116116

117117
/* {{{ MySQL_Uri::setPort() -I- */
118-
void MySQL_Uri::setPort(int p)
118+
void MySQL_Uri::setPort(unsigned int p)
119119
{
120120
setProtocol(NativeAPI::PROTOCOL_TCP);
121121
port= p;
@@ -131,6 +131,10 @@ bool tcpProtocol(MySQL_Uri& uri)
131131

132132

133133
/* {{{ Parse_Uri() -I- */
134+
/* URI formats tcp://[host]:port/schema
135+
unix://socket
136+
pipe://named_pipe
137+
*/
134138
bool parseUri(const sql::SQLString & str, MySQL_Uri& uri)
135139
{
136140
if (!str.compare(0, sizeof(MYURI_SOCKET_PREFIX) - 1, MYURI_SOCKET_PREFIX))

driver/mysql_uri.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class MySQL_Uri
5555
void setHost (const sql::SQLString &h);
5656
void setSocket (const sql::SQLString &s);
5757
void setPipe (const sql::SQLString &p);
58-
void setPort (int p);
58+
void setPort (unsigned int p);
5959
inline void setSchema (const sql::SQLString &s) {schema= s.c_str();}
6060

6161
inline void setProtocol(NativeAPI::Protocol_Type p){protocol= p;}

0 commit comments

Comments
 (0)