]> granicus.if.org Git - php/commitdiff
Remove stub code which never actually was used for anything.
authorAndrey Hristov <andrey@php.net>
Wed, 9 Dec 2009 20:38:11 +0000 (20:38 +0000)
committerAndrey Hristov <andrey@php.net>
Wed, 9 Dec 2009 20:38:11 +0000 (20:38 +0000)
Things like this can be built on top of the core.

ext/mysql/php_mysql.c
ext/mysql/php_mysql_structs.h
ext/mysqli/mysqli.c
ext/mysqli/php_mysqli_structs.h
ext/mysqlnd/config.w32
ext/mysqlnd/config9.m4
ext/mysqlnd/mysqlnd.c
ext/mysqlnd/mysqlnd.h
ext/mysqlnd/mysqlnd_qcache.c [deleted file]
ext/mysqlnd/mysqlnd_result.c
ext/mysqlnd/mysqlnd_structs.h

index 3f2a1554dcda98672fa532cba36b8debcf43d2da..1d351ef863bc059f249acc436fb49e710282c6e7 100644 (file)
@@ -125,9 +125,6 @@ typedef struct _php_mysql_conn {
        int multi_query;
 } php_mysql_conn;
 
-#ifdef MYSQL_USE_MYSQLND
-static MYSQLND_QCACHE          *mysql_mysqlnd_qcache;
-#endif
 
 #if MYSQL_VERSION_ID >= 40101
 #define MYSQL_DISABLE_MQ if (mysql->multi_query) { \
@@ -457,8 +454,6 @@ ZEND_MODULE_STARTUP_D(mysql)
                return FAILURE;
        }
 #endif
-#else
-       mysql_mysqlnd_qcache = mysqlnd_qcache_init_cache();
 #endif
 
        return SUCCESS;
@@ -484,8 +479,6 @@ PHP_MSHUTDOWN_FUNCTION(mysql)
        mysql_server_end();
 #endif
 #endif
-#else
-       mysqlnd_qcache_free_cache_reference(&mysql_mysqlnd_qcache);
 #endif
 
        UNREGISTER_INI_ENTRIES();
index b4bc4d042cb05bd840359a409513324d85a63650..d1f7519ad08267af3bb52820e13fdb37eae19707 100644 (file)
@@ -124,9 +124,6 @@ ZEND_BEGIN_MODULE_GLOBALS(mysql)
        long result_allocated;
        long trace_mode;
        long allow_local_infile;
-#ifdef MYSQL_USE_MYSQLND
-       MYSQLND_QCACHE                  *mysqlnd_qcache;
-#endif
 ZEND_END_MODULE_GLOBALS(mysql)
 
 #ifdef ZTS
index 4c9c6bf41d4c6ee2d2be75dd9e3b7e2b522b15e4..31b8efece97201174ab63f272c072fc61897abbf 100644 (file)
@@ -73,10 +73,6 @@ zend_class_entry *mysqli_driver_class_entry;
 zend_class_entry *mysqli_warning_class_entry;
 zend_class_entry *mysqli_exception_class_entry;
 
-#ifdef MYSQLI_USE_MYSQLND
-MYSQLND_QCACHE         *mysqli_mysqlnd_qcache;
-#endif
-
 
 typedef int (*mysqli_read_t)(mysqli_object *obj, zval **retval TSRMLS_DC);
 typedef int (*mysqli_write_t)(mysqli_object *obj, zval *newval TSRMLS_DC);
@@ -633,8 +629,6 @@ PHP_MINIT_FUNCTION(mysqli)
                return FAILURE;
        }
 #endif
