php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #15764 mysql_real_connect client flags: compression & SSL
Submitted: 2002-02-27 14:26 UTC Modified: 2002-04-02 00:00 UTC
Votes:2
Avg. Score:2.5 ± 1.5
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: ben at traffic-power dot com Assigned:
Status: No Feedback Package: Feature/Change Request
PHP Version: 4.0CVS-2002-02-27 OS: all
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ben at traffic-power dot com
New email:
PHP Version: OS:

 

 [2002-02-27 14:26 UTC] ben at traffic-power dot com
mysql with a VERSION_ID > 40001 (maybe 40000) supports the following clientflags

CLIENT_COMPRESS  Use compression protocol.  
CLIENT_FOUND_ROWS  Return the number of found (matched) rows, not the number of affected rows.  
CLIENT_IGNORE_SPACE  Allow spaces after function names. Makes all functions names reserved words.  
CLIENT_INTERACTIVE  Allow interactive_timeout seconds (instead of wait_timeout seconds) of inactivity before closing the connection.  
CLIENT_NO_SCHEMA  Don't allow the db_name.tbl_name.col_name syntax. This is for ODBC. It causes the parser to generate an error if you use that syntax, which is useful for trapping bugs in some ODBC programs.  
CLIENT_ODBC  The client is an ODBC client. This changes mysqld to be more ODBC-friendly.  
CLIENT_SSL  Use SSL (encrypted protocol). 


It would be nice to add CLIENT_SSL and CLIENT_COMPRESS options to the php_mysql_do_connect() ... 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-28 17:18 UTC] ben at traffic-power dot com
Would this patch be ok?  I am not sure when these constants were added to MYSQL, I could not find them in the mysql docs.  I know for sure that the >40000 series has them though...

diff ../php4-orig/ext/mysql/php_mysql.c  ext/mysql/php_mysql.c
344a345,352
>       REGISTER_LONG_CONSTANT("MYSQL_CLIENT_SSL", CLIENT_SSL, CONST_CS | CONST_PERSISTENT);
>       REGISTER_LONG_CONSTANT("MYSQL_CLIENT_COMPRESS", CLIENT_COMPRESS, CONST_CS | CONST_PERSISTENT);
>       REGISTER_LONG_CONSTANT("MYSQL_CLIENT_FOUND_ROWS", CLIENT_FOUND_ROWS, CONST_CS | CONST_PERSISTENT);
>       REGISTER_LONG_CONSTANT("MYSQL_CLIENT_NO_SCHEMA", CLIENT_NO_SCHEMA, CONST_CS | CONST_PERSISTENT);
>       REGISTER_LONG_CONSTANT("MYSQL_CLIENT_INTERACTIVE ", CLIENT_INTERACTIVE, CONST_CS | CONST_PERSISTENT);
>       REGISTER_LONG_CONSTANT("MYSQL_CLIENT_ODBC", CLIENT_ODBC, CONST_CS | CONST_PERSISTENT);
>       REGISTER_LONG_CONSTANT("MYSQL_CLIENT_IGNORE_SPACE", CLIENT_IGNORE_SPACE,CONST_CS | CONST_PERSISTENT);
>
436a445
>       int client_flags = 0;
439c448
<       zval **z_host=NULL, **z_user=NULL, **z_passwd=NULL, **z_new_link=NULL;
---
>       zval **z_host=NULL, **z_user=NULL, **z_passwd=NULL, **z_new_link=NULL, **z_client_flags=NULL;
441a451
>
495a506,518
>                       case 5: {
>                                       if (zend_get_parameters_ex(5, &z_host, &z_user, &z_passwd, &z_new_link, &z_client_flags) == FAILURE) {
>                                                 MYSQL_DO_CONNECT_RETURN_FALSE();
>                                         }
>                                         convert_to_string_ex(z_user);
>                                         convert_to_string_ex(z_passwd);
>                                         convert_to_long_ex(z_client_flags);
>                                       user = Z_STRVAL_PP(z_user);
>                                         passwd = Z_STRVAL_PP(z_passwd);
>                                         new_link = Z_BVAL_PP(z_new_link);
>                                               client_flags = Z_LVAL_PP(z_client_flags);
>                               }
>                               break;
569c592
<                       if (mysql_real_connect(&mysql->conn, host, user, passwd, NULL, port, socket, 0)==NULL) {
---
>                       if (mysql_real_connect(&mysql->conn, host, user, passwd, NULL, port, socket, client_flags)==NULL) {
609c632
<                               if (mysql_real_connect(le->ptr, host, user, passwd, NULL, port, socket, 0)==NULL) {
---
>                               if (mysql_real_connect(le->ptr, host, user, passwd, NULL, port, socket, client_flags)==NULL) {
662c685
<               if (mysql_real_connect(&mysql->conn, host, user, passwd, NULL, port, socket, 0)==NULL) {
---
>               if (mysql_real_connect(&mysql->conn, host, user, passwd, NULL, port, socket, client_flags)==NULL) {
 [2002-03-01 03:55 UTC] derick@php.net
Can you mail a unified diff (diff -u) to this list? (php-dev@lists.php.net)

regards,
Derick
 [2002-04-02 00:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 22:01:28 2024 UTC