Back to index

php5  5.3.10
Classes | Defines | Typedefs | Functions | Variables
mysqlnd_priv.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  st_mysqlnd_perm_bind

Defines

#define Z_ADDREF_P(pz)   (++(pz)->refcount)
#define Z_DELREF_P(pz)   (--(pz)->refcount)
#define Z_REFCOUNT_P(pz)   ((pz)->refcount)
#define Z_SET_REFCOUNT_P(pz, rc)   ((pz)->refcount = rc)
#define Z_REFCOUNT_PP(ppz)   Z_REFCOUNT_P(*(ppz))
#define Z_DELREF_PP(ppz)   Z_DELREF_P(*(ppz))
#define MYSQLND_UNICODE   0
#define pestrndup(s, length, persistent)   ((persistent)?zend_strndup((s),(length)):estrndup((s),(length)))
#define MYSQLND_CLASS_METHOD_TABLE_NAME(class)   mysqlnd_##class##_methods
#define MYSQLND_CLASS_METHODS_START(class)   struct st_##class##_methods MYSQLND_CLASS_METHOD_TABLE_NAME(class) = {
#define MYSQLND_CLASS_METHODS_END   }
#define mysqlnd_array_init(arg, field_count)
#define MYSQLND_DEBUG_DUMP_TIME   1
#define MYSQLND_DEBUG_DUMP_TRACE   2
#define MYSQLND_DEBUG_DUMP_PID   4
#define MYSQLND_DEBUG_DUMP_LINE   8
#define MYSQLND_DEBUG_DUMP_FILE   16
#define MYSQLND_DEBUG_DUMP_LEVEL   32
#define MYSQLND_DEBUG_APPEND   64
#define MYSQLND_DEBUG_FLUSH   128
#define MYSQLND_DEBUG_TRACE_MEMORY_CALLS   256
#define MYSQLND_DEBUG_PROFILE_CALLS   512
#define CR_UNKNOWN_ERROR   2000
#define CR_CONNECTION_ERROR   2002
#define CR_SERVER_GONE_ERROR   2006
#define CR_OUT_OF_MEMORY   2008
#define CR_SERVER_LOST   2013
#define CR_COMMANDS_OUT_OF_SYNC   2014
#define CR_CANT_FIND_CHARSET   2019
#define CR_MALFORMED_PACKET   2027
#define CR_NOT_IMPLEMENTED   2054
#define CR_NO_PREPARE_STMT   2030
#define CR_PARAMS_NOT_BOUND   2031
#define CR_INVALID_PARAMETER_NO   2034
#define CR_INVALID_BUFFER_USE   2035
#define MYSQLND_EE_FILENOTFOUND   7890
#define UNKNOWN_SQLSTATE   "HY000"
#define MAX_CHARSET_LEN   32
#define SET_ERROR_AFF_ROWS(s)   (s)->upsert_status.affected_rows = (uint64_t) ~0
#define SET_NEW_MESSAGE(buf, buf_len, message, len, persistent)
#define SET_EMPTY_MESSAGE(buf, buf_len, persistent)
#define SET_EMPTY_ERROR(error_info)
#define SET_CLIENT_ERROR(error_info, a, b, c)
#define SET_OOM_ERROR(error_info)   SET_CLIENT_ERROR((error_info), CR_OUT_OF_MEMORY, UNKNOWN_SQLSTATE, mysqlnd_out_of_memory)
#define SET_STMT_ERROR(stmt, a, b, c)   SET_CLIENT_ERROR((stmt)->error_info, a, b, c)
#define CONN_GET_STATE(c)   (c)->m->get_state((c) TSRMLS_CC)
#define CONN_SET_STATE(c, s)   (c)->m->set_state((c), (s) TSRMLS_CC)

Typedefs

typedef void(* ps_field_fetch_func )(zval *zv, const MYSQLND_FIELD *const field, unsigned int pack_len, zend_uchar **row, zend_bool everything_as_unicode TSRMLS_DC)

