1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
|
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2010 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$ */
#ifndef MYSQLND_ENUM_N_DEF_H
#define MYSQLND_ENUM_N_DEF_H
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#define MYSQLND_MIN_COMPRESS_LEN 0
#define MYSQLND_MAX_PACKET_SIZE (256L*256L*256L-1)
#define MYSQLND_ERRMSG_SIZE 512
#define MYSQLND_SQLSTATE_LENGTH 5
#define MYSQLND_SQLSTATE_NULL "00000"
#define MYSQLND_NET_CMD_BUFFER_MIN_SIZE 4096
#define MYSQLND_NET_CMD_BUFFER_MIN_SIZE_STR "4096"
#define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */
#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */
#define SERVER_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */
#define SERVER_QUERY_NO_GOOD_INDEX_USED 16
#define SERVER_QUERY_NO_INDEX_USED 32
/*
The server was able to fulfill the clients request and opened a
read-only non-scrollable cursor for a query. This flag comes
in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands.
*/
#define SERVER_STATUS_CURSOR_EXISTS 64
/*
This flag is sent when a read-only cursor is exhausted, in reply to
COM_STMT_FETCH command.
*/
#define SERVER_STATUS_LAST_ROW_SENT 128
#define SERVER_STATUS_DB_DROPPED 256 /* A database was dropped */
#define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512
#define SERVER_QUERY_WAS_SLOW 1024
#define MYSQLND_NO_DATA 100
#define MYSQLND_DATA_TRUNCATED 101
#define SHA1_MAX_LENGTH 20
#define SCRAMBLE_LENGTH 20
#define SCRAMBLE_LENGTH_323 8
#define CLIENT_LONG_PASSWORD 1 /* new more secure passwords */
#define CLIENT_FOUND_ROWS 2 /* Found instead of affected rows */
#define CLIENT_LONG_FLAG 4 /* Get all column flags */
#define CLIENT_CONNECT_WITH_DB 8 /* One can specify db on connect */
#define CLIENT_NO_SCHEMA 16 /* Don't allow database.table.column */
#define CLIENT_COMPRESS 32 /* Can use compression protocol */
#define CLIENT_ODBC 64 /* Odbc client */
#define CLIENT_LOCAL_FILES 128 /* Can use LOAD DATA LOCAL */
#define CLIENT_IGNORE_SPACE 256 /* Ignore spaces before '(' */
#define CLIENT_PROTOCOL_41 512 /* New 4.1 protocol */
#define CLIENT_INTERACTIVE 1024 /* This is an interactive client */
#define CLIENT_SSL 2048 /* Switch to SSL after handshake */
#define CLIENT_IGNORE_SIGPIPE 4096 /* IGNORE sigpipes */
#define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions */
#define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */
#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */
#define CLIENT_MULTI_STATEMENTS (1UL << 16) /* Enable/disable multi-stmt support */
#define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results */
#define CLIENT_PS_MULTI_RESULTS (1UL << 18) /* Multi-results in PS-protocol */
#define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30)
typedef enum mysqlnd_extension
{
MYSQLND_MYSQL = 0,
MYSQLND_MYSQLI,
} enum_mysqlnd_extension;
enum
{
MYSQLND_FETCH_ASSOC = 1,
MYSQLND_FETCH_NUM = 2,
MYSQLND_FETCH_BOTH = 1|2,
};
/* Follow libmysql convention */
typedef enum func_status
{
PASS = 0,
FAIL = 1,
} enum_func_status;
typedef enum mysqlnd_query_type
{
QUERY_UPSERT,
QUERY_SELECT,
QUERY_LOAD_LOCAL
} enum_mysqlnd_query_type;
typedef enum mysqlnd_res_type
{
MYSQLND_RES_NORMAL = 1,
MYSQLND_RES_PS_BUF,
MYSQLND_RES_PS_UNBUF
} enum_mysqlnd_res_type;
typedef enum mysqlnd_option
{
MYSQL_OPT_CONNECT_TIMEOUT,
MYSQL_OPT_COMPRESS,
MYSQL_OPT_NAMED_PIPE,
MYSQL_INIT_COMMAND,
MYSQL_READ_DEFAULT_FILE,
MYSQL_READ_DEFAULT_GROUP,
MYSQL_SET_CHARSET_DIR,
MYSQL_SET_CHARSET_NAME,
MYSQL_OPT_LOCAL_INFILE,
MYSQL_OPT_PROTOCOL,
MYSQL_SHARED_MEMORY_BASE_NAME,
MYSQL_OPT_READ_TIMEOUT,
MYSQL_OPT_WRITE_TIMEOUT,
MYSQL_OPT_USE_RESULT,
MYSQL_OPT_USE_REMOTE_CONNECTION,
MYSQL_OPT_USE_EMBEDDED_CONNECTION,
MYSQL_OPT_GUESS_CONNECTION,
MYSQL_SET_CLIENT_IP,
MYSQL_SECURE_AUTH,
MYSQL_REPORT_DATA_TRUNCATION,
MYSQL_OPT_RECONNECT,
MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
#if PHP_MAJOR_VERSION >= 6
MYSQLND_OPT_NUMERIC_AND_DATETIME_AS_UNICODE = 200,
#endif
#ifdef MYSQLND_STRING_TO_INT_CONVERSION
MYSQLND_OPT_INT_AND_FLOAT_NATIVE = 201,
#endif
MYSQLND_OPT_NET_CMD_BUFFER_SIZE = 202,
MYSQLND_OPT_NET_READ_BUFFER_SIZE = 203,
MYSQLND_OPT_SSL_KEY = 204,
MYSQLND_OPT_SSL_CERT = 205,
MYSQLND_OPT_SSL_CA = 206,
MYSQLND_OPT_SSL_CAPATH = 207,
MYSQLND_OPT_SSL_CIPHER = 208,
MYSQLND_OPT_SSL_PASSPHRASE = 209
} enum_mysqlnd_option;
typedef enum mysqlnd_field_types
{
MYSQL_TYPE_DECIMAL,
MYSQL_TYPE_TINY,
MYSQL_TYPE_SHORT,
MYSQL_TYPE_LONG,
MYSQL_TYPE_FLOAT,
MYSQL_TYPE_DOUBLE,
MYSQL_TYPE_NULL,
MYSQL_TYPE_TIMESTAMP,
MYSQL_TYPE_LONGLONG,
MYSQL_TYPE_INT24,
MYSQL_TYPE_DATE,
MYSQL_TYPE_TIME,
MYSQL_TYPE_DATETIME,
MYSQL_TYPE_YEAR,
MYSQL_TYPE_NEWDATE,
MYSQL_TYPE_VARCHAR,
MYSQL_TYPE_BIT,
MYSQL_TYPE_NEWDECIMAL=246,
MYSQL_TYPE_ENUM=247,
MYSQL_TYPE_SET=248,
MYSQL_TYPE_TINY_BLOB=249,
MYSQL_TYPE_MEDIUM_BLOB=250,
MYSQL_TYPE_LONG_BLOB=251,
MYSQL_TYPE_BLOB=252,
MYSQL_TYPE_VAR_STRING=253,
MYSQL_TYPE_STRING=254,
MYSQL_TYPE_GEOMETRY=255
} enum_mysqlnd_field_types;
/* Please update this if there is a new type after MYSQL_TYPE_GEOMETRY */
#define MYSQL_TYPE_LAST MYSQL_TYPE_GEOMETRY
typedef enum mysqlnd_server_option
{
MYSQL_OPTION_MULTI_STATEMENTS_ON,
MYSQL_OPTION_MULTI_STATEMENTS_OFF
} enum_mysqlnd_server_option;
#define FIELD_TYPE_DECIMAL MYSQL_TYPE_DECIMAL
#define FIELD_TYPE_NEWDECIMAL MYSQL_TYPE_NEWDECIMAL
#define FIELD_TYPE_TINY MYSQL_TYPE_TINY
#define FIELD_TYPE_SHORT MYSQL_TYPE_SHORT
#define FIELD_TYPE_LONG MYSQL_TYPE_LONG
#define FIELD_TYPE_FLOAT MYSQL_TYPE_FLOAT
#define FIELD_TYPE_DOUBLE MYSQL_TYPE_DOUBLE
#define FIELD_TYPE_NULL MYSQL_TYPE_NULL
#define FIELD_TYPE_TIMESTAMP MYSQL_TYPE_TIMESTAMP
#define FIELD_TYPE_LONGLONG MYSQL_TYPE_LONGLONG
#define FIELD_TYPE_INT24 MYSQL_TYPE_INT24
#define FIELD_TYPE_DATE MYSQL_TYPE_DATE
#define FIELD_TYPE_TIME MYSQL_TYPE_TIME
#define FIELD_TYPE_DATETIME MYSQL_TYPE_DATETIME
#define FIELD_TYPE_YEAR MYSQL_TYPE_YEAR
#define FIELD_TYPE_NEWDATE MYSQL_TYPE_NEWDATE
#define FIELD_TYPE_ENUM MYSQL_TYPE_ENUM
#define FIELD_TYPE_SET MYSQL_TYPE_SET
#define FIELD_TYPE_TINY_BLOB MYSQL_TYPE_TINY_BLOB
#define FIELD_TYPE_MEDIUM_BLOB MYSQL_TYPE_MEDIUM_BLOB
#define FIELD_TYPE_LONG_BLOB MYSQL_TYPE_LONG_BLOB
#define FIELD_TYPE_BLOB MYSQL_TYPE_BLOB
#define FIELD_TYPE_VAR_STRING MYSQL_TYPE_VAR_STRING
#define FIELD_TYPE_STRING MYSQL_TYPE_STRING
#define FIELD_TYPE_CHAR MYSQL_TYPE_TINY
#define FIELD_TYPE_INTERVAL MYSQL_TYPE_ENUM
#define FIELD_TYPE_GEOMETRY MYSQL_TYPE_GEOMETRY
#define FIELD_TYPE_BIT MYSQL_TYPE_BIT
#define NOT_NULL_FLAG 1
#define PRI_KEY_FLAG 2
#define UNIQUE_KEY_FLAG 4
#define MULTIPLE_KEY_FLAG 8
#define BLOB_FLAG 16
#define UNSIGNED_FLAG 32
#define ZEROFILL_FLAG 64
#define BINARY_FLAG 128
#define ENUM_FLAG 256
#define AUTO_INCREMENT_FLAG 512
#define TIMESTAMP_FLAG 1024
#define SET_FLAG 2048
#define NO_DEFAULT_VALUE_FLAG 4096
#define ON_UPDATE_NOW_FLAG 8192
#define PART_KEY_FLAG 16384
#define GROUP_FLAG 32768
#define NUM_FLAG 32768
#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG)
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
#define IS_BLOB(n) ((n) & BLOB_FLAG)
#define IS_NUM(t) ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR || (t) == FIELD_TYPE_NEWDECIMAL)
/* see mysqlnd_charset.c for more information */
#define MYSQLND_BINARY_CHARSET_NR 63
/*
/-----> CONN_CLOSE <---------------\
| ^ \
| | \
CONN_READY -> CONN_QUERY_SENT -> CONN_FETCHING_DATA
^ |
\-------------------------------------/
*/
typedef enum mysqlnd_connection_state
{
CONN_ALLOCED = 0,
CONN_READY,
CONN_QUERY_SENT,
CONN_SENDING_LOAD_DATA,
CONN_FETCHING_DATA,
CONN_NEXT_RESULT_PENDING,
CONN_QUIT_SENT, /* object is "destroyed" at this stage */
} enum_mysqlnd_connection_state;
typedef enum mysqlnd_stmt_state
{
MYSQLND_STMT_INITTED = 0,
MYSQLND_STMT_PREPARED,
MYSQLND_STMT_EXECUTED,
MYSQLND_STMT_WAITING_USE_OR_STORE,
MYSQLND_STMT_USE_OR_STORE_CALLED,
MYSQLND_STMT_USER_FETCHING, /* fetch_row_buff or fetch_row_unbuf */
} enum_mysqlnd_stmt_state;
typedef enum param_bind_flags
{
MYSQLND_PARAM_BIND_BLOB_USED = 1
} enum_param_bind_flags;
/* PS */
enum mysqlnd_stmt_attr
{
STMT_ATTR_UPDATE_MAX_LENGTH,
STMT_ATTR_CURSOR_TYPE,
STMT_ATTR_PREFETCH_ROWS
};
enum myslqnd_cursor_type
{
CURSOR_TYPE_NO_CURSOR= 0,
CURSOR_TYPE_READ_ONLY= 1,
CURSOR_TYPE_FOR_UPDATE= 2,
CURSOR_TYPE_SCROLLABLE= 4
};
typedef enum mysqlnd_connection_close_type
{
MYSQLND_CLOSE_EXPLICIT = 0,
MYSQLND_CLOSE_IMPLICIT,
MYSQLND_CLOSE_DISCONNECTED,
MYSQLND_CLOSE_LAST /* for checking, should always be last */
} enum_connection_close_type;
typedef enum mysqlnd_collected_stats
{
STAT_BYTES_SENT,
STAT_BYTES_RECEIVED,
STAT_PACKETS_SENT,
STAT_PACKETS_RECEIVED,
STAT_PROTOCOL_OVERHEAD_IN,
STAT_PROTOCOL_OVERHEAD_OUT,
STAT_BYTES_RECEIVED_OK,
STAT_BYTES_RECEIVED_EOF,
STAT_BYTES_RECEIVED_RSET_HEADER,
STAT_BYTES_RECEIVED_RSET_FIELD_META,
STAT_BYTES_RECEIVED_RSET_ROW,
STAT_BYTES_RECEIVED_PREPARE_RESPONSE,
STAT_BYTES_RECEIVED_CHANGE_USER,
STAT_PACKETS_SENT_CMD,
STAT_PACKETS_RECEIVED_OK,
STAT_PACKETS_RECEIVED_EOF,
STAT_PACKETS_RECEIVED_RSET_HEADER,
STAT_PACKETS_RECEIVED_RSET_FIELD_META,
STAT_PACKETS_RECEIVED_RSET_ROW,
STAT_PACKETS_RECEIVED_PREPARE_RESPONSE,
STAT_PACKETS_RECEIVED_CHANGE_USER,
STAT_RSET_QUERY,
STAT_NON_RSET_QUERY,
STAT_NO_INDEX_USED,
STAT_BAD_INDEX_USED,
STAT_QUERY_WAS_SLOW,
STAT_BUFFERED_SETS,
STAT_UNBUFFERED_SETS,
STAT_PS_BUFFERED_SETS,
STAT_PS_UNBUFFERED_SETS,
STAT_FLUSHED_NORMAL_SETS,
STAT_FLUSHED_PS_SETS,
STAT_PS_PREPARED_NEVER_EXECUTED,
STAT_PS_PREPARED_ONCE_USED,
STAT_ROWS_FETCHED_FROM_SERVER_NORMAL,
STAT_ROWS_FETCHED_FROM_SERVER_PS,
STAT_ROWS_BUFFERED_FROM_CLIENT_NORMAL,
STAT_ROWS_BUFFERED_FROM_CLIENT_PS,
STAT_ROWS_FETCHED_FROM_CLIENT_NORMAL_BUF,
STAT_ROWS_FETCHED_FROM_CLIENT_NORMAL_UNBUF,
STAT_ROWS_FETCHED_FROM_CLIENT_PS_BUF,
STAT_ROWS_FETCHED_FROM_CLIENT_PS_UNBUF,
STAT_ROWS_FETCHED_FROM_CLIENT_PS_CURSOR,
STAT_ROWS_AFFECTED_NORMAL,
STAT_ROWS_AFFECTED_PS,
STAT_ROWS_SKIPPED_NORMAL,
STAT_ROWS_SKIPPED_PS,
STAT_COPY_ON_WRITE_SAVED,
STAT_COPY_ON_WRITE_PERFORMED,
STAT_CMD_BUFFER_TOO_SMALL,
STAT_CONNECT_SUCCESS,
STAT_CONNECT_FAILURE,
STAT_CONNECT_REUSED,
STAT_RECONNECT,
STAT_PCONNECT_SUCCESS,
STAT_OPENED_CONNECTIONS,
STAT_OPENED_PERSISTENT_CONNECTIONS,
STAT_CLOSE_EXPLICIT,
STAT_CLOSE_IMPLICIT,
STAT_CLOSE_DISCONNECT,
STAT_CLOSE_IN_MIDDLE,
STAT_FREE_RESULT_EXPLICIT,
STAT_FREE_RESULT_IMPLICIT,
STAT_STMT_CLOSE_EXPLICIT,
STAT_STMT_CLOSE_IMPLICIT,
STAT_MEM_EMALLOC_COUNT,
STAT_MEM_EMALLOC_AMOUNT,
STAT_MEM_ECALLOC_COUNT,
STAT_MEM_ECALLOC_AMOUNT,
STAT_MEM_EREALLOC_COUNT,
STAT_MEM_EREALLOC_AMOUNT,
STAT_MEM_EFREE_COUNT,
STAT_MEM_EFREE_AMOUNT,
STAT_MEM_MALLOC_COUNT,
STAT_MEM_MALLOC_AMOUNT,
STAT_MEM_CALLOC_COUNT,
STAT_MEM_CALLOC_AMOUNT,
STAT_MEM_REALLOC_COUNT,
STAT_MEM_REALLOC_AMOUNT,
STAT_MEM_FREE_COUNT,
STAT_MEM_FREE_AMOUNT,
STAT_MEM_ESTRNDUP_COUNT,
STAT_MEM_STRNDUP_COUNT,
STAT_MEM_ESTRDUP_COUNT,
STAT_MEM_STRDUP_COUNT,
STAT_TEXT_TYPE_FETCHED_NULL,
STAT_TEXT_TYPE_FETCHED_BIT,
STAT_TEXT_TYPE_FETCHED_INT8,
STAT_TEXT_TYPE_FETCHED_INT16,
STAT_TEXT_TYPE_FETCHED_INT24,
STAT_TEXT_TYPE_FETCHED_INT32,
STAT_TEXT_TYPE_FETCHED_INT64,
STAT_TEXT_TYPE_FETCHED_DECIMAL,
STAT_TEXT_TYPE_FETCHED_FLOAT,
STAT_TEXT_TYPE_FETCHED_DOUBLE,
STAT_TEXT_TYPE_FETCHED_DATE,
STAT_TEXT_TYPE_FETCHED_YEAR,
STAT_TEXT_TYPE_FETCHED_TIME,
STAT_TEXT_TYPE_FETCHED_DATETIME,
STAT_TEXT_TYPE_FETCHED_TIMESTAMP,
STAT_TEXT_TYPE_FETCHED_STRING,
STAT_TEXT_TYPE_FETCHED_BLOB,
STAT_TEXT_TYPE_FETCHED_ENUM,
STAT_TEXT_TYPE_FETCHED_SET,
STAT_TEXT_TYPE_FETCHED_GEOMETRY,
STAT_TEXT_TYPE_FETCHED_OTHER,
STAT_BINARY_TYPE_FETCHED_NULL,
STAT_BINARY_TYPE_FETCHED_BIT,
STAT_BINARY_TYPE_FETCHED_INT8,
STAT_BINARY_TYPE_FETCHED_INT16,
STAT_BINARY_TYPE_FETCHED_INT24,
STAT_BINARY_TYPE_FETCHED_INT32,
STAT_BINARY_TYPE_FETCHED_INT64,
STAT_BINARY_TYPE_FETCHED_DECIMAL,
STAT_BINARY_TYPE_FETCHED_FLOAT,
STAT_BINARY_TYPE_FETCHED_DOUBLE,
STAT_BINARY_TYPE_FETCHED_DATE,
STAT_BINARY_TYPE_FETCHED_YEAR,
STAT_BINARY_TYPE_FETCHED_TIME,
STAT_BINARY_TYPE_FETCHED_DATETIME,
STAT_BINARY_TYPE_FETCHED_TIMESTAMP,
STAT_BINARY_TYPE_FETCHED_STRING,
STAT_BINARY_TYPE_FETCHED_BLOB,
STAT_BINARY_TYPE_FETCHED_ENUM,
STAT_BINARY_TYPE_FETCHED_SET,
STAT_BINARY_TYPE_FETCHED_GEOMETRY,
STAT_BINARY_TYPE_FETCHED_OTHER,
STAT_INIT_COMMAND_EXECUTED_COUNT,
STAT_INIT_COMMAND_FAILED_COUNT,
STAT_COM_QUIT,
STAT_COM_INIT_DB,
STAT_COM_QUERY,
STAT_COM_FIELD_LIST,
STAT_COM_CREATE_DB,
STAT_COM_DROP_DB,
STAT_COM_REFRESH,
STAT_COM_SHUTDOWN,
STAT_COM_STATISTICS,
STAT_COM_PROCESS_INFO,
STAT_COM_CONNECT,
STAT_COM_PROCESS_KILL,
STAT_COM_DEBUG,
STAT_COM_PING,
STAT_COM_TIME,
STAT_COM_DELAYED_INSERT,
STAT_COM_CHANGE_USER,
STAT_COM_BINLOG_DUMP,
STAT_COM_TABLE_DUMP,
STAT_COM_CONNECT_OUT,
STAT_COM_REGISTER_SLAVE,
STAT_COM_STMT_PREPARE,
STAT_COM_STMT_EXECUTE,
STAT_COM_STMT_SEND_LONG_DATA,
STAT_COM_STMT_CLOSE,
STAT_COM_STMT_RESET,
STAT_COM_SET_OPTION,
STAT_COM_STMT_FETCH,
STAT_COM_DAEMON,
STAT_LAST /* Should be always the last */
} enum_mysqlnd_collected_stats;
/* Enums */
enum mysqlnd_packet_type
{
PROT_GREET_PACKET= 0,
PROT_AUTH_PACKET,
PROT_OK_PACKET,
PROT_EOF_PACKET,
PROT_CMD_PACKET,
PROT_RSET_HEADER_PACKET,
PROT_RSET_FLD_PACKET,
PROT_ROW_PACKET,
PROT_STATS_PACKET,
PROT_PREPARE_RESP_PACKET,
PROT_CHG_USER_RESP_PACKET,
PROT_LAST, /* should always be last */
};
enum php_mysqlnd_server_command
{
COM_SLEEP = 0,
COM_QUIT,
COM_INIT_DB,
COM_QUERY,
COM_FIELD_LIST,
COM_CREATE_DB,
COM_DROP_DB,
COM_REFRESH,
COM_SHUTDOWN,
COM_STATISTICS,
COM_PROCESS_INFO,
COM_CONNECT,
COM_PROCESS_KILL,
COM_DEBUG,
COM_PING,
COM_TIME = 15,
COM_DELAYED_INSERT,
COM_CHANGE_USER,
COM_BINLOG_DUMP,
COM_TABLE_DUMP,
COM_CONNECT_OUT = 20,
COM_REGISTER_SLAVE,
COM_STMT_PREPARE = 22,
COM_STMT_EXECUTE = 23,
COM_STMT_SEND_LONG_DATA = 24,
COM_STMT_CLOSE = 25,
COM_STMT_RESET = 26,
COM_SET_OPTION = 27,
COM_STMT_FETCH = 28,
COM_DAEMON,
COM_END
};
#define MYSQLND_DEFAULT_PREFETCH_ROWS (ulong) 1
#define MYSQLND_REFRESH_GRANT 1 /* Refresh grant tables */
#define MYSQLND_REFRESH_LOG 2 /* Start on new log file */
#define MYSQLND_REFRESH_TABLES 4 /* close all tables */
#define MYSQLND_REFRESH_HOSTS 8 /* Flush host cache */
#define MYSQLND_REFRESH_STATUS 16 /* Flush status variables */
#define MYSQLND_REFRESH_THREADS 32 /* Flush thread cache */
#define MYSQLND_REFRESH_SLAVE 64 /* Reset master info and restart slave */
#define MYSQLND_REFRESH_MASTER 128 /* Remove all bin logs in the index */
#define MYSQLND_REFRESH_BACKUP_LOG 0x200000L
#endif /* MYSQLND_ENUM_N_DEF_H */
/*
* 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
*/
|