PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LTP GCOV extension - code coverage report
Current view: directory - pdo_mysql - php_pdo_mysql_int.h
Test: PHP Code Coverage
Date: 2009-11-23 Instrumented lines: 5
Code covered: 80.0 % Executed lines: 4
Legend: not executed executed

       1                 : /*
       2                 :   +----------------------------------------------------------------------+
       3                 :   | PHP Version 6                                                        |
       4                 :   +----------------------------------------------------------------------+
       5                 :   | Copyright (c) 1997-2009 The PHP Group                                |
       6                 :   +----------------------------------------------------------------------+
       7                 :   | This source file is subject to version 3.01 of the PHP license,      |
       8                 :   | that is bundled with this package in the file LICENSE, and is        |
       9                 :   | available through the world-wide-web at the following url:           |
      10                 :   | http://www.php.net/license/3_01.txt                                  |
      11                 :   | If you did not receive a copy of the PHP license and are unable to   |
      12                 :   | obtain it through the world-wide-web, please send a note to          |
      13                 :   | license@php.net so we can mail you a copy immediately.               |
      14                 :   +----------------------------------------------------------------------+
      15                 :   | Author: George Schlossnagle <george@omniti.com>                      |
      16                 :   |         Wez Furlong <wez@php.net>                                    |
      17                 :   |         Johannes Schlueter <johannes@mysql.com>                      |
      18                 :   +----------------------------------------------------------------------+
      19                 : */
      20                 : 
      21                 : /* $Id: php_pdo_mysql_int.h 288583 2009-09-22 15:31:35Z uw $ */
      22                 : 
      23                 : #ifndef PHP_PDO_MYSQL_INT_H
      24                 : #define PHP_PDO_MYSQL_INT_H
      25                 : 
      26                 : #if defined(PDO_USE_MYSQLND)
      27                 : #       include "ext/mysqlnd/mysqlnd.h"
      28                 : #       include "ext/mysql/mysql_mysqlnd.h"
      29                 : #       include "ext/mysqlnd/mysqlnd_libmysql_compat.h"
      30                 : #       define PDO_MYSQL_PARAM_BIND MYSQLND_PARAM_BIND
      31                 : #else
      32                 : #       include <mysql.h>
      33                 : #       define PDO_MYSQL_PARAM_BIND MYSQL_BIND
      34                 : #endif
      35                 : 
      36                 : #if defined(PDO_USE_MYSQLND) && PHP_DEBUG && !defined(PHP_WIN32)
      37                 : #define PDO_DBG_ENABLED 1
      38                 : 
      39                 : #define PDO_DBG_INF(msg) do { if (dbg_skip_trace == FALSE) PDO_MYSQL_G(dbg)->m->log(PDO_MYSQL_G(dbg), __LINE__, __FILE__, -1, "info : ", (msg)); } while (0)
      40                 : #define PDO_DBG_ERR(msg) do { if (dbg_skip_trace == FALSE) PDO_MYSQL_G(dbg)->m->log(PDO_MYSQL_G(dbg), __LINE__, __FILE__, -1, "error: ", (msg)); } while (0)
      41                 : #define PDO_DBG_INF_FMT(...) do { if (dbg_skip_trace == FALSE) PDO_MYSQL_G(dbg)->m->log_va(PDO_MYSQL_G(dbg), __LINE__, __FILE__, -1, "info : ", __VA_ARGS__); } while (0)
      42                 : #define PDO_DBG_ERR_FMT(...) do { if (dbg_skip_trace == FALSE) PDO_MYSQL_G(dbg)->m->log_va(PDO_MYSQL_G(dbg), __LINE__, __FILE__, -1, "error: ", __VA_ARGS__); } while (0)
      43                 : #define PDO_DBG_ENTER(func_name) zend_bool dbg_skip_trace = TRUE; if (PDO_MYSQL_G(dbg)) dbg_skip_trace = !PDO_MYSQL_G(dbg)->m->func_enter(PDO_MYSQL_G(dbg), __LINE__, __FILE__, func_name, strlen(func_name));
      44                 : #define PDO_DBG_RETURN(value)   do { if (PDO_MYSQL_G(dbg)) PDO_MYSQL_G(dbg)->m->func_leave(PDO_MYSQL_G(dbg), __LINE__, __FILE__); return (value); } while (0)
      45                 : #define PDO_DBG_VOID_RETURN             do { if (PDO_MYSQL_G(dbg)) PDO_MYSQL_G(dbg)->m->func_leave(PDO_MYSQL_G(dbg), __LINE__, __FILE__); return; } while (0)
      46                 : 
      47                 : #else
      48                 : #define PDO_DBG_ENABLED 0
      49                 : 
      50             437 : static inline void PDO_DBG_INF(char *msg) {}
      51               1 : static inline void PDO_DBG_ERR(char *msg) {}
      52           89219 : static inline void PDO_DBG_INF_FMT(char *format, ...) {}
      53               0 : static inline void PDO_DBG_ERR_FMT(char *format, ...) {}
      54           49924 : static inline void PDO_DBG_ENTER(char *func_name) {}
      55                 : #define PDO_DBG_RETURN(value)   return (value)
      56                 : #define PDO_DBG_VOID_RETURN             return;
      57                 : 
      58                 : #endif
      59                 : 
      60                 : #if defined(PDO_USE_MYSQLND)
      61                 : #include "ext/mysqlnd/mysqlnd_debug.h"
      62                 : #endif
      63                 : 
      64                 : #ifdef PDO_USE_MYSQLND
      65                 : ZEND_BEGIN_MODULE_GLOBALS(pdo_mysql)
      66                 :         MYSQLND_THD_ZVAL_PCACHE *mysqlnd_thd_zval_cache;
      67                 :         long          cache_size;
      68                 : #ifndef PHP_WIN32
      69                 :         char          *default_socket;
      70                 : #endif
      71                 : #if PDO_DBG_ENABLED
      72                 :         char          *debug; /* The actual string */
      73                 :         MYSQLND_DEBUG *dbg;     /* The DBG object */
      74                 : #endif
      75                 : ZEND_END_MODULE_GLOBALS(pdo_mysql)
      76                 : 
      77                 : ZEND_EXTERN_MODULE_GLOBALS(pdo_mysql);
      78                 : #endif
      79                 : 
      80                 : #ifdef ZTS
      81                 : #define PDO_MYSQL_G(v) TSRMG(pdo_mysql_globals_id, zend_pdo_mysql_globals *, v)
      82                 : #else
      83                 : #define PDO_MYSQL_G(v) (pdo_mysql_globals.v)
      84                 : #endif
      85                 : 
      86                 : 
      87                 : typedef struct {
      88                 :         const char *file;
      89                 :         int line;
      90                 :         unsigned int errcode;
      91                 :         char *errmsg;
      92                 : } pdo_mysql_error_info;
      93                 : 
      94                 : /* stuff we use in a mySQL database handle */
      95                 : typedef struct {
      96                 :         MYSQL           *server;
      97                 : 
      98                 :         unsigned attached:1;
      99                 :         unsigned buffered:1;
     100                 :         unsigned emulate_prepare:1;
     101                 :         unsigned fetch_table_names:1;
     102                 :         unsigned _reserved:31;  
     103                 : #if !PDO_USE_MYSQLND
     104                 :         unsigned long max_buffer_size;
     105                 : #endif
     106                 : 
     107                 :         pdo_mysql_error_info einfo;
     108                 : } pdo_mysql_db_handle;
     109                 : 
     110                 : typedef struct {
     111                 :         MYSQL_FIELD             *def;
     112                 : } pdo_mysql_column;
     113                 : 
     114                 : typedef struct {
     115                 :         pdo_mysql_db_handle     *H;
     116                 :         MYSQL_RES               *result;
     117                 :         const MYSQL_FIELD       *fields;
     118                 :         MYSQL_ROW               current_data;
     119                 : #if PDO_USE_MYSQLND
     120                 :         unsigned long           *current_lengths;
     121                 : #else
     122                 :         long                    *current_lengths;
     123                 : #endif
     124                 :         pdo_mysql_error_info einfo;
     125                 : #if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
     126                 : #if PDO_USE_MYSQLND
     127                 :         MYSQLND_STMT            *stmt;
     128                 : #else
     129                 :         MYSQL_STMT              *stmt;
     130                 : #endif  
     131                 :         int num_params;
     132                 :         PDO_MYSQL_PARAM_BIND    *params;
     133                 : #ifndef PDO_USE_MYSQLND
     134                 :         my_bool                 *in_null;
     135                 :         unsigned long           *in_length;
     136                 : #endif
     137                 :         PDO_MYSQL_PARAM_BIND    *bound_result;
     138                 :         my_bool                 *out_null;
     139                 :         unsigned long           *out_length;
     140                 :         unsigned int            params_given;
     141                 :         unsigned                max_length:1;
     142                 : #endif
     143                 : } pdo_mysql_stmt;
     144                 : 
     145                 : extern pdo_driver_t pdo_mysql_driver;
     146                 : 
     147                 : extern int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC);
     148                 : #define pdo_mysql_error(s) _pdo_mysql_error(s, NULL, __FILE__, __LINE__ TSRMLS_CC)
     149                 : #define pdo_mysql_error_stmt(s) _pdo_mysql_error(stmt->dbh, stmt, __FILE__, __LINE__ TSRMLS_CC)
     150                 : 
     151                 : extern struct pdo_stmt_methods mysql_stmt_methods;
     152                 : 
     153                 : enum {
     154                 :         PDO_MYSQL_ATTR_USE_BUFFERED_QUERY = PDO_ATTR_DRIVER_SPECIFIC,
     155                 :         PDO_MYSQL_ATTR_LOCAL_INFILE,
     156                 :         PDO_MYSQL_ATTR_INIT_COMMAND,
     157                 : #ifndef PDO_USE_MYSQLND
     158                 :         PDO_MYSQL_ATTR_READ_DEFAULT_FILE,
     159                 :         PDO_MYSQL_ATTR_READ_DEFAULT_GROUP,
     160                 :         PDO_MYSQL_ATTR_MAX_BUFFER_SIZE,
     161                 :         PDO_MYSQL_ATTR_COMPRESS,
     162                 : #endif
     163                 :         PDO_MYSQL_ATTR_DIRECT_QUERY,
     164                 :         PDO_MYSQL_ATTR_FOUND_ROWS,
     165                 :         PDO_MYSQL_ATTR_IGNORE_SPACE
     166                 : };
     167                 : 
     168                 : #endif

Generated by: LTP GCOV extension version 1.5

Generated at Mon, 23 Nov 2009 17:39:35 +0000 (35 hours ago)

Copyright © 2005-2009 The PHP Group
All rights reserved.