Functions

enum_func_status mysqlnd_handle_local_infile (MYSQLND *conn, const char *filename, zend_bool *is_warning TSRMLS_DC)
void _mysqlnd_init_ps_subsystem ()
void _mysqlnd_init_ps_fetch_subsystem ()
void ps_fetch_from_1_to_8_bytes (zval *zv, const MYSQLND_FIELD *const field, unsigned int pack_len, zend_uchar **row, zend_bool as_unicode, unsigned int byte_count TSRMLS_DC)

Variables

PHPAPI const char *const mysqlnd_old_passwd
PHPAPI const char *const mysqlnd_out_of_sync
PHPAPI const char *const mysqlnd_server_gone
PHPAPI const char *const mysqlnd_out_of_memory

Class Documentation

struct st_mysqlnd_perm_bind

Definition at line 157 of file mysqlnd_priv.h.

Collaboration diagram for st_mysqlnd_perm_bind:
Class Members
zend_bool can_ret_as_str_in_uni
ps_field_fetch_func func
zend_bool is_possibly_blob
int pack_len
unsigned int php_type

Define Documentation

#define CONN_GET_STATE (   c)    (c)->m->get_state((c) TSRMLS_CC)

Definition at line 150 of file mysqlnd_priv.h.

#define CONN_SET_STATE (   c,
 
)    (c)->m->set_state((c), (s) TSRMLS_CC)

Definition at line 151 of file mysqlnd_priv.h.

#define CR_CANT_FIND_CHARSET   2019

Definition at line 90 of file mysqlnd_priv.h.

#define CR_COMMANDS_OUT_OF_SYNC   2014

Definition at line 89 of file mysqlnd_priv.h.

#define CR_CONNECTION_ERROR   2002

Definition at line 85 of file mysqlnd_priv.h.

#define CR_INVALID_BUFFER_USE   2035

Definition at line 96 of file mysqlnd_priv.h.

#define CR_INVALID_PARAMETER_NO   2034

Definition at line 95 of file mysqlnd_priv.h.

#define CR_MALFORMED_PACKET   2027

Definition at line 91 of file mysqlnd_priv.h.

#define CR_NO_PREPARE_STMT   2030

Definition at line 93 of file mysqlnd_priv.h.

#define CR_NOT_IMPLEMENTED   2054

Definition at line 92 of file mysqlnd_priv.h.

#define CR_OUT_OF_MEMORY   2008

Definition at line 87 of file mysqlnd_priv.h.

#define CR_PARAMS_NOT_BOUND   2031

Definition at line 94 of file mysqlnd_priv.h.

#define CR_SERVER_GONE_ERROR   2006

Definition at line 86 of file mysqlnd_priv.h.

#define CR_SERVER_LOST   2013

Definition at line 88 of file mysqlnd_priv.h.

#define CR_UNKNOWN_ERROR   2000

Definition at line 84 of file mysqlnd_priv.h.

#define MAX_CHARSET_LEN   32

Definition at line 102 of file mysqlnd_priv.h.

#define mysqlnd_array_init (   arg,
  field_count 
)
Value:
{ \
       ALLOC_HASHTABLE_REL(Z_ARRVAL_P(arg));\
       zend_hash_init(Z_ARRVAL_P(arg), (field_count), NULL, ZVAL_PTR_DTOR, 0); \
       Z_TYPE_P(arg) = IS_ARRAY;\
}

Definition at line 62 of file mysqlnd_priv.h.

#define MYSQLND_CLASS_METHOD_TABLE_NAME (   class)    mysqlnd_##class##_methods

Definition at line 50 of file mysqlnd_priv.h.

#define MYSQLND_CLASS_METHODS_END   }

Definition at line 52 of file mysqlnd_priv.h.

#define MYSQLND_CLASS_METHODS_START (   class)    struct st_##class##_methods MYSQLND_CLASS_METHOD_TABLE_NAME(class) = {

