andrey                                   Mon, 09 Aug 2010 17:01:57 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=302043

Log:
Lay foundations for named pipe support in mysqlnd

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_enum_n_def.h
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd.c
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd_enum_n_def.h
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c  2010-08-09 16:55:48 UTC 
(rev 302042)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c  2010-08-09 17:01:57 UTC 
(rev 302043)
@@ -2116,10 +2116,17 @@
                        DBG_INF_FMT("charset=%s", conn->options.charset_name);
                        break;
                }
+               case MYSQL_OPT_NAMED_PIPE:
+                       conn->options.protocol = MYSQL_PROTOCOL_PIPE;
+                       break;
+               case MYSQL_OPT_PROTOCOL:
+                       if (*(unsigned int*) value < MYSQL_PROTOCOL_LAST) {
+                               conn->options.protocol = *(unsigned int*) value;
+                       }
+                       break;
 #ifdef WHEN_SUPPORTED_BY_MYSQLI
                case MYSQL_SET_CHARSET_DIR:
                case MYSQL_OPT_RECONNECT:
-               case MYSQL_OPT_PROTOCOL:
                        /* we don't need external character sets, all character 
sets are
                           compiled in. For compatibility we just ignore this 
setting.
                           Same for protocol, we don't support old protocol */
@@ -2131,7 +2138,6 @@
 #endif

 #ifdef WHEN_SUPPORTED_BY_MYSQLI
-               case MYSQL_OPT_NAMED_PIPE:
                case MYSQL_SHARED_MEMORY_BASE_NAME:
                case MYSQL_OPT_USE_RESULT:
                case MYSQL_SECURE_AUTH:

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_enum_n_def.h
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_enum_n_def.h       
2010-08-09 16:55:48 UTC (rev 302042)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_enum_n_def.h       
2010-08-09 17:01:57 UTC (rev 302043)
@@ -168,6 +168,15 @@
        MYSQLND_OPT_SSL_PASSPHRASE = 209
 } enum_mysqlnd_option;

+typedef enum mysqlnd_protocol_type
+{
+       MYSQL_PROTOCOL_DEFAULT = 0,
+       MYSQL_PROTOCOL_TCP,             /* all, supported */
+       MYSQL_PROTOCOL_SOCKET,  /* unix, supported */
+       MYSQL_PROTOCOL_PIPE,    /* win32, not-supported */
+       MYSQL_PROTOCOL_MEMORY,  /* win32, not-supported */
+       MYSQL_PROTOCOL_LAST
+} enum_mysqlnd_protocol_type;

 typedef enum mysqlnd_field_types
 {

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h  2010-08-09 
16:55:48 UTC (rev 302042)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h  2010-08-09 
17:01:57 UTC (rev 302043)
@@ -161,7 +161,7 @@
        char            * unused3;
        char            * unused4;
        char            * unused5;
-       zend_bool       unused6;
+       enum_mysqlnd_protocol_type protocol;

        char            *charset_name;
        /* maximum allowed packet size for communication */

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd.c     2010-08-09 16:55:48 UTC (rev 
302042)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd.c     2010-08-09 17:01:57 UTC (rev 
302043)
@@ -2116,10 +2116,17 @@
                        DBG_INF_FMT("charset=%s", conn->options.charset_name);
                        break;
                }
+               case MYSQL_OPT_NAMED_PIPE:
+                       conn->options.protocol = MYSQL_PROTOCOL_PIPE;
+                       break;
+               case MYSQL_OPT_PROTOCOL:
+                       if (*(unsigned int*) value < MYSQL_PROTOCOL_LAST) {
+                               conn->options.protocol = *(unsigned int*) value;
+                       }
+                       break;
 #ifdef WHEN_SUPPORTED_BY_MYSQLI
                case MYSQL_SET_CHARSET_DIR:
                case MYSQL_OPT_RECONNECT:
-               case MYSQL_OPT_PROTOCOL:
                        /* we don't need external character sets, all character 
sets are
                           compiled in. For compatibility we just ignore this 
setting.
                           Same for protocol, we don't support old protocol */
@@ -2131,7 +2138,6 @@
 #endif

 #ifdef WHEN_SUPPORTED_BY_MYSQLI
-               case MYSQL_OPT_NAMED_PIPE:
                case MYSQL_SHARED_MEMORY_BASE_NAME:
                case MYSQL_OPT_USE_RESULT:
                case MYSQL_SECURE_AUTH:

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_enum_n_def.h
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_enum_n_def.h  2010-08-09 16:55:48 UTC 
(rev 302042)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_enum_n_def.h  2010-08-09 17:01:57 UTC 
(rev 302043)
@@ -168,6 +168,15 @@
        MYSQLND_OPT_SSL_PASSPHRASE = 209
 } enum_mysqlnd_option;

+typedef enum mysqlnd_protocol_type
+{
+       MYSQL_PROTOCOL_DEFAULT = 0,
+       MYSQL_PROTOCOL_TCP,             /* all, supported */
+       MYSQL_PROTOCOL_SOCKET,  /* unix, supported */
+       MYSQL_PROTOCOL_PIPE,    /* win32, not-supported */
+       MYSQL_PROTOCOL_MEMORY,  /* win32, not-supported */
+       MYSQL_PROTOCOL_LAST
+} enum_mysqlnd_protocol_type;

 typedef enum mysqlnd_field_types
 {

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h     2010-08-09 16:55:48 UTC 
(rev 302042)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h     2010-08-09 17:01:57 UTC 
(rev 302043)
@@ -161,7 +161,7 @@
        char            * unused3;
        char            * unused4;
        char            * unused5;
-       zend_bool       unused6;
+       enum_mysqlnd_protocol_type protocol;

        char            *charset_name;
        /* maximum allowed packet size for communication */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to