-#else
-       mysqli_mysqlnd_qcache = mysqlnd_qcache_init_cache();
 #endif
 
        memcpy(&mysqli_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
@@ -872,8 +866,6 @@ PHP_MSHUTDOWN_FUNCTION(mysqli)
        mysql_server_end();
 #endif
 #endif
-#else
-       mysqlnd_qcache_free_cache_reference(&mysqli_mysqlnd_qcache);
 #endif
 
        zend_hash_destroy(&mysqli_driver_properties);
index e9d76b02892711b230b298175350a286da6863bd..c3bbfe7a11266543f436dea4a5313148d6a581a5 100644 (file)
@@ -196,10 +196,6 @@ extern zend_property_info mysqli_stmt_property_info_entries[];
 extern zend_property_info mysqli_driver_property_info_entries[];
 extern zend_property_info mysqli_warning_property_info_entries[];
 
-#ifdef MYSQLI_USE_MYSQLND
-extern MYSQLND_QCACHE          *mysqli_mysqlnd_qcache;
-#endif
-
 extern void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flag, int into_object);
 extern void php_clear_stmt_bind(MY_STMT *stmt TSRMLS_DC);
 extern void php_clear_mysql(MY_MYSQL *);
index a26d357fb61fe2e7306c83b64991dc90c8d91680..c2185fd9e9ff338b7e0bcdd999b2dfca00da994c 100644 (file)
@@ -13,7 +13,6 @@ if (PHP_MYSQLND != "no") {
                        "mysqlnd_loaddata.c " +
                        "mysqlnd_ps.c " +
                        "mysqlnd_ps_codec.c " +
-                       "mysqlnd_qcache.c " +
                        "mysqlnd_result.c " +
                        "mysqlnd_result_meta.c " +
                        "mysqlnd_statistics.c " +
index 884800dce3a4220106e861e037e90e7c604da3c7..a5cae22d1b6319519159784106bc104991f8da06 100644 (file)
@@ -16,7 +16,7 @@ dnl If some extension uses mysqlnd it will get compiled in PHP core
 if test "$PHP_MYSQLND_ENABLED" = "yes"; then
   mysqlnd_sources="mysqlnd.c mysqlnd_charset.c mysqlnd_wireprotocol.c \
                    mysqlnd_ps.c mysqlnd_loaddata.c \
-                   mysqlnd_ps_codec.c mysqlnd_statistics.c mysqlnd_qcache.c\
+                   mysqlnd_ps_codec.c mysqlnd_statistics.c \
                                   mysqlnd_result.c mysqlnd_result_meta.c mysqlnd_debug.c\
                                   mysqlnd_block_alloc.c php_mysqlnd.c"
 
index 46c0f3071304382d297cdf27cc6e1736f5691843..653a128e35f735e686d0a6412435a62761f94ec6 100644 (file)
@@ -211,11 +211,6 @@ MYSQLND_METHOD(mysqlnd_conn, free_contents)(MYSQLND *conn TSRMLS_DC)
                mnd_pefree(conn->last_message, pers);
                conn->last_message = NULL;
        }