Definition at line 51 of file mysqlnd_priv.h.

#define MYSQLND_DEBUG_APPEND   64

Definition at line 77 of file mysqlnd_priv.h.

#define MYSQLND_DEBUG_DUMP_FILE   16

Definition at line 75 of file mysqlnd_priv.h.

#define MYSQLND_DEBUG_DUMP_LEVEL   32

Definition at line 76 of file mysqlnd_priv.h.

#define MYSQLND_DEBUG_DUMP_LINE   8

Definition at line 74 of file mysqlnd_priv.h.

#define MYSQLND_DEBUG_DUMP_PID   4

Definition at line 73 of file mysqlnd_priv.h.

#define MYSQLND_DEBUG_DUMP_TIME   1

Definition at line 71 of file mysqlnd_priv.h.

#define MYSQLND_DEBUG_DUMP_TRACE   2

Definition at line 72 of file mysqlnd_priv.h.

#define MYSQLND_DEBUG_FLUSH   128

Definition at line 78 of file mysqlnd_priv.h.

#define MYSQLND_DEBUG_PROFILE_CALLS   512

Definition at line 80 of file mysqlnd_priv.h.

Definition at line 79 of file mysqlnd_priv.h.

#define MYSQLND_EE_FILENOTFOUND   7890

Definition at line 98 of file mysqlnd_priv.h.

#define MYSQLND_UNICODE   0

Definition at line 39 of file mysqlnd_priv.h.

#define pestrndup (   s,
  length,
  persistent 
)    ((persistent)?zend_strndup((s),(length)):estrndup((s),(length)))

Definition at line 47 of file mysqlnd_priv.h.

#define SET_CLIENT_ERROR (   error_info,
  a,
  b,
 
)
Value:
{ \
              (error_info).error_no = (a); \
              strlcpy((error_info).sqlstate, (b), sizeof((error_info).sqlstate)); \
              strlcpy((error_info).error, (c), sizeof((error_info).error)); \
       }

Definition at line 138 of file mysqlnd_priv.h.

#define SET_EMPTY_ERROR (   error_info)
Value:
{ \
              (error_info).error_no = 0; \
              (error_info).error[0] = '\0'; \
              strlcpy((error_info).sqlstate, "00000", sizeof((error_info).sqlstate)); \
       }

Definition at line 131 of file mysqlnd_priv.h.

#define SET_EMPTY_MESSAGE (   buf,
  buf_len,
  persistent 
)
Value:
{\
              if ((buf)) { \
                     mnd_pefree((buf), (persistent)); \
                     (buf) = NULL; \
              } \
              (buf_len) = 0; \
       }

Definition at line 121 of file mysqlnd_priv.h.

#define SET_ERROR_AFF_ROWS (   s)    (s)->upsert_status.affected_rows = (uint64_t) ~0

Definition at line 105 of file mysqlnd_priv.h.

#define SET_NEW_MESSAGE (   buf,
  buf_len,
  message,
  len,
  persistent 
)
Value:
{\
              if ((buf)) { \
                     mnd_pefree((buf), (persistent)); \
              } \
              if ((message)) { \
                     (buf) = mnd_pestrndup((message), (len), (persistent)); \
              } else { \
                     (buf) = NULL; \
              } \
              (buf_len) = (len); \
       }

Definition at line 108 of file mysqlnd_priv.h.

Definition at line 145 of file mysqlnd_priv.h.

#define SET_STMT_ERROR (   stmt,
  a,
  b,
 
)    SET_CLIENT_ERROR((stmt)->error_info, a, b, c)

Definition at line 148 of file mysqlnd_priv.h.

#define UNKNOWN_SQLSTATE   "HY000"

Definition at line 100 of file mysqlnd_priv.h.

#define Z_ADDREF_P (   pz)    (++(pz)->refcount)

Definition at line 28 of file mysqlnd_priv.h.

#define Z_DELREF_P (   pz)    (--(pz)->refcount)

