logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: MySQL driver mysql_real_connect flags: msg#00011

Subject: Re: MySQL driver mysql_real_connect flags
Quoting Chris Newman <chris@xxxxxxxxxxx>:


> ...however the problem is that the flags option is occupied by the
> individual compression option because of the int _compression line so I
> guess it would be better written as something like:
>
>       int connect_flags = dbi_conn_get_option_numeric(conn,
> "mysql_connect_flags");
>
>          mycon = mysql_init(NULL);
>          if (!mycon) {
>                  return -1;
>          }
>          else if (!mysql_real_connect(mycon, host, username, password,
> dbname, port, unix_socket, connect_flags)) {
>
> ...which can include the compression flag as well as the multi
> statements flag and others though this assumes that
> dbi_conn_get_option_numeric(conn, "mysql_connect_flags") returning NULL
> or 0 isn't a problem.
>

Another option is to check all numeric options against the list of the  
mysql_real_connect client flags and 'OR' all of the available flags.  
That is, instead of assembling the client flags yourself, you could  
e.g. set "CLIENT_COMPRESS" and "CLIENT_MULTI_STATEMENTS" to 1 using  
the libdbi set_option functions. The driver would then assemble the  
proper value for connect_flags. The change to the driver would be  
fairly trivial, and I agree that we should support all available flags  
instead of just the compression flag.

regards,
Markus

-- 
Markus Hoenicka
markus.hoenicka@xxxxxxx
(Spam-protected email: replace the quadrupeds with "mhoenicka")
http://www.mhoenicka.de


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


<Prev in Thread] Current Thread [Next in Thread>