sql_common.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Copyright (C) 2003-2004, 2006 MySQL AB
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; version 2 of the License.
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License
  10. along with this program; if not, write to the Free Software
  11. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
  12. extern const char *unknown_sqlstate;
  13. extern const char *cant_connect_sqlstate;
  14. extern const char *not_error_sqlstate;
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. extern CHARSET_INFO *default_client_charset_info;
  19. MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
  20. my_bool default_value, uint server_capabilities);
  21. void free_rows(MYSQL_DATA *cur);
  22. void free_old_query(MYSQL *mysql);
  23. void end_server(MYSQL *mysql);
  24. my_bool mysql_reconnect(MYSQL *mysql);
  25. void mysql_read_default_options(struct st_mysql_options *options,
  26. const char *filename,const char *group);
  27. my_bool
  28. cli_advanced_command(MYSQL *mysql, enum enum_server_command command,
  29. const unsigned char *header, ulong header_length,
  30. const unsigned char *arg, ulong arg_length,
  31. my_bool skip_check, MYSQL_STMT *stmt);
  32. unsigned long cli_safe_read(MYSQL *mysql);
  33. void net_clear_error(NET *net);
  34. void set_stmt_errmsg(MYSQL_STMT *stmt, NET *net);
  35. void set_stmt_error(MYSQL_STMT *stmt, int errcode, const char *sqlstate,
  36. const char *err);
  37. void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate);
  38. #ifdef __cplusplus
  39. }
  40. #endif
  41. #define protocol_41(A) ((A)->server_capabilities & CLIENT_PROTOCOL_41)