Definition at line 29 of file mysqlnd_priv.h.

#define Z_DELREF_PP (   ppz)    Z_DELREF_P(*(ppz))

Definition at line 33 of file mysqlnd_priv.h.

#define Z_REFCOUNT_P (   pz)    ((pz)->refcount)

Definition at line 30 of file mysqlnd_priv.h.

#define Z_REFCOUNT_PP (   ppz)    Z_REFCOUNT_P(*(ppz))

Definition at line 32 of file mysqlnd_priv.h.

#define Z_SET_REFCOUNT_P (   pz,
  rc 
)    ((pz)->refcount = rc)

Definition at line 31 of file mysqlnd_priv.h.


Typedef Documentation

typedef void(* ps_field_fetch_func)(zval *zv, const MYSQLND_FIELD *const field, unsigned int pack_len, zend_uchar **row, zend_bool everything_as_unicode TSRMLS_DC)

Definition at line 154 of file mysqlnd_priv.h.


Function Documentation

Definition at line 438 of file mysqlnd_ps_codec.c.

{
       memset(mysqlnd_ps_fetch_functions, 0, sizeof(mysqlnd_ps_fetch_functions));
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_NULL].func        = ps_fetch_null;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_NULL].pack_len    = 0;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_NULL].php_type    = IS_NULL;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_NULL].can_ret_as_str_in_uni     = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_TINY].func        = ps_fetch_int8;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_TINY].pack_len    = 1;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_TINY].php_type    = IS_LONG;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_TINY].can_ret_as_str_in_uni     = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_SHORT].func              = ps_fetch_int16;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_SHORT].pack_len   = 2;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_SHORT].php_type   = IS_LONG;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_SHORT].can_ret_as_str_in_uni    = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_YEAR].func        = ps_fetch_int16;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_YEAR].pack_len    = 2;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_YEAR].php_type    = IS_LONG;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_YEAR].can_ret_as_str_in_uni     = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_INT24].func              = ps_fetch_int32;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_INT24].pack_len   = 4;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_INT24].php_type   = IS_LONG;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_INT24].can_ret_as_str_in_uni    = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_LONG].func        = ps_fetch_int32;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_LONG].pack_len    = 4;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_LONG].php_type    = IS_LONG;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_LONG].can_ret_as_str_in_uni     = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_LONGLONG].func    = ps_fetch_int64;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_LONGLONG].pack_len= 8;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_LONGLONG].php_type= IS_LONG;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_LONGLONG].can_ret_as_str_in_uni = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_FLOAT].func              = ps_fetch_float;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_FLOAT].pack_len   = 4;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_FLOAT].php_type   = IS_DOUBLE;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_FLOAT].can_ret_as_str_in_uni    = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_DOUBLE].func             = ps_fetch_double;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_DOUBLE].pack_len  = 8;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_DOUBLE].php_type  = IS_DOUBLE;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_DOUBLE].can_ret_as_str_in_uni   = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIME].func        = ps_fetch_time;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIME].pack_len    = MYSQLND_PS_SKIP_RESULT_W_LEN;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIME].php_type    = IS_STRING;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIME].can_ret_as_str_in_uni     = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_DATE].func        = ps_fetch_date;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_DATE].pack_len    = MYSQLND_PS_SKIP_RESULT_W_LEN;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_DATE].php_type    = IS_STRING;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_DATE].can_ret_as_str_in_uni     = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDATE].func            = ps_fetch_string;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDATE].pack_len = MYSQLND_PS_SKIP_RESULT_W_LEN;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDATE].php_type = IS_STRING;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDATE].can_ret_as_str_in_uni  = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_DATETIME].func    = ps_fetch_datetime;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_DATETIME].pack_len= MYSQLND_PS_SKIP_RESULT_W_LEN;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_DATETIME].php_type= IS_STRING;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_DATETIME].can_ret_as_str_in_uni = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIMESTAMP].func   = ps_fetch_datetime;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIMESTAMP].pack_len= MYSQLND_PS_SKIP_RESULT_W_LEN;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIMESTAMP].php_type= IS_STRING;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_TIMESTAMP].can_ret_as_str_in_uni       = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_TINY_BLOB].func   = ps_fetch_string;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_TINY_BLOB].pack_len= MYSQLND_PS_SKIP_RESULT_STR;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_TINY_BLOB].php_type = IS_STRING;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_TINY_BLOB].is_possibly_blob = TRUE;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_TINY_BLOB].can_ret_as_str_in_uni       = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_BLOB].func        = ps_fetch_string;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_BLOB].pack_len    = MYSQLND_PS_SKIP_RESULT_STR;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_BLOB].php_type    = IS_STRING;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_BLOB].is_possibly_blob = TRUE;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_BLOB].can_ret_as_str_in_uni     = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_MEDIUM_BLOB].func        = ps_fetch_string;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_MEDIUM_BLOB].pack_len    = MYSQLND_PS_SKIP_RESULT_STR;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_MEDIUM_BLOB].php_type    = IS_STRING;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_MEDIUM_BLOB].is_possibly_blob = TRUE;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_MEDIUM_BLOB].can_ret_as_str_in_uni     = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_LONG_BLOB].func          = ps_fetch_string;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_LONG_BLOB].pack_len      = MYSQLND_PS_SKIP_RESULT_STR;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_LONG_BLOB].php_type      = IS_STRING;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_LONG_BLOB].is_possibly_blob = TRUE;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_LONG_BLOB].can_ret_as_str_in_uni       = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_BIT].func         = ps_fetch_bit;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_BIT].pack_len     = 8;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_BIT].php_type     = IS_LONG;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_BIT].can_ret_as_str_in_uni = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_VAR_STRING].func         = ps_fetch_string;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_VAR_STRING].pack_len     = MYSQLND_PS_SKIP_RESULT_STR;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_VAR_STRING].php_type = IS_STRING;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_VAR_STRING].is_possibly_blob = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_VARCHAR].func            = ps_fetch_string;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_VARCHAR].pack_len = MYSQLND_PS_SKIP_RESULT_STR;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_VARCHAR].php_type = IS_STRING;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_VARCHAR].is_possibly_blob = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_STRING].func                    = ps_fetch_string;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_STRING].pack_len         = MYSQLND_PS_SKIP_RESULT_STR;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_STRING].php_type  = IS_STRING;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_STRING].is_possibly_blob = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_DECIMAL].func            = ps_fetch_string;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_DECIMAL].pack_len = MYSQLND_PS_SKIP_RESULT_STR;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_DECIMAL].php_type = IS_STRING;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_DECIMAL].can_ret_as_str_in_uni  = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDECIMAL].func         = ps_fetch_string;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDECIMAL].pack_len     = MYSQLND_PS_SKIP_RESULT_STR;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDECIMAL].php_type     = IS_STRING;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_NEWDECIMAL].can_ret_as_str_in_uni      = TRUE;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_ENUM].func        = ps_fetch_string;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_ENUM].pack_len    = MYSQLND_PS_SKIP_RESULT_STR;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_ENUM].php_type    = IS_STRING;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_SET].func                = ps_fetch_string;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_SET].pack_len            = MYSQLND_PS_SKIP_RESULT_STR;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_SET].php_type            = IS_STRING;

       mysqlnd_ps_fetch_functions[MYSQL_TYPE_GEOMETRY].func    = ps_fetch_string;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_GEOMETRY].pack_len= MYSQLND_PS_SKIP_RESULT_STR;
       mysqlnd_ps_fetch_functions[MYSQL_TYPE_GEOMETRY].php_type= IS_STRING;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2417 of file mysqlnd_ps.c.

