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