MySQL  8.0.16
Source Code Documentation
mysql_com.h
Go to the documentation of this file.
1 /* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  Without limiting anything contained in the foregoing, this file,
15  which is part of C Driver for MySQL (Connector/C), is also subject to the
16  Universal FOSS Exception, version 1.0, a copy of which can be found at
17  http://oss.oracle.com/licenses/universal-foss-exception.
18 
19  This program is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  GNU General Public License, version 2.0, for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with this program; if not, write to the Free Software
26  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
27 
28 /**
29  @file include/mysql_com.h
30  Common definition between mysql server & client.
31 */
32 
33 #ifndef _mysql_com_h
34 #define _mysql_com_h
35 
36 #ifndef MYSQL_ABI_CHECK
37 #include <stdbool.h>
38 #endif
39 
40 #include "my_command.h"
41 
42 /*
43  We need a definition for my_socket. On the client, <mysql.h> already provides
44  it, but on the server side, we need to get it from a header.
45 */
46 #ifndef my_socket_defined
47 #include "my_io.h"
48 #endif
49 
50 #ifndef MYSQL_ABI_CHECK
51 #include <stdbool.h>
52 #endif
53 
54 #define HOSTNAME_LENGTH 60
55 #define SYSTEM_CHARSET_MBMAXLEN 3
56 #define FILENAME_CHARSET_MBMAXLEN 5
57 #define NAME_CHAR_LEN 64 /**< Field/table name length */
58 #define PARTITION_EXPR_CHAR_LEN \
59  2048 /**< Maximum expression length in chars \
60  */
61 #define USERNAME_CHAR_LENGTH 32
62 #define USERNAME_CHAR_LENGTH_STR "32"
63 #ifndef NAME_LEN
64 #define NAME_LEN (NAME_CHAR_LEN * SYSTEM_CHARSET_MBMAXLEN)
65 #endif
66 #define USERNAME_LENGTH (USERNAME_CHAR_LENGTH * SYSTEM_CHARSET_MBMAXLEN)
67 #define CONNECT_STRING_MAXLEN 1024
68 
69 #define MYSQL_AUTODETECT_CHARSET_NAME "auto"
70 
71 #define SERVER_VERSION_LENGTH 60
72 #define SQLSTATE_LENGTH 5
73 
74 /**
75  Maximum length of comments
76 
77  pre 5.6: 60 characters
78 */
79 #define TABLE_COMMENT_INLINE_MAXLEN 180
80 #define TABLE_COMMENT_MAXLEN 2048
81 #define COLUMN_COMMENT_MAXLEN 1024
82 #define INDEX_COMMENT_MAXLEN 1024
83 #define TABLE_PARTITION_COMMENT_MAXLEN 1024
84 #define TABLESPACE_COMMENT_MAXLEN 2048
85 
86 /**
87  Maximum length of protocol packet.
88  @ref page_protocol_basic_ok_packet length limit also restricted to this value
89  as any length greater than this value will have first byte of
90  @ref page_protocol_basic_ok_packet to be 254 thus does not
91  provide a means to identify if this is @ref page_protocol_basic_ok_packet or
92  @ref page_protocol_basic_eof_packet.
93 */
94 #define MAX_PACKET_LENGTH (256L * 256L * 256L - 1)
95 
96 /**
97  Length of string buffer, that is enough to contain
98  username and hostname parts of the user identifier with trailing zero in
99  MySQL standard format:
100  user_name_part\@host_name_part\\0
101 */
102 #define USER_HOST_BUFF_SIZE HOSTNAME_LENGTH + USERNAME_LENGTH + 2
104 #define LOCAL_HOST "localhost"
105 #define LOCAL_HOST_NAMEDPIPE "."
107 #if defined(_WIN32)
108 #define MYSQL_NAMEDPIPE "MySQL"
109 #define MYSQL_SERVICENAME "MySQL"
110 #endif /* _WIN32 */
111 
112 /** The length of the header part for each generated column in the .frm file.*/
113 #define FRM_GCOL_HEADER_SIZE 4
114 /**
115  Maximum length of the expression statement defined for generated columns.
116 */
117 #define GENERATED_COLUMN_EXPRESSION_MAXLEN 65535 - FRM_GCOL_HEADER_SIZE
118 /**
119  Length of random string sent by server on handshake; this is also length of
120  obfuscated password, received from client
121 */
122 #define SCRAMBLE_LENGTH 20
123 #define AUTH_PLUGIN_DATA_PART_1_LENGTH 8
124 /** length of password stored in the db: new passwords are preceeded with '*'*/
125 #define SCRAMBLED_PASSWORD_CHAR_LENGTH (SCRAMBLE_LENGTH * 2 + 1)
127 /**
128  @defgroup group_cs_column_definition_flags Column Definition Flags
129  @ingroup group_cs
130 
131  @brief Values for the flags bitmask used by ::Send_field:flags
132 
133  Currently need to fit into 32 bits.
134 
135  Each bit represents an optional feature of the protocol.
136 
137  Both the client and the server are sending these.
138 
139  The intersection of the two determines what optional parts of the
140  protocol will be used.
141 */
142 
143 /**
144  @addtogroup group_cs_column_definition_flags
145  @{
146 */
147 
148 #define NOT_NULL_FLAG 1 /**< Field can't be NULL */
149 #define PRI_KEY_FLAG 2 /**< Field is part of a primary key */
150 #define UNIQUE_KEY_FLAG 4 /**< Field is part of a unique key */
151 #define MULTIPLE_KEY_FLAG 8 /**< Field is part of a key */
152 #define BLOB_FLAG 16 /**< Field is a blob */
153 #define UNSIGNED_FLAG 32 /**< Field is unsigned */
154 #define ZEROFILL_FLAG 64 /**< Field is zerofill */
155 #define BINARY_FLAG 128 /**< Field is binary */
157 /* The following are only sent to new clients */
158 #define ENUM_FLAG 256 /**< field is an enum */
159 #define AUTO_INCREMENT_FLAG 512 /**< field is a autoincrement field */
160 #define TIMESTAMP_FLAG 1024 /**< Field is a timestamp */
161 #define SET_FLAG 2048 /**< field is a set */
162 #define NO_DEFAULT_VALUE_FLAG 4096 /**< Field doesn't have default value */
163 #define ON_UPDATE_NOW_FLAG 8192 /**< Field is set to NOW on UPDATE */
164 #define NUM_FLAG 32768 /**< Field is num (for clients) */
165 #define PART_KEY_FLAG 16384 /**< Intern; Part of some key */
166 #define GROUP_FLAG 32768 /**< Intern: Group field */
167 #define UNIQUE_FLAG 65536 /**< Intern: Used by sql_yacc */
168 #define BINCMP_FLAG 131072 /**< Intern: Used by sql_yacc */
169 #define GET_FIXED_FIELDS_FLAG \
170  (1 << 18) /**< Used to get fields in item tree \
171  */
172 #define FIELD_IN_PART_FUNC_FLAG (1 << 19) /**< Field part of partition func */
173 /**
174  Intern: Field in TABLE object for new version of altered table,
175  which participates in a newly added index.
176 */
177 #define FIELD_IN_ADD_INDEX (1 << 20)
178 #define FIELD_IS_RENAMED (1 << 21) /**< Intern: Field is being renamed */
179 #define FIELD_FLAGS_STORAGE_MEDIA 22 /**< Field storage media, bit 22-23 */
180 #define FIELD_FLAGS_STORAGE_MEDIA_MASK (3 << FIELD_FLAGS_STORAGE_MEDIA)
181 #define FIELD_FLAGS_COLUMN_FORMAT 24 /**< Field column format, bit 24-25 */
182 #define FIELD_FLAGS_COLUMN_FORMAT_MASK (3 << FIELD_FLAGS_COLUMN_FORMAT)
183 #define FIELD_IS_DROPPED (1 << 26) /**< Intern: Field is being dropped */
184 #define EXPLICIT_NULL_FLAG \
185  (1 << 27) /**< Field is explicitly specified as \
186  NULL by the user */
187 #define FIELD_IS_MARKED \
188  (1 << 28) /**< Intern: field is marked, \
189  general purpose */
191 /** Field will not be loaded in secondary engine. */
192 #define NOT_SECONDARY_FLAG (1 << 29)
193 
194 /** @}*/
195 
196 /**
197  @defgroup group_cs_com_refresh_flags COM_REFRESH Flags
198  @ingroup group_cs
199 
200  @brief Values for the `sub_command` in ::COM_REFRESH
201 
202  Currently the protocol carries only 8 bits of these flags.
203 
204  The rest (8-end) are used only internally in the server.
205 */
206 
207 /**
208  @addtogroup group_cs_com_refresh_flags
209  @{
210 */
211 
212 #define REFRESH_GRANT 1 /**< Refresh grant tables, FLUSH PRIVILEGES */
213 #define REFRESH_LOG 2 /**< Start on new log file, FLUSH LOGS */
214 #define REFRESH_TABLES 4 /**< close all tables, FLUSH TABLES */
215 #define REFRESH_HOSTS 8 /**< Flush host cache, FLUSH HOSTS */
216 #define REFRESH_STATUS 16 /**< Flush status variables, FLUSH STATUS */
217 #define REFRESH_THREADS 32 /**< Flush thread cache */
218 #define REFRESH_SLAVE \
219  64 /**< Reset master info and restart slave \
220  thread, RESET SLAVE */
221 #define REFRESH_MASTER \
222  128 /**< Remove all bin logs in the index \
223  and truncate the index, RESET MASTER */
224 #define REFRESH_ERROR_LOG 256 /**< Rotate only the erorr log */
225 #define REFRESH_ENGINE_LOG 512 /**< Flush all storage engine logs */
226 #define REFRESH_BINARY_LOG 1024 /**< Flush the binary log */
227 #define REFRESH_RELAY_LOG 2048 /**< Flush the relay log */
228 #define REFRESH_GENERAL_LOG 4096 /**< Flush the general log */
229 #define REFRESH_SLOW_LOG 8192 /**< Flush the slow query log */
230 #define REFRESH_READ_LOCK 16384 /**< Lock tables for read. */
231 /**
232  Wait for an impending flush before closing the tables.
234  @sa REFRESH_READ_LOCK, handle_reload_request, close_cached_tables
235 */
236 #define REFRESH_FAST 32768
237 #define REFRESH_USER_RESOURCES 0x80000L /** FLISH RESOUCES. @sa ::reset_mqh */
238 #define REFRESH_FOR_EXPORT 0x100000L /** FLUSH TABLES ... FOR EXPORT */
239 #define REFRESH_OPTIMIZER_COSTS 0x200000L /** FLUSH OPTIMIZER_COSTS */
240 #define REFRESH_PERSIST 0x400000L /** RESET PERSIST */
241 
242 /** @}*/
244 /**
245  @defgroup group_cs_capabilities_flags Capabilities Flags
246  @ingroup group_cs
247 
248  @brief Values for the capabilities flag bitmask used by the MySQL protocol
249 
250  Currently need to fit into 32 bits.
251 
252  Each bit represents an optional feature of the protocol.
253 
254  Both the client and the server are sending these.
255 
256  The intersection of the two determines whast optional parts of the
257  protocol will be used.
258 */
259 
260 /**
261  @addtogroup group_cs_capabilities_flags
262  @{
263 */
264 
265 /**
266  Use the improved version of Old Password Authentication.
267 
268  Not used.
269 
270  @note Assumed to be set since 4.1.1.
271 */
272 #define CLIENT_LONG_PASSWORD 1
273 /**
274  Send found rows instead of affected rows in @ref
275  page_protocol_basic_eof_packet
276 */
277 #define CLIENT_FOUND_ROWS 2
278 /**
279  @brief Get all column flags
280 
281  Longer flags in Protocol::ColumnDefinition320.
282 
283  @todo Reference Protocol::ColumnDefinition320
284 
285  Server
286  ------
287 
288  Supports longer flags.
289 
290  Client
291  ------
292 
293  Expects longer flags.
294 */
295 #define CLIENT_LONG_FLAG 4
296 /**
297  Database (schema) name can be specified on connect in Handshake Response
298  Packet.
299 
300  @todo Reference Handshake Response Packet.
302  Server
303  ------
304 
305  Supports schema-name in Handshake Response Packet.
306 
307  Client
308  ------
309 
310  Handshake Response Packet contains a schema-name.
311 
312  @sa send_client_reply_packet()
313 */
314 #define CLIENT_CONNECT_WITH_DB 8
315 #define CLIENT_NO_SCHEMA 16 /**< Don't allow database.table.column */
316 /**
317  Compression protocol supported.
318 
319  @todo Reference Compression
321  Server
322  ------
323 
324  Supports compression.
325 
326  Client
327  ------
328 
329  Switches to Compression compressed protocol after successful authentication.
330 */
331 #define CLIENT_COMPRESS 32
332 /**
333  Special handling of ODBC behavior.
334 
335  @note No special behavior since 3.22.
336 */
337 #define CLIENT_ODBC 64
338 /**
339  Can use LOAD DATA LOCAL.
340 
341  Server
342  ------
344  Enables the LOCAL INFILE request of LOAD DATA|XML.
345 
346  Client
347  ------
348 
349  Will handle LOCAL INFILE request.
350 */
351 #define CLIENT_LOCAL_FILES 128
352 /**
353  Ignore spaces before '('
354 
355  Server
356  ------
358  Parser can ignore spaces before '('.
359 
360  Client
361  ------
362 
363  Let the parser ignore spaces before '('.
364 */
365 #define CLIENT_IGNORE_SPACE 256
366 /**
367  New 4.1 protocol
368 
369  @todo Reference the new 4.1 protocol
370 
371  Server
372  ------
373 
374  Supports the 4.1 protocol.
375 
376  Client
377  ------
378 
379  Uses the 4.1 protocol.
380 
381  @note this value was CLIENT_CHANGE_USER in 3.22, unused in 4.0
382 */
383 #define CLIENT_PROTOCOL_41 512
384 /**
385  This is an interactive client
386 
387  Use @ref System_variables::net_wait_timeout
388  versus @ref System_variables::net_interactive_timeout.
390  Server
391  ------
392 
393  Supports interactive and noninteractive clients.
394 
395  Client
396  ------
397 
398  Client is interactive.
399 
400  @sa mysql_real_connect()
401 */
402 #define CLIENT_INTERACTIVE 1024
403 /**
404  Use SSL encryption for the session
405 
406  @todo Reference SSL
407 
408  Server
409  ------
410 
411  Supports SSL
412 
413  Client
414  ------
415 
416  Switch to SSL after sending the capability-flags.
417 */
418 #define CLIENT_SSL 2048
419 /**
420  Client only flag. Not used.
421 
422  Client
423  ------
425  Do not issue SIGPIPE if network failures occur (libmysqlclient only).
426 
427  @sa mysql_real_connect()
428 */
429 #define CLIENT_IGNORE_SIGPIPE 4096
430 /**
431  Client knows about transactions
432 
433  Server
434  ------
436  Can send status flags in @ref page_protocol_basic_ok_packet /
437  @ref page_protocol_basic_eof_packet.
438 
439  Client
440  ------
441 
442  Expects status flags in @ref page_protocol_basic_ok_packet /
443  @ref page_protocol_basic_eof_packet.
444 
445  @note This flag is optional in 3.23, but always set by the server since 4.0.
446  @sa send_server_handshake_packet(), parse_client_handshake_packet(),
447  net_send_ok(), net_send_eof()
448 */
449 #define CLIENT_TRANSACTIONS 8192
450 #define CLIENT_RESERVED 16384 /**< DEPRECATED: Old flag for 4.1 protocol */
451 #define CLIENT_RESERVED2 \
452  32768 /**< DEPRECATED: Old flag for 4.1 authentication \
453  CLIENT_SECURE_CONNECTION */
454 /**
455  Enable/disable multi-stmt support
457  Also sets @ref CLIENT_MULTI_RESULTS. Currently not checked anywhere.
458 
459  Server
460  ------
461 
462  Can handle multiple statements per COM_QUERY and COM_STMT_PREPARE.
463 
464  Client
465  -------
466 
467  May send multiple statements per COM_QUERY and COM_STMT_PREPARE.
468 
469  @note Was named ::CLIENT_MULTI_QUERIES in 4.1.0, renamed later.
470 
471  Requires
472  --------
473 
474  ::CLIENT_PROTOCOL_41
475 
476  @todo Reference COM_QUERY and COM_STMT_PREPARE
477 */
478 #define CLIENT_MULTI_STATEMENTS (1UL << 16)
479 /**
480  Enable/disable multi-results
481 
482  Server
483  ------
484 
485  Can send multiple resultsets for COM_QUERY.
486  Error if the server needs to send them and client
487  does not support them.
488 
489  Client
490  -------
491 
492  Can handle multiple resultsets for COM_QUERY.
493 
494  Requires
495  --------
496 
497  ::CLIENT_PROTOCOL_41
498 
499  @sa mysql_execute_command(), sp_head::MULTI_RESULTS
500 */
501 #define CLIENT_MULTI_RESULTS (1UL << 17)
502 /**
503  Multi-results and OUT parameters in PS-protocol.
504 
505  Server
506  ------
507 
508  Can send multiple resultsets for COM_STMT_EXECUTE.
509 
510  Client
511  ------
512 
513  Can handle multiple resultsets for COM_STMT_EXECUTE.
514 
515  Requires
516  --------
517 
518  ::CLIENT_PROTOCOL_41
519 
520  @todo Reference COM_STMT_EXECUTE and PS-protocol
521 
522  @sa Protocol_binary::send_out_parameters
523 */
524 #define CLIENT_PS_MULTI_RESULTS (1UL << 18)
525 
526 /**
527  Client supports plugin authentication
528 
529  Server
530  ------
532  Sends extra data in Initial Handshake Packet and supports the pluggable
533  authentication protocol.
534 
535  Client
536  ------
537 
538  Supports authentication plugins.
539 
540  Requires
541  --------
542 
543  ::CLIENT_PROTOCOL_41
544 
545  @todo Reference plugin authentication, Initial Handshake Packet,
546  Authentication plugins
547 
548  @sa send_change_user_packet(), send_client_reply_packet(), run_plugin_auth(),
549  parse_com_change_user_packet(), parse_client_handshake_packet()
550 */
551 #define CLIENT_PLUGIN_AUTH (1UL << 19)
552 /**
553  Client supports connection attributes
554 
555  Server
556  ------
557 
558  Permits connection attributes in Protocol::HandshakeResponse41.
559 
560  Client
561  ------
562 
563  Sends connection attributes in Protocol::HandshakeResponse41.
564 
565  @todo Reference Protocol::HandshakeResponse41
566 
567  @sa send_client_connect_attrs(), read_client_connect_attrs()
568 */
569 #define CLIENT_CONNECT_ATTRS (1UL << 20)
570 
571 /**
572  Enable authentication response packet to be larger than 255 bytes.
573 
574  When the ability to change default plugin require that the initial password
575  field in the Protocol::HandshakeResponse41 paclet can be of arbitrary size.
576  However, the 4.1 client-server protocol limits the length of the
577  auth-data-field sent from client to server to 255 bytes.
578  The solution is to change the type of the field to a true length encoded
579  string and indicate the protocol change
580  with this client capability flag.
581 
582  Server
583  ------
584 
585  Understands length-encoded integer for auth response data in
586  Protocol::HandshakeResponse41.
587 
588  Client
589  ------
590 
591  Length of auth response data in Protocol::HandshakeResponse41
592  is a length-encoded integer.
593 
594  @todo Reference Protocol::HandshakeResponse41
595 
596  @note The flag was introduced in 5.6.6, but had the wrong value.
597 
598  @sa send_client_reply_packet(), parse_client_handshake_packet(),
599  get_56_lenc_string(), get_41_lenc_string()
600 */
601 #define CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA (1UL << 21)
602 
603 /**
604  Don't close the connection for a user account with expired password.
605 
606  Server
607  ------
609  Announces support for expired password extension.
610 
611  Client
612  ------
613 
614  Can handle expired passwords.
615 
616  @todo Reference expired password
617 
618  @sa MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, disconnect_on_expired_password
619  ACL_USER::password_expired, check_password_lifetime(), acl_authenticate()
620 */
621 #define CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS (1UL << 22)
622 
623 /**
624  Capable of handling server state change information. Its a hint to the
625  server to include the state change information in
626  @ref page_protocol_basic_ok_packet.
627 
628  Server
629  ------
630  Can set ::SERVER_SESSION_STATE_CHANGED in the ::SERVER_STATUS_flags_enum
631  and send @ref sect_protocol_basic_ok_packet_sessinfo in a
632  @ref page_protocol_basic_ok_packet.
633 
634  Client
635  ------
636 
637  Expects the server to send @ref sect_protocol_basic_ok_packet_sessinfo in
638  a @ref page_protocol_basic_ok_packet.
639 
640  @sa enum_session_state_type, read_ok_ex(), net_send_ok(), Session_tracker,
641  State_tracker
642 */
643 #define CLIENT_SESSION_TRACK (1UL << 23)
644 /**
645  Client no longer needs @ref page_protocol_basic_eof_packet and will
646  use @ref page_protocol_basic_ok_packet instead.
647  @sa net_send_ok()
648 
649  Server
650  ------
651 
652  Can send OK after a Text Resultset.
653 
654  Client
655  ------
656 
657  Expects an @ref page_protocol_basic_ok_packet (instead of
658  @ref page_protocol_basic_eof_packet) after the resultset rows of a
659  Text Resultset.
660 
661  Background
662  ----------
663 
664  To support ::CLIENT_SESSION_TRACK, additional information must be sent after
665  all successful commands. Although the @ref page_protocol_basic_ok_packet is
666  extensible, the @ref page_protocol_basic_eof_packet is not due to the overlap
667  of its bytes with the content of the Text Resultset Row.
668 
669  Therefore, the @ref page_protocol_basic_eof_packet in the
670  Text Resultset is replaced with an @ref page_protocol_basic_ok_packet.
671  @ref page_protocol_basic_eof_packet is deprecated as of MySQL 5.7.5.
672 
673  @todo Reference Text Resultset
674 
675  @sa cli_safe_read_with_ok(), read_ok_ex(), net_send_ok(), net_send_eof()
676 */
677 #define CLIENT_DEPRECATE_EOF (1UL << 24)
678 
679 /**
680  Verify server certificate.
681 
682  Client only flag.
683 
684  @deprecated in favor of --ssl-mode.
685 */
686 #define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30)
687 
688 /**
689  The client can handle optional metadata information in the resultset.
690 */
691 #define CLIENT_OPTIONAL_RESULTSET_METADATA (1UL << 25)
692 
693 /**
694  Don't reset the options after an unsuccessful connect
695 
696  Client only flag.
697 
698  Typically passed via ::mysql_real_connect() 's client_flag parameter.
699 
700  @sa mysql_real_connect()
701 */
702 #define CLIENT_REMEMBER_OPTIONS (1UL << 31)
703 /** @}*/
704 
705 /** a compatibility alias for CLIENT_COMPRESS */
706 #define CAN_CLIENT_COMPRESS CLIENT_COMPRESS
707 
708 /** Gather all possible capabilites (flags) supported by the server */
709 #define CLIENT_ALL_FLAGS \
710  (CLIENT_LONG_PASSWORD | CLIENT_FOUND_ROWS | CLIENT_LONG_FLAG | \
711  CLIENT_CONNECT_WITH_DB | CLIENT_NO_SCHEMA | CLIENT_COMPRESS | CLIENT_ODBC | \
712  CLIENT_LOCAL_FILES | CLIENT_IGNORE_SPACE | CLIENT_PROTOCOL_41 | \
713  CLIENT_INTERACTIVE | CLIENT_SSL | CLIENT_IGNORE_SIGPIPE | \
714  CLIENT_TRANSACTIONS | CLIENT_RESERVED | CLIENT_RESERVED2 | \
715  CLIENT_MULTI_STATEMENTS | CLIENT_MULTI_RESULTS | CLIENT_PS_MULTI_RESULTS | \
716  CLIENT_SSL_VERIFY_SERVER_CERT | CLIENT_REMEMBER_OPTIONS | \
717  CLIENT_PLUGIN_AUTH | CLIENT_CONNECT_ATTRS | \
718  CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA | \
719  CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS | CLIENT_SESSION_TRACK | \
720  CLIENT_DEPRECATE_EOF | CLIENT_OPTIONAL_RESULTSET_METADATA)
721 
722 /**
723  Switch off from ::CLIENT_ALL_FLAGS the flags that are optional and
724  depending on build flags.
725  If any of the optional flags is supported by the build it will be switched
726  on before sending to the client during the connection handshake.
727 */
728 #define CLIENT_BASIC_FLAGS \
729  (((CLIENT_ALL_FLAGS & ~CLIENT_SSL) & ~CLIENT_COMPRESS) & \
730  ~CLIENT_SSL_VERIFY_SERVER_CERT)
731 
732 /** The status flags are a bit-field */
734  /**
735  Is raised when a multi-statement transaction
736  has been started, either explicitly, by means
737  of BEGIN or COMMIT AND CHAIN, or
738  implicitly, by the first transactional
739  statement, when autocommit=off.
740  */
742  SERVER_STATUS_AUTOCOMMIT = 2, /**< Server in auto_commit mode */
743  SERVER_MORE_RESULTS_EXISTS = 8, /**< Multi query - next query exists */
746  /**
747  The server was able to fulfill the clients request and opened a
748  read-only non-scrollable cursor for a query. This flag comes
749  in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands.
750  Used by Binary Protocol Resultset to signal that COM_STMT_FETCH
751  must be used to fetch the row-data.
752  @todo Refify "Binary Protocol Resultset" and "COM_STMT_FETCH".
753  */
755  /**
756  This flag is sent when a read-only cursor is exhausted, in reply to
757  COM_STMT_FETCH command.
758  */
760  SERVER_STATUS_DB_DROPPED = 256, /**< A database was dropped */
762  /**
763  Sent to the client if after a prepared statement reprepare
764  we discovered that the new statement returns a different
765  number of result set columns.
766  */
769  /**
770  To mark ResultSet containing output parameter values.
771  */
772  SERVER_PS_OUT_PARAMS = 4096,
773 
774  /**
775  Set at the same time as SERVER_STATUS_IN_TRANS if the started
776  multi-statement transaction is a read-only transaction. Cleared
777  when the transaction commits or aborts. Since this flag is sent
778  to clients in OK and EOF packets, the flag indicates the
779  transaction status at the end of command execution.
780  */
782 
783  /**
784  This status flag, when on, implies that one of the state information has
785  changed on the server because of the execution of the last statement.
786  */
787  SERVER_SESSION_STATE_CHANGED = (1UL << 14)
788 };
789 
790 /**
791  Server status flags that must be cleared when starting
792  execution of a new SQL statement.
793  Flags from this set are only added to the
794  current server status by the execution engine, but
795  never removed -- the execution engine expects them
796  to disappear automagically by the next command.
797 */
798 #define SERVER_STATUS_CLEAR_SET \
799  (SERVER_QUERY_NO_GOOD_INDEX_USED | SERVER_QUERY_NO_INDEX_USED | \
800  SERVER_MORE_RESULTS_EXISTS | SERVER_STATUS_METADATA_CHANGED | \
801  SERVER_QUERY_WAS_SLOW | SERVER_STATUS_DB_DROPPED | \
802  SERVER_STATUS_CURSOR_EXISTS | SERVER_STATUS_LAST_ROW_SENT | \
803  SERVER_SESSION_STATE_CHANGED)
804 
805 /** Max length of a error message. Should be kept in sync with ::ERRMSGSIZE. */
806 #define MYSQL_ERRMSG_SIZE 512
807 #define NET_READ_TIMEOUT 30 /**< Timeout on read */
808 #define NET_WRITE_TIMEOUT 60 /**< Timeout on write */
809 #define NET_WAIT_TIMEOUT 8 * 60 * 60 /**< Wait for new query */
810 
811 /**
812  Flag used by the parser. Kill only the query and not the connection.
814  @sa SQLCOM_KILL, sql_kill(), LEX::type
815 */
816 #define ONLY_KILL_QUERY 1
817 
818 #ifndef MYSQL_VIO
819 struct Vio;
820 #define MYSQL_VIO struct Vio *
821 #endif
822 
823 #define MAX_TINYINT_WIDTH 3 /**< Max width for a TINY w.o. sign */
824 #define MAX_SMALLINT_WIDTH 5 /**< Max width for a SHORT w.o. sign */
825 #define MAX_MEDIUMINT_WIDTH 8 /**< Max width for a INT24 w.o. sign */
826 #define MAX_INT_WIDTH 10 /**< Max width for a LONG w.o. sign */
827 #define MAX_BIGINT_WIDTH 20 /**< Max width for a LONGLONG */
828 #define MAX_CHAR_WIDTH 255 /**< Max length for a CHAR colum */
829 #define MAX_BLOB_WIDTH 16777216 /**< Default width for blob */
831 typedef struct NET {
833  unsigned char *buff, *buff_end, *write_pos, *read_pos;
834  my_socket fd; /* For Perl DBI/dbd */
835  /**
836  Set if we are doing several queries in one
837  command ( as in LOAD TABLE ... FROM MASTER ),
838  and do not want to confuse the client with OK at the wrong time
839  */
841  unsigned long max_packet, max_packet_size;
842  unsigned int pkt_nr, compress_pkt_nr;
843  unsigned int write_timeout, read_timeout, retry_count;
844  int fcntl;
845  unsigned int *return_status;
846  unsigned char reading_or_writing;
847  unsigned char save_char;
848  bool compress;
849  unsigned int last_errno;
850  unsigned char error;
851  /** Client library error message buffer. Actually belongs to struct MYSQL. */
853  /** Client library sqlstate buffer. Set along with the error message. */
855  /**
856  Extension pointer, for the caller private use.
857  Any program linking with the networking library can use this pointer,
858  which is handy when private connection specific data needs to be
859  maintained.
860  The mysqld server process uses this pointer internally,
861  to maintain the server internal instrumentation for the connection.
862  */
863  void *extension;
864 } NET;
865 
866 #define packet_error (~(unsigned long)0)
867 
868 /**
869  @addtogroup group_cs_backward_compatibility Backward compatibility
870  @ingroup group_cs
871  @{
872 */
873 #define CLIENT_MULTI_QUERIES CLIENT_MULTI_STATEMENTS
874 #define FIELD_TYPE_DECIMAL MYSQL_TYPE_DECIMAL
875 #define FIELD_TYPE_NEWDECIMAL MYSQL_TYPE_NEWDECIMAL
876 #define FIELD_TYPE_TINY MYSQL_TYPE_TINY
877 #define FIELD_TYPE_SHORT MYSQL_TYPE_SHORT
878 #define FIELD_TYPE_LONG MYSQL_TYPE_LONG
879 #define FIELD_TYPE_FLOAT MYSQL_TYPE_FLOAT
880 #define FIELD_TYPE_DOUBLE MYSQL_TYPE_DOUBLE
881 #define FIELD_TYPE_NULL MYSQL_TYPE_NULL
882 #define FIELD_TYPE_TIMESTAMP MYSQL_TYPE_TIMESTAMP
883 #define FIELD_TYPE_LONGLONG MYSQL_TYPE_LONGLONG
884 #define FIELD_TYPE_INT24 MYSQL_TYPE_INT24
885 #define FIELD_TYPE_DATE MYSQL_TYPE_DATE
886 #define FIELD_TYPE_TIME MYSQL_TYPE_TIME
887 #define FIELD_TYPE_DATETIME MYSQL_TYPE_DATETIME
888 #define FIELD_TYPE_YEAR MYSQL_TYPE_YEAR
889 #define FIELD_TYPE_NEWDATE MYSQL_TYPE_NEWDATE
890 #define FIELD_TYPE_ENUM MYSQL_TYPE_ENUM
891 #define FIELD_TYPE_SET MYSQL_TYPE_SET
892 #define FIELD_TYPE_TINY_BLOB MYSQL_TYPE_TINY_BLOB
893 #define FIELD_TYPE_MEDIUM_BLOB MYSQL_TYPE_MEDIUM_BLOB
894 #define FIELD_TYPE_LONG_BLOB MYSQL_TYPE_LONG_BLOB
895 #define FIELD_TYPE_BLOB MYSQL_TYPE_BLOB
896 #define FIELD_TYPE_VAR_STRING MYSQL_TYPE_VAR_STRING
897 #define FIELD_TYPE_STRING MYSQL_TYPE_STRING
898 #define FIELD_TYPE_CHAR MYSQL_TYPE_TINY
899 #define FIELD_TYPE_INTERVAL MYSQL_TYPE_ENUM
900 #define FIELD_TYPE_GEOMETRY MYSQL_TYPE_GEOMETRY
901 #define FIELD_TYPE_BIT MYSQL_TYPE_BIT
902 /** @}*/
904 /**
905  @addtogroup group_cs_shutdown_kill_constants Shutdown/kill enums and constants
906  @ingroup group_cs
908  @sa THD::is_killable
909  @{
910 */
911 #define MYSQL_SHUTDOWN_KILLABLE_CONNECT (unsigned char)(1 << 0)
912 #define MYSQL_SHUTDOWN_KILLABLE_TRANS (unsigned char)(1 << 1)
913 #define MYSQL_SHUTDOWN_KILLABLE_LOCK_TABLE (unsigned char)(1 << 2)
914 #define MYSQL_SHUTDOWN_KILLABLE_UPDATE (unsigned char)(1 << 3)
915 
916 /**
917  We want levels to be in growing order of hardness (because we use number
918  comparisons).
920  @note ::SHUTDOWN_DEFAULT does not respect the growing property, but it's ok.
921 */
923  SHUTDOWN_DEFAULT = 0,
924  /** Wait for existing connections to finish */
926  /** Wait for existing transactons to finish */
928  /** Wait for existing updates to finish (=> no partial MyISAM update) */
930  /** Flush InnoDB buffers and other storage engines' buffers*/
932  /** Don't flush InnoDB buffers, flush other storage engines' buffers*/
934  /** Query level of the KILL command */
935  KILL_QUERY = 254,
936  /** Connection level of the KILL command */
937  KILL_CONNECTION = 255
938 };
939 /** @}*/
942  /** No metadata will be sent. */
944  /** The server will send all metadata. */
946 };
947 
953 };
954 
955 /** options for ::mysql_options() */
959 };
960 
961 /**
962  Type of state change information that the server can include in the Ok
963  packet.
965  @note
966  - session_state_type shouldn't go past 255 (i.e. 1-byte boundary).
967  - Modify the definition of ::SESSION_TRACK_END when a new member is added.
968 */
970  SESSION_TRACK_SYSTEM_VARIABLES, /**< Session system variables */
971  SESSION_TRACK_SCHEMA, /**< Current schema */
972  SESSION_TRACK_STATE_CHANGE, /**< track session state changes */
973  SESSION_TRACK_GTIDS, /**< See also: session_track_gtids */
974  SESSION_TRACK_TRANSACTION_CHARACTERISTICS, /**< Transaction chistics */
975  SESSION_TRACK_TRANSACTION_STATE /**< Transaction state */
976 };
978 /** start of ::enum_session_state_type */
979 #define SESSION_TRACK_BEGIN SESSION_TRACK_SYSTEM_VARIABLES
981 /** End of ::enum_session_state_type */
982 #define SESSION_TRACK_END SESSION_TRACK_TRANSACTION_STATE
983 
984 /** is T a valid session state type */
985 #define IS_SESSION_STATE_TYPE(T) \
986  (((int)(T) >= SESSION_TRACK_BEGIN) && ((T) <= SESSION_TRACK_END))
987 
988 #define net_new_transaction(net) ((net)->pkt_nr = 0)
990 bool my_net_init(struct NET *net, MYSQL_VIO vio);
991 void my_net_local_init(struct NET *net);
992 void net_end(struct NET *net);
993 void net_clear(struct NET *net, bool check_buffer);
994 void net_claim_memory_ownership(struct NET *net);
995 bool net_realloc(struct NET *net, size_t length);
996 bool net_flush(struct NET *net);
997 bool my_net_write(struct NET *net, const unsigned char *packet, size_t len);
998 bool net_write_command(struct NET *net, unsigned char command,
999  const unsigned char *header, size_t head_len,
1000  const unsigned char *packet, size_t len);
1001 bool net_write_packet(struct NET *net, const unsigned char *packet,
1002  size_t length);
1003 unsigned long my_net_read(struct NET *net);
1004 void my_net_set_write_timeout(struct NET *net, unsigned int timeout);
1005 void my_net_set_read_timeout(struct NET *net, unsigned int timeout);
1006 void my_net_set_retry_count(struct NET *net, unsigned int retry_count);
1007 
1008 struct rand_struct {
1009  unsigned long seed1, seed2, max_value;
1010  double max_value_dbl;
1011 };
1012 
1013 /* Include the types here so existing UDFs can keep compiling */
1016 /**
1017  @addtogroup group_cs_compresson_constants Constants when using compression
1018  @ingroup group_cs
1019  @{
1020 */
1021 #define NET_HEADER_SIZE 4 /**< standard header size */
1022 #define COMP_HEADER_SIZE 3 /**< compression header extra size */
1023 /** @}*/
1024 
1025 /* Prototypes to password functions */
1026 
1027 /*
1028  These functions are used for authentication by client and server and
1029  implemented in sql/password.c
1030 */
1031 
1032 void randominit(struct rand_struct *, unsigned long seed1, unsigned long seed2);
1033 double my_rnd(struct rand_struct *);
1034 void create_random_string(char *to, unsigned int length,
1035  struct rand_struct *rand_st);
1036 
1037 void hash_password(unsigned long *to, const char *password,
1038  unsigned int password_len);
1039 void make_scrambled_password_323(char *to, const char *password);
1040 void scramble_323(char *to, const char *message, const char *password);
1041 bool check_scramble_323(const unsigned char *reply, const char *message,
1042  unsigned long *salt);
1043 void get_salt_from_password_323(unsigned long *res, const char *password);
1044 void make_password_from_salt_323(char *to, const unsigned long *salt);
1045 
1046 void make_scrambled_password(char *to, const char *password);
1047 void scramble(char *to, const char *message, const char *password);
1048 bool check_scramble(const unsigned char *reply, const char *message,
1049  const unsigned char *hash_stage2);
1050 void get_salt_from_password(unsigned char *res, const char *password);
1051 void make_password_from_salt(char *to, const unsigned char *hash_stage2);
1052 char *octet2hex(char *to, const char *str, unsigned int len);
1053 
1054 /* end of password.c */
1055 
1056 bool generate_sha256_scramble(unsigned char *dst, size_t dst_size,
1057  const char *src, size_t src_size, const char *rnd,
1058  size_t rnd_size);
1059 
1060 // extern "C" since it is an (undocumented) part of the libmysql ABI.
1061 #ifdef __cplusplus
1062 extern "C" {
1063 #endif
1064 char *get_tty_password(const char *opt_message);
1065 #ifdef __cplusplus
1066 }
1067 #endif
1068 
1069 const char *mysql_errno_to_sqlstate(unsigned int mysql_errno);
1070 
1071 /* Some other useful functions */
1072 
1073 // Need to be extern "C" for the time being, due to memcached.
1074 #ifdef __cplusplus
1075 extern "C" {
1076 #endif
1077 bool my_thread_init(void);
1078 void my_thread_end(void);
1079 #ifdef __cplusplus
1080 }
1081 #endif
1082 
1083 #ifdef STDCALL
1084 unsigned long STDCALL net_field_length(unsigned char **packet);
1085 unsigned long STDCALL net_field_length_checked(unsigned char **packet,
1086  unsigned long max_length);
1087 #endif
1088 unsigned long long net_field_length_ll(unsigned char **packet);
1089 unsigned char *net_store_length(unsigned char *pkg, unsigned long long length);
1090 unsigned int net_length_size(unsigned long long num);
1091 unsigned int net_field_length_size(const unsigned char *pos);
1092 
1093 #define NULL_LENGTH ((unsigned long)~0) /**< For ::net_store_length() */
1094 #define MYSQL_STMT_HEADER 4
1095 #define MYSQL_LONG_DATA_HEADER 6
1096 
1097 #define NOT_FIXED_DEC 31
1098 #endif
Definition: mysql_com.h:930
unsigned char error
Definition: mysql_com.h:857
char sqlstate[SQLSTATE_LENGTH+1]
Client library sqlstate buffer.
Definition: mysql_com.h:861
Connection level of the KILL command.
Definition: mysql_com.h:944
unsigned int read_timeout
Definition: mysql_com.h:850
unsigned int write_timeout
Definition: mysql_com.h:850
unsigned int pkt_nr
Definition: mysql_com.h:849
SERVER_STATUS_flags_enum
The status flags are a bit-field.
Definition: mysql_com.h:740
void make_scrambled_password_323(char *to, const char *password)
t pos
Definition: dbug_analyze.cc:148
bool generate_sha256_scramble(unsigned char *dst, size_t dst_size, const char *src, size_t src_size, const char *rnd, size_t rnd_size)
Definition: sha2_password_common.cc:387
unsigned long my_net_read(struct NET *net)
Read a packet from the client/server and return it without the internal package header.
Definition: net_serv.cc:1648
Definition: mysql_com.h:956
The server was able to fulfill the clients request and opened a read-only non-scrollable cursor for a...
Definition: mysql_com.h:761
void * extension
Extension pointer, for the caller private use.
Definition: mysql_com.h:870
Flush InnoDB buffers and other storage engines&#39; buffers.
Definition: mysql_com.h:938
Definition: mysql_com.h:1015
#define MYSQL_SHUTDOWN_KILLABLE_TRANS
Definition: mysql_com.h:919
Definition: mysql_com.h:957
Multi query - next query exists.
Definition: mysql_com.h:750
enum_cursor_type
Definition: mysql_com.h:955
mysql_enum_shutdown_level
We want levels to be in growing order of hardness (because we use number comparisons).
Definition: mysql_com.h:929
struct NET NET
unsigned long seed2
Definition: mysql_com.h:1016
unsigned int net_field_length_size(const unsigned char *pos)
length of buffer required to represent a length-encoded string give the length part of length encoded...
Definition: pack.cc:177
void make_password_from_salt_323(char *to, const unsigned long *salt)
bool net_write_command(struct NET *net, unsigned char command, const unsigned char *header, size_t head_len, const unsigned char *packet, size_t len)
Send a command to the server.
Definition: net_serv.cc:742
Session system variables.
Definition: mysql_com.h:977
bool check_scramble_323(const unsigned char *reply, const char *message, unsigned long *salt)
#define STDCALL
Definition: my_compiler.h:147
void my_net_set_retry_count(struct NET *net, unsigned int retry_count)
Definition: net_serv.cc:1790
void scramble_323(char *to, const char *message, const char *password)
enum_resultset_metadata
Definition: mysql_com.h:948
unsigned char reading_or_writing
Definition: mysql_com.h:853
To mark ResultSet containing output parameter values.
Definition: mysql_com.h:779
Is raised when a multi-statement transaction has been started, either explicitly, by means of BEGIN o...
Definition: mysql_com.h:748
bool compress
Definition: mysql_com.h:855
unsigned int * return_status
Definition: mysql_com.h:852
#define rnd(X)
Definition: mi_test3.cc:42
Transaction chistics.
Definition: mysql_com.h:981
double max_value_dbl
Definition: mysql_com.h:1017
unsigned long buf_length
Definition: mysql_com.h:847
#define SQLSTATE_LENGTH
Definition: mysql_com.h:73
unsigned int net_length_size(unsigned long long num)
Definition: mysql_com.h:751
my_socket fd
Definition: mysql_com.h:841
Server in auto_commit mode.
Definition: mysql_com.h:749
bool net_realloc(struct NET *net, size_t length)
Realloc the packet buffer.
Definition: net_serv.cc:170
const char * mysql_errno_to_sqlstate(unsigned int mysql_errno)
Definition: sql_state.cc:42
unsigned int compress_pkt_nr
Definition: mysql_com.h:849
bool my_net_init(struct NET *net, MYSQL_VIO vio)
Wait for existing updates to finish (=> no partial MyISAM update)
Definition: mysql_com.h:936
See also: session_track_gtids.
Definition: mysql_com.h:980
void my_net_local_init(struct NET *net)
Definition: sql_client.cc:38
Set at the same time as SERVER_STATUS_IN_TRANS if the started multi-statement transaction is a read-o...
Definition: mysql_com.h:788
void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st)
ulong STDCALL net_field_length(uchar **packet)
Definition: pack.cc:37
ulong STDCALL net_field_length_checked(uchar **packet, ulong max_length)
Definition: pack.cc:60
bool my_net_write(struct NET *net, const unsigned char *packet, size_t len)
Write a logical packet with packet header.
Definition: net_serv.cc:391
double my_rnd(struct rand_struct *)
Generate random number.
Definition: my_rnd.cc:52
Current schema.
Definition: mysql_com.h:978
char last_error[MYSQL_ERRMSG_SIZE]
Client library error message buffer.
Definition: mysql_com.h:859
Wait for existing connections to finish.
Definition: mysql_com.h:932
#define MYSQL_SHUTDOWN_KILLABLE_UPDATE
Definition: mysql_com.h:921
unsigned char * write_pos
Definition: mysql_com.h:840
unsigned long where_b
Definition: mysql_com.h:847
unsigned char * net_store_length(unsigned char *pkg, unsigned long long length)
char * get_tty_password(const char *opt_message)
Definition: get_password.cc:216
unsigned int STDCALL mysql_errno(MYSQL *mysql)
Definition: client.cc:7901
unsigned int len
Definition: dbug_analyze.cc:216
void my_net_set_read_timeout(struct NET *net, unsigned int timeout)
Definition: net_serv.cc:1774
Definition: mysql_com.h:958
#define MYSQL_ERRMSG_SIZE
Max length of a error message.
Definition: mysql_com.h:813
#define MYSQL_SHUTDOWN_KILLABLE_CONNECT
Definition: mysql_com.h:918
bool net_write_packet(struct NET *net, const unsigned char *packet, size_t length)
Write a MySQL protocol packet to the network handler.
Definition: net_serv.cc:1146
bool check_scramble(const unsigned char *reply, const char *message, const unsigned char *hash_stage2)
Definition: password.cc:319
unsigned long max_packet_size
Definition: mysql_com.h:848
void make_scrambled_password(char *to, const char *password)
Definition: password.cc:250
unsigned int last_errno
Definition: mysql_com.h:856
unsigned long length
Definition: mysql_com.h:847
Definition: violite.h:332
bool my_thread_init(void)
Allocate thread specific memory for the thread, used by mysys and dbug.
Definition: my_thr_init.cc:268
Don&#39;t flush InnoDB buffers, flush other storage engines&#39; buffers.
Definition: mysql_com.h:940
unsigned long seed1
Definition: mysql_com.h:1016
int my_socket
Definition: my_io_bits.h:59
bool net_flush(struct NET *net)
Flush write_buffer if not empty.
Definition: net_serv.cc:239
void get_salt_from_password_323(unsigned long *res, const char *password)
The server will send all metadata.
Definition: mysql_com.h:952
A database was dropped.
Definition: mysql_com.h:767
void scramble(char *to, const char *message, const char *password)
Produce an obscure octet sequence from password and random string, received from the server...
Definition: password.cc:270
void make_password_from_salt(char *to, const unsigned char *hash_stage2)
Convert scrambled password from binary form to asciiz hex string.
Definition: password.cc:345
unsigned char * buff
Definition: mysql_com.h:840
Definition: mysql_com.h:965
unsigned int retry_count
Definition: mysql_com.h:850
void randominit(struct rand_struct *, unsigned long seed1, unsigned long seed2)
Definition: password.cc:81
Definition: mysql_com.h:768
void my_thread_end(void)
Deallocate memory used by the thread for book-keeping.
Definition: my_thr_init.cc:303
command
Definition: version_token.cc:278
Transaction state.
Definition: mysql_com.h:982
Definition: mysql_com.h:752
unsigned long long net_field_length_ll(unsigned char **packet)
Definition: pack.cc:89
Definition: mysql_com.h:964
unsigned char save_char
Definition: mysql_com.h:854
enum_session_state_type
Type of state change information that the server can include in the Ok packet.
Definition: mysql_com.h:976
unsigned long max_value
Definition: mysql_com.h:1016
void net_claim_memory_ownership(struct NET *net)
Definition: net_serv.cc:166
This flag is sent when a read-only cursor is exhausted, in reply to COM_STMT_FETCH command...
Definition: mysql_com.h:766
MYSQL_VIO vio
Definition: mysql_com.h:839
#define MYSQL_VIO
Definition: mysql_com.h:827
Definition: mysql_com.h:775
Common #defines and includes for file and socket I/O.
No metadata will be sent.
Definition: mysql_com.h:950
unsigned char * buff_end
Definition: mysql_com.h:840
int fcntl
Definition: mysql_com.h:851
unsigned long remain_in_buf
Set if we are doing several queries in one command ( as in LOAD TABLE ...
Definition: mysql_com.h:847
static char * password
Definition: mysql_secure_installation.cc:55
Definition: mysql_com.h:959
void get_salt_from_password(unsigned char *res, const char *password)
Definition: password.cc:334
Query level of the KILL command.
Definition: mysql_com.h:942
track session state changes
Definition: mysql_com.h:979
void my_net_set_write_timeout(struct NET *net, unsigned int timeout)
Definition: net_serv.cc:1782
Wait for existing transactons to finish.
Definition: mysql_com.h:934
void net_clear(struct NET *net, bool check_buffer)
Clear (reinitialize) the NET structure for a new command.
Definition: net_serv.cc:224
unsigned char * read_pos
Definition: mysql_com.h:840
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:75
This status flag, when on, implies that one of the state information has changed on the server becaus...
Definition: mysql_com.h:794
Definition: mysql_com.h:838
unsigned long max_packet
Definition: mysql_com.h:848
Sent to the client if after a prepared statement reprepare we discovered that the new statement retur...
Definition: mysql_com.h:774
enum_mysql_set_option
options for mysql_options()
Definition: mysql_com.h:963
void hash_password(unsigned long *to, const char *password, unsigned int password_len)
Definition: password.cc:99
void net_end(struct NET *net)
Definition: net_serv.cc:159
char * octet2hex(char *to, const char *str, unsigned int len)
Definition: password.cc:138