Here is the call graph for this function:

Here is the caller graph for this function:

enum_func_status mysqlnd_handle_local_infile ( MYSQLND *  conn,
const char *  filename,
zend_bool *is_warning  TSRMLS_DC 
)

Definition at line 174 of file mysqlnd_loaddata.c.

{
       char                        *buf = NULL;
       char                        empty_packet[MYSQLND_HEADER_SIZE];
       enum_func_status     result = FAIL;
       unsigned int         buflen = 4096;
       void                        *info = NULL;
       int                                bufsize;
       size_t                      ret;
       MYSQLND_INFILE              infile;

       DBG_ENTER("mysqlnd_handle_local_infile");

       if (!(conn->options.flags & CLIENT_LOCAL_FILES)) {
              php_error_docref(NULL TSRMLS_CC, E_WARNING, "LOAD DATA LOCAL INFILE forbidden");
              /* write empty packet to server */
              ret = conn->net->m.send(conn, empty_packet, 0 TSRMLS_CC);
              *is_warning = TRUE;
              goto infile_error;
       }

       infile = conn->infile;
       /* allocate buffer for reading data */
       buf = (char *)mnd_ecalloc(1, buflen);

       *is_warning = FALSE;

       /* init handler: allocate read buffer and open file */
       if (infile.local_infile_init(&info, (char *)filename, conn->infile.userdata TSRMLS_CC)) {
              *is_warning = TRUE;
              /* error occured */
              strcpy(conn->error_info.sqlstate, UNKNOWN_SQLSTATE);
              conn->error_info.error_no =
                            infile.local_infile_error(info, conn->error_info.error, sizeof(conn->error_info.error) TSRMLS_CC);
              /* write empty packet to server */
              ret = conn->net->m.send(conn, empty_packet, 0 TSRMLS_CC);
              goto infile_error;
       }

       /* read data */
       while ((bufsize = infile.local_infile_read (info, buf + MYSQLND_HEADER_SIZE, buflen - MYSQLND_HEADER_SIZE TSRMLS_CC)) > 0) {
              if ((ret = conn->net->m.send(conn, buf, bufsize TSRMLS_CC)) == 0) {
                     DBG_ERR_FMT("Error during read : %d %s %s", CR_SERVER_LOST, UNKNOWN_SQLSTATE, lost_conn);
                     SET_CLIENT_ERROR(conn->error_info, CR_SERVER_LOST, UNKNOWN_SQLSTATE, lost_conn);
                     goto infile_error;
              }
       }

       /* send empty packet for eof */
       if ((ret = conn->net->m.send(conn, empty_packet, 0 TSRMLS_CC)) == 0) {
              SET_CLIENT_ERROR(conn->error_info, CR_SERVER_LOST, UNKNOWN_SQLSTATE, lost_conn);
              goto infile_error;
       }

       /* error during read occured */
       if (bufsize < 0) {
              *is_warning = TRUE;
              DBG_ERR_FMT("Bufsize < 0, warning,  %d %s %s", CR_SERVER_LOST, UNKNOWN_SQLSTATE, lost_conn);
              strcpy(conn->error_info.sqlstate, UNKNOWN_SQLSTATE);
              conn->error_info.error_no =
                            infile.local_infile_error(info, conn->error_info.error, sizeof(conn->error_info.error) TSRMLS_CC);
              goto infile_error;
       }

       result = PASS;

infile_error:
       /* get response from server and update upsert values */
       if (FAIL == conn->m->simple_command_handle_response(conn, PROT_OK_PACKET, FALSE, COM_QUERY, FALSE TSRMLS_CC)) {
              result = FAIL;
       }

       (*conn->infile.local_infile_end)(info TSRMLS_CC);
       if (buf) {
              mnd_efree(buf);
       }
       DBG_INF_FMT("%s", result == PASS? "PASS":"FAIL");
       DBG_RETURN(result);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void ps_fetch_from_1_to_8_bytes ( zval *  zv,
const MYSQLND_FIELD *const  field,
unsigned int  pack_len,
zend_uchar **  row,
zend_bool  as_unicode,
unsigned int byte_count  TSRMLS_DC 
)

Definition at line 56 of file mysqlnd_ps_codec.c.

{
       char tmp[22];
       size_t tmp_len = 0;
       zend_bool is_bit = field->type == MYSQL_TYPE_BIT;
       DBG_ENTER("ps_fetch_from_1_to_8_bytes");
       DBG_INF_FMT("zv=%p byte_count=%u", zv, byte_count);
       if (field->flags & UNSIGNED_FLAG) {
              uint64_t uval = 0;

              switch (byte_count) {
                     case 8:uval = is_bit? (uint64_t) bit_uint8korr(*row):(uint64_t) uint8korr(*row);break;
                     case 7:uval = bit_uint7korr(*row);break;
                     case 6:uval = bit_uint6korr(*row);break;
                     case 5:uval = bit_uint5korr(*row);break;
                     case 4:uval = is_bit? (uint64_t) bit_uint4korr(*row):(uint64_t) uint4korr(*row);break;
                     case 3:uval = is_bit? (uint64_t) bit_uint3korr(*row):(uint64_t) uint3korr(*row);break;
                     case 2:uval = is_bit? (uint64_t) bit_uint2korr(*row):(uint64_t) uint2korr(*row);break;
                     case 1:uval = (uint64_t) uint1korr(*row);break;
              }

#if SIZEOF_LONG==4
              if (uval > INT_MAX) {
                     DBG_INF("stringify");
                     tmp_len = sprintf((char *)&tmp, MYSQLND_LLU_SPEC, uval);
              } else 
#endif /* #if SIZEOF_LONG==4 */
              {
                     if (byte_count < 8 || uval <= L64(9223372036854775807)) {
                            ZVAL_LONG(zv, (long) uval); /* the cast is safe, we are in the range */
                     } else {
                            DBG_INF("stringify");
                            tmp_len = sprintf((char *)&tmp, MYSQLND_LLU_SPEC, uval);
                     }
              }
       } else {
              /* SIGNED */
              int64_t lval = 0;
              switch (byte_count) {
                     case 8:lval = (int64_t) sint8korr(*row);break;
                     /*
                       7, 6 and 5 are not possible.
                       BIT is only unsigned, thus only uint5|6|7 macroses exist
                     */
                     case 4:lval = (int64_t) sint4korr(*row);break;
                     case 3:lval = (int64_t) sint3korr(*row);break;
                     case 2:lval = (int64_t) sint2korr(*row);break;
                     case 1:lval = (int64_t) *(int8_t*)*row;break;
              }

#if SIZEOF_LONG==4
              if ((L64(2147483647) < (int64_t) lval) || (L64(-2147483648) > (int64_t) lval)) {
                     DBG_INF("stringify");
                     tmp_len = sprintf((char *)&tmp, MYSQLND_LL_SPEC, lval);
              } else
#endif /* SIZEOF */
              {
                     ZVAL_LONG(zv, (long) lval); /* the cast is safe, we are in the range */
              }
       }

       if (tmp_len) {
#if MYSQLND_UNICODE
              if (as_unicode) {
                     DBG_INF("stringify");
                     ZVAL_UTF8_STRINGL(zv, tmp, tmp_len, ZSTR_DUPLICATE);
              } else
#endif
              {
                     DBG_INF("stringify");
                     ZVAL_STRINGL(zv, tmp, tmp_len, 1);
              }
       }
       (*row)+= byte_count;
       DBG_VOID_RETURN;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

PHPAPI const char* const mysqlnd_old_passwd

Definition at line 57 of file mysqlnd.c.

PHPAPI const char* const mysqlnd_out_of_memory

Definition at line 64 of file mysqlnd.c.

PHPAPI const char* const mysqlnd_out_of_sync

Definition at line 63 of file mysqlnd.c.

PHPAPI const char* const mysqlnd_server_gone

Definition at line 62 of file mysqlnd.c.