-       if (conn->qcache) {
-               DBG_INF("Freeing qcache reference");
-               mysqlnd_qcache_free_cache_reference(&conn->qcache);
-               conn->qcache = NULL;
-       }
        if (conn->net.cmd_buffer.buffer) {
                DBG_INF("Freeing cmd buffer");
                mnd_pefree(conn->net.cmd_buffer.buffer, pers);
index 033de59634c81dbeb239eb19dcd37b40de04da3e..674d64b15e9f96990bfe22e313c278eb559c30be 100644 (file)
@@ -306,34 +306,6 @@ PHPAPI ulong mysqlnd_old_escape_string(char *newstr, const char *escapestr, size
 /* Performance statistics */
 PHPAPI void                    _mysqlnd_get_client_stats(zval *return_value TSRMLS_DC ZEND_FILE_LINE_DC);
 
-
-/* ---------------------- QUERY CACHE ---------------*/
-struct st_mysqlnd_qcache {
-       HashTable               *ht;
-       unsigned int    references;
-#ifdef ZTS
-       MUTEX_T         LOCK_access;
-#endif
-};
-
-
-typedef struct st_mysqlnd_qcache_element {
-       MYSQLND_RES_BUFFERED *data;
-       MYSQLND_RES_METADATA *meta;
-       const char * query;
-       size_t  query_len;
-} MYSQLND_QCACHE_ELEMENT;
-
-
-PHPAPI MYSQLND_QCACHE *        mysqlnd_qcache_init_cache();
-PHPAPI MYSQLND_QCACHE *        mysqlnd_qcache_get_cache_reference(MYSQLND_QCACHE * const cache);
-PHPAPI void                            mysqlnd_qcache_free_cache_reference(MYSQLND_QCACHE **cache);
-PHPAPI void                            mysqlnd_qcache_stats(const MYSQLND_QCACHE * const cache, zval *return_value);
-MYSQLND_RES *          mysqlnd_qcache_get(MYSQLND_QCACHE * const cache, const char * query,
-                                                                          size_t query_len);
-void                           mysqlnd_qcache_put(MYSQLND_QCACHE * const cache, char * query, size_t query_len,
-                                                                          MYSQLND_RES_BUFFERED * const result, MYSQLND_RES_METADATA * const meta);
-
 /* double check the class name to avoid naming conflicts when using these: */
 #define MYSQLND_METHOD(class, method) php_##class##_##method##_pub
 #define MYSQLND_METHOD_PRIVATE(class, method) php_##class##_##method##_priv
diff --git a/ext/mysqlnd/mysqlnd_qcache.c b/ext/mysqlnd/mysqlnd_qcache.c
deleted file mode 100644 (file)
index eef543e..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
-  +----------------------------------------------------------------------+
-  | PHP Version 6                                                        |
-  +----------------------------------------------------------------------+
-  | Copyright (c) 2006-2009 The PHP Group                                |
-  +----------------------------------------------------------------------+
-  | This source file is subject to version 3.01 of the PHP license,      |
-  | that is bundled with this package in the file LICENSE, and is        |
-  | available through the world-wide-web at the following url:           |
-  | http://www.php.net/license/3_01.txt                                  |
-  | If you did not receive a copy of the PHP license and are unable to   |
-  | obtain it through the world-wide-web, please send a note to          |
-  | license@php.net so we can mail you a copy immediately.               |
-  +----------------------------------------------------------------------+
-  | Authors: Georg Richter <georg@mysql.com>                             |
-  |          Andrey Hristov <andrey@mysql.com>                           |
-  |          Ulf Wendel <uwendel@mysql.com>                              |
-  +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-#include "php.h"
-#include "mysqlnd.h"
-#include "mysqlnd_priv.h"
-#include "mysqlnd_statistics.h"
-
-#define MYSQLND_SILENT
-
-#ifdef ZTS
-#define LOCK_QCACHE(cache)             tsrm_mutex_lock((cache)->LOCK_access)
-#define UNLOCK_QCACHE(cache)   tsrm_mutex_unlock((cache)->LOCK_access)
-#else
-#define LOCK_QCACHE(cache)
-#define UNLOCK_QCACHE(cache)
-#endif
-
-
-/* {{{ mysqlnd_qcache_init_cache */
-PHPAPI MYSQLND_QCACHE * mysqlnd_qcache_init_cache()
-{
-       MYSQLND_QCACHE *cache = calloc(1, sizeof(MYSQLND_QCACHE));
-#ifndef MYSQLND_SILENT
-       php_printf("[mysqlnd_qcache_init_cache %p]\n", cache);
-#endif
-
-       cache->references = 1;
-#ifdef ZTS
-       cache->LOCK_access = tsrm_mutex_alloc();
-#endif
-       cache->ht = malloc(sizeof(HashTable));
-       zend_hash_init(cache->ht, 10 /* init_elements */, NULL, NULL, TRUE /*pers*/);
-
-       return cache;
-}
-/* }}} */
-
-
-/* {{{ mysqlnd_qcache_get_cache_reference */
-PHPAPI MYSQLND_QCACHE * mysqlnd_qcache_get_cache_reference(MYSQLND_QCACHE * const cache)
-{
-       if (cache) {
-#ifndef MYSQLND_SILENT
-               php_printf("[mysqlnd_qcache_get_cache_reference %p will become %d]\n", cache, cache->references+1);
-#endif
-               LOCK_QCACHE(cache);
-               cache->references++;
-               UNLOCK_QCACHE(cache);
-       }
-       return cache;
-}
-/* }}} */
-
-
-/* {{{ mysqlnd_qcache_free_cache */
-/*
-  As this call will happen on MSHUTDOWN(), then we don't need to copy the zvals with
-  copy_ctor but scrap what they point to with zval_dtor() and then just free our
-  pre-allocated block. Precondition is that we ZVAL_NULL() the zvals when we put them
-  to the free list after usage. We ZVAL_NULL() them when we allocate them in the 
-  constructor of the cache.
-*/
-static
-void mysqlnd_qcache_free_cache(MYSQLND_QCACHE *cache)
-{
-#ifndef MYSQLND_SILENT
-       php_printf("[mysqlnd_qcache_free_cache %p]\n", cache);
-#endif
-
-#ifdef ZTS
-       tsrm_mutex_free(cache->LOCK_access);
-#endif
-       zend_hash_destroy(cache->ht);
-       free(cache->ht);
-       free(cache);
-}
-/* }}} */
-
-
-/* {{{ mysqlnd_qcache_free_cache_reference */
-PHPAPI void mysqlnd_qcache_free_cache_reference(MYSQLND_QCACHE **cache)
-{
-       if (*cache) {
-               zend_bool to_free;
-#ifndef MYSQLND_SILENT
-               php_printf("[mysqlnd_qcache_free_cache_reference %p] refs=%d\n", *cache, (*cache)->references);
-#endif
-               LOCK_QCACHE(*cache);
-               to_free = --(*cache)->references == 0;
-               /* Unlock before destroying */
-               UNLOCK_QCACHE(*cache);
-               if (to_free) {
-                       mysqlnd_qcache_free_cache(*cache);
-               }
-               *cache = NULL;
-       }
-}
-/* }}} */
-
-
-/* {{{ mysqlnd_qcache_free_cache_reference */
-PHPAPI void mysqlnd_qcache_stats(const MYSQLND_QCACHE * const cache, zval *return_value)
-{
-       if (cache) {
-               LOCK_QCACHE(cache);
-               array_init(return_value);
-               add_assoc_long_ex(return_value, "references",   sizeof("references"),   cache->references);
-               UNLOCK_QCACHE(cache);
-       } else {
-               ZVAL_NULL(return_value);
-       }
-}
-/* }}} */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
index ab09530292e0a66fd5ff88c29b8f7d055662876e..0fc0663e0b61e658e48664f320e19a280a200db1 100644 (file)
@@ -223,9 +223,6 @@ MYSQLND_METHOD(mysqlnd_res, free_buffered_data)(MYSQLND_RES *result TSRMLS_DC)
        }
        set->data_cursor = NULL;
        set->row_count  = 0;
-       if (set->qcache) {
-               mysqlnd_qcache_free_cache_reference(&set->qcache);
-       }
 
        DBG_INF("Freeing set");
        mnd_pefree(set, set->persistent);
@@ -1069,7 +1066,6 @@ MYSQLND_METHOD(mysqlnd_res, store_result_fetch_data)(MYSQLND * const conn, MYSQL
                set->row_buffers = mnd_pemalloc(free_rows * sizeof(MYSQLND_MEMORY_POOL_CHUNK *), to_cache);
        }
        set->persistent = to_cache;
-       set->qcache             = to_cache? mysqlnd_qcache_get_cache_reference(conn->qcache):NULL;
        set->references = 1;
 
        result->m.row_decoder = binary_protocol? php_mysqlnd_rowp_read_binary_protocol:
index 04e8ee078ceeeb1d57ddd6d1a648a8999cf074eb..9409f0308a16c86f08f28166378a579ba53d95b6 100644 (file)
@@ -107,9 +107,6 @@ typedef struct st_mysqlnd_error_info
 } mysqlnd_error_info;
 
 
-typedef struct st_mysqlnd_qcache                               MYSQLND_QCACHE;
-
-
 typedef struct st_mysqlnd_infile_info
 {
        php_stream                      *fd;
@@ -480,9 +477,6 @@ struct st_mysqlnd_connection
        /* options */
        MYSQLND_OPTION  options;
 
-       /* qcache */
-       MYSQLND_QCACHE  *qcache;
-
        /* stats */
        MYSQLND_STATS   stats;
 
@@ -526,7 +520,6 @@ struct st_mysqlnd_buffered_result
        uint64_t                        initialized_rows;
        zend_bool                       persistent;
 
-       MYSQLND_QCACHE          *qcache;
        unsigned int            references;
 
        mysqlnd_error_info      error_info;