The world's most popular open source database
#include <sys/types.h>#include "mysql_com.h"#include "mysql_time.h"#include "mysql_version.h"#include "typelib.h"#include "my_list.h"#include "my_alloc.h"Include dependency graph for mysql.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
| #define ER_WARN_DATA_TRUNCATED WARN_DATA_TRUNCATED |
Definition at line 75 of file mysql.h.
Referenced by append_metadata(), my_print_result_metadata(), and print_table_data().
| #define IS_NUM | ( | t | ) | ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR || (t) == FIELD_TYPE_NEWDECIMAL) |
Definition at line 77 of file mysql.h.
Referenced by my_process_result_set(), my_process_stmt_result(), and print_table_data().
| #define MANAGER_OK 200 |
| #define max_allowed_packet (*mysql_get_parameters()->p_max_allowed_packet) |
Definition at line 357 of file mysql.h.
Referenced by get_options(), my_net_local_init(), and Log_event::read_log_event().
| #define MAX_MYSQL_MANAGER_MSG 256 |
| #define MYSQL_COUNT_ERROR (~(my_ulonglong) 0) |
| #define MYSQL_DATA_TRUNCATED 101 |
Definition at line 827 of file mysql.h.
Referenced by mysql_stmt_fetch(), stmt_fetch_row(), test_bind_date_conv(), test_buffers(), test_bug3035(), test_long_data_str1(), test_truncation(), and test_truncation_option().
| #define MYSQL_NO_DATA 100 |
Definition at line 826 of file mysql.h.
Referenced by append_stmt_result(), bind_fetch(), fetch_n(), my_process_stmt_result(), mysql_stmt_fetch(), stmt_read_row_buffered(), stmt_read_row_from_cursor(), stmt_read_row_no_data(), stmt_read_row_unbuffered(), test_bind_date_conv(), test_bind_result(), test_bind_result_ext(), test_bind_result_ext1(), test_bug10729(), test_bug10736(), test_bug10794(), test_bug11037(), test_bug11172(), test_bug11656(), test_bug14210(), test_bug14845(), test_bug3035(), test_bug3796(), test_bug4079(), test_bug4231(), test_bug6096(), test_bug9478(), test_bug9520(), test_conversion(), test_decimal_bug(), test_fetch_column(), test_fetch_date(), test_fetch_nobuffs(), test_fetch_null(), test_fetch_offset(), test_fetch_seek(), test_field_misc(), test_frm_bug(), test_logs(), test_mem_overun(), test_multi_stmt(), test_nstmts(), test_null(), test_prepare(), test_ps_i18n(), test_ps_null_param(), test_rewind(), test_set_variable(), test_sqlmode(), test_sshort_bug(), test_stiny_bug(), test_store_result(), test_store_result1(), test_store_result2(), test_subselect(), and test_ushort_bug().
| #define net_buffer_length (*mysql_get_parameters()->p_net_buffer_length) |
| #define simple_command | ( | mysql, | |||
| command, | |||||
| arg, | |||||
| length, | |||||
| skip_check | ) |
Value:
Definition at line 845 of file mysql.h.
Referenced by dump_remote_log_entries(), mysql_change_user(), mysql_close(), mysql_dump_debug_info(), mysql_kill(), mysql_list_fields(), mysql_list_processes(), mysql_master_send_query(), mysql_ping(), mysql_refresh(), mysql_select_db(), mysql_send_query(), mysql_set_server_option(), mysql_shutdown(), mysql_slave_send_query(), mysql_stat(), and test_bug6081().
| #define stmt_command | ( | mysql, | |||
| command, | |||||
| arg, | |||||
| length, | |||||
| stmt | ) |
Value:
Definition at line 848 of file mysql.h.
Referenced by mysql_stmt_close(), and mysql_stmt_prepare().
| typedef struct embedded_query_result EMBEDDED_QUERY_RESULT |
| typedef struct character_set MY_CHARSET_INFO |
| typedef unsigned long long my_ulonglong |
| typedef struct st_mysql_bind MYSQL_BIND |
| typedef struct st_mysql_data MYSQL_DATA |
| typedef struct st_mysql_field MYSQL_FIELD |
| typedef unsigned int MYSQL_FIELD_OFFSET |
| typedef struct st_mysql_manager MYSQL_MANAGER |
| typedef struct st_mysql_methods MYSQL_METHODS |
| typedef struct st_mysql_parameters MYSQL_PARAMETERS |
| typedef struct st_mysql_res MYSQL_RES |
| typedef MYSQL_ROWS* MYSQL_ROW_OFFSET |
| typedef struct st_mysql_rows MYSQL_ROWS |
| typedef struct st_mysql_stmt MYSQL_STMT |
| MYSQL_STMT_INIT_DONE | |
| MYSQL_STMT_PREPARE_DONE | |
| MYSQL_STMT_EXECUTE_DONE | |
| MYSQL_STMT_FETCH_DONE |
Definition at line 579 of file mysql.h.
00580 { 00581 MYSQL_STMT_INIT_DONE= 1, MYSQL_STMT_PREPARE_DONE, MYSQL_STMT_EXECUTE_DONE, 00582 MYSQL_STMT_FETCH_DONE 00583 };
| enum enum_stmt_attr_type |
Definition at line 723 of file mysql.h.
00724 { 00725 /* 00726 When doing mysql_stmt_store_result calculate max_length attribute 00727 of statement metadata. This is to be consistent with the old API, 00728 where this was done automatically. 00729 In the new API we do that only by request because it slows down 00730 mysql_stmt_store_result sufficiently. 00731 */ 00732 STMT_ATTR_UPDATE_MAX_LENGTH, 00733 /* 00734 unsigned long with combination of cursor flags (read only, for update, 00735 etc) 00736 */ 00737 STMT_ATTR_CURSOR_TYPE, 00738 /* 00739 Amount of rows to retrieve from server per one fetch if using cursors. 00740 Accepts unsigned long attribute in the range 1 - ulong_max 00741 */ 00742 STMT_ATTR_PREFETCH_ROWS 00743 };
| enum mysql_option |
Definition at line 143 of file mysql.h.
00144 { 00145 MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE, 00146 MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP, 00147 MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE, 00148 MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT, 00149 MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT, 00150 MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION, 00151 MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH, 00152 MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT, 00153 MYSQL_OPT_SSL_VERIFY_SERVER_CERT 00154 };
| enum mysql_protocol_type |
| MYSQL_PROTOCOL_DEFAULT | |
| MYSQL_PROTOCOL_TCP | |
| MYSQL_PROTOCOL_SOCKET | |
| MYSQL_PROTOCOL_PIPE | |
| MYSQL_PROTOCOL_MEMORY |
Definition at line 211 of file mysql.h.
00212 { 00213 MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET, 00214 MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY 00215 };
| enum mysql_rpl_type |
Definition at line 221 of file mysql.h.
00222 { 00223 MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN 00224 };
| enum mysql_status |
Definition at line 206 of file mysql.h.
00207 { 00208 MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,MYSQL_STATUS_USE_RESULT 00209 };
| void STDCALL myodbc_remove_escape | ( | MYSQL * | mysql, | |
| char * | name | |||
| ) |
Definition at line 1656 of file libmysql.c.
References st_mysql::charset, LINT_INIT, my_ismbchar, mysql, use_mb, and USE_MB.
01657 { 01658 char *to; 01659 #ifdef USE_MB 01660 my_bool use_mb_flag=use_mb(mysql->charset); 01661 char *end; 01662 LINT_INIT(end); 01663 if (use_mb_flag) 01664 for (end=name; *end ; end++) ; 01665 #endif 01666 01667 for (to=name ; *name ; name++) 01668 { 01669 #ifdef USE_MB 01670 int l; 01671 if (use_mb_flag && (l = my_ismbchar( mysql->charset, name , end ) ) ) 01672 { 01673 while (l--) 01674 *to++ = *name++; 01675 name--; 01676 continue; 01677 } 01678 #endif 01679 if (*name == '\\' && name[1]) 01680 name++; 01681 *to++= *name; 01682 } 01683 *to=0; 01684 }
| int STDCALL mysql_add_slave | ( | MYSQL * | mysql, | |
| const char * | host, | |||
| unsigned int | port, | |||
| const char * | user, | |||
| const char * | passwd | |||
| ) |
Definition at line 1095 of file libmysql.c.
References mysql, st_mysql::next_slave, and spawn_init().
01099 { 01100 MYSQL* slave; 01101 if (!(slave = spawn_init(mysql, host, port, user, passwd))) 01102 return 1; 01103 slave->next_slave = mysql->next_slave; 01104 mysql->next_slave = slave; 01105 return 0; 01106 }
Here is the call graph for this function:

| my_ulonglong STDCALL mysql_affected_rows | ( | MYSQL * | mysql | ) |
Definition at line 1440 of file libmysql.c.
References st_mysql::affected_rows, st_mysql::last_used_con, and mysql.
Referenced by com_go(), list_dbs(), run_query_normal(), run_query_stmt(), test_bug2247(), test_multi_statements(), test_prepare_grant(), and verify_affected_rows().
01441 { 01442 return mysql->last_used_con->affected_rows; 01443 }
Here is the caller graph for this function:

Definition at line 5109 of file libmysql.c.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, mysql, and mysql_real_query().
Referenced by client_connect(), test_bug10760(), test_bug12243(), test_decimal_bug(), test_double_compare(), test_explain_bug(), test_frm_bug(), test_func_fields(), test_insert(), test_long_data(), test_long_data_bin(), test_long_data_str(), test_long_data_str1(), test_manual_sample(), test_nstmts(), test_prepare(), test_prepare_grant(), test_prepare_resultset(), test_select(), test_select_direct(), test_select_prepare(), test_select_show(), test_set_option(), test_set_variable(), test_simple_delete(), test_simple_update(), test_stmt_close(), test_tran_bdb(), test_tran_innodb(), and test_update().
05110 { 05111 DBUG_ENTER("mysql_autocommit"); 05112 DBUG_PRINT("enter", ("mode : %d", auto_mode)); 05113 05114 DBUG_RETURN((my_bool) mysql_real_query(mysql, auto_mode ? 05115 "set autocommit=1":"set autocommit=0", 05116 16)); 05117 }
Here is the call graph for this function:

Here is the caller graph for this function:

| my_bool STDCALL mysql_change_user | ( | MYSQL * | mysql, | |
| const char * | user, | |||
| const char * | passwd, | |||
| const char * | db | |||
| ) |
Definition at line 670 of file libmysql.c.
References CLIENT_SECURE_CONNECTION, COM_CHANGE_USER, st_mysql::db, DBUG_ENTER, DBUG_RETURN, st_mysql::methods, MY_ALLOW_ZERO_PTR, my_free, my_strdup(), MY_WME, MYF, mysql, mysql_detach_stmt_list(), st_mysql::passwd, st_mysql_methods::read_change_user_result, scramble(), st_mysql::scramble, scramble_323(), SCRAMBLE_LENGTH, SCRAMBLE_LENGTH_323, st_mysql::server_capabilities, simple_command, st_mysql::stmts, strmov(), and st_mysql::user.
Referenced by change_user(), and test_bug5315().
00672 { 00673 char buff[512],*end=buff; 00674 int rc; 00675 DBUG_ENTER("mysql_change_user"); 00676 00677 if (!user) 00678 user=""; 00679 if (!passwd) 00680 passwd=""; 00681 00682 /* Store user into the buffer */ 00683 end=strmov(end,user)+1; 00684 00685 /* write scrambled password according to server capabilities */ 00686 if (passwd[0]) 00687 { 00688 if (mysql->server_capabilities & CLIENT_SECURE_CONNECTION) 00689 { 00690 *end++= SCRAMBLE_LENGTH; 00691 scramble(end, mysql->scramble, passwd); 00692 end+= SCRAMBLE_LENGTH; 00693 } 00694 else 00695 { 00696 scramble_323(end, mysql->scramble, passwd); 00697 end+= SCRAMBLE_LENGTH_323 + 1; 00698 } 00699 } 00700 else 00701 *end++= '\0'; /* empty password */ 00702 /* Add database if needed */ 00703 end= strmov(end, db ? db : "") + 1; 00704 00705 /* Write authentication package */ 00706 simple_command(mysql,COM_CHANGE_USER, buff,(ulong) (end-buff),1); 00707 00708 rc= (*mysql->methods->read_change_user_result)(mysql, buff, passwd); 00709 00710 /* 00711 The server will close all statements no matter was the attempt 00712 to change user successful or not. 00713 */ 00714 mysql_detach_stmt_list(&mysql->stmts); 00715 if (rc == 0) 00716 { 00717 /* Free old connect information */ 00718 my_free(mysql->user,MYF(MY_ALLOW_ZERO_PTR)); 00719 my_free(mysql->passwd,MYF(MY_ALLOW_ZERO_PTR)); 00720 my_free(mysql->db,MYF(MY_ALLOW_ZERO_PTR)); 00721 00722 /* alloc new connect information */ 00723 mysql->user= my_strdup(user,MYF(MY_WME)); 00724 mysql->passwd=my_strdup(passwd,MYF(MY_WME)); 00725 mysql->db= db ? my_strdup(db,MYF(MY_WME)) : 0; 00726 } 00727 DBUG_RETURN(rc); 00728 }
Here is the call graph for this function:

Here is the caller graph for this function:

| const char* STDCALL mysql_character_set_name | ( | MYSQL * | mysql | ) |
Definition at line 1470 of file libmysql.c.
References st_mysql::charset, charset_info_st::csname, and mysql.
Referenced by test_client_character_set().
Here is the caller graph for this function:

| void STDCALL mysql_close | ( | MYSQL * | sock | ) |
Definition at line 2544 of file client.c.
References COM_QUIT, DBUG_ENTER, DBUG_VOID_RETURN, end_server(), st_mysql_methods::free_embedded_thd, st_mysql::free_me, free_old_query(), st_mysql::master, st_mysql::methods, my_free, MYF, mysql, mysql_close(), mysql_close_free(), mysql_close_free_options(), mysql_detach_stmt_list(), MYSQL_STATUS_READY, st_mysql::net, st_mysql::next_slave, NullS, st_mysql::reconnect, st_mysql::rpl_pivot, simple_command, st_mysql::status, st_mysql::stmts, st_mysql::thd, and st_net::vio.
Referenced by check_master_version(), client_connect(), client_disconnect(), close_cons(), db_disconnect(), dbDisconnect(), dump_remote_log_entries(), execute_commands(), handle_sigint(), Instance::is_running(), main(), mysql_close(), mysql_end(), mysql_reconnect(), mysql_set_master(), mysql_sigint(), run_task(), safe_connect(), safe_exit(), sql_real_connect(), test_bug12001(), test_bug12744(), test_bug15752(), test_bug8378(), test_bug9992(), test_multi_statements(), test_opt_reconnect(), test_prepare_grant(), test_prepare_multi_statements(), test_stmt_close(), and thread_query().
02545 { 02546 DBUG_ENTER("mysql_close"); 02547 if (mysql) /* Some simple safety */ 02548 { 02549 /* If connection is still up, send a QUIT message */ 02550 if (mysql->net.vio != 0) 02551 { 02552 free_old_query(mysql); 02553 mysql->status=MYSQL_STATUS_READY; /* Force command */ 02554 mysql->reconnect=0; 02555 simple_command(mysql,COM_QUIT,NullS,0,1); 02556 end_server(mysql); /* Sets mysql->net.vio= 0 */ 02557 } 02558 mysql_close_free_options(mysql); 02559 mysql_close_free(mysql); 02560 mysql_detach_stmt_list(&mysql->stmts); 02561 #ifndef TO_BE_DELETED 02562 /* free/close slave list */ 02563 if (mysql->rpl_pivot) 02564 { 02565 MYSQL* tmp; 02566 for (tmp = mysql->next_slave; tmp != mysql; ) 02567 { 02568 /* trick to avoid following freed pointer */ 02569 MYSQL* tmp1 = tmp->next_slave; 02570 mysql_close(tmp); 02571 tmp = tmp1; 02572 } 02573 mysql->rpl_pivot=0; 02574 } 02575 #endif 02576 if (mysql != mysql->master) 02577 mysql_close(mysql->master); 02578 #ifndef MYSQL_SERVER 02579 if (mysql->thd) 02580 (*mysql->methods->free_embedded_thd)(mysql); 02581 #endif 02582 if (mysql->free_me) 02583 my_free((gptr) mysql,MYF(0)); 02584 } 02585 DBUG_VOID_RETURN; 02586 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 5088 of file libmysql.c.
References DBUG_ENTER, DBUG_RETURN, mysql, and mysql_real_query().
Referenced by bind_fetch(), test_bind_date_conv(), test_bind_result(), test_bind_result_ext(), test_bind_result_ext1(), test_bug11904(), test_bug12243(), test_bug1500(), test_double_compare(), test_fetch_date(), test_fetch_null(), test_insert(), test_long_data(), test_long_data_bin(), test_long_data_str(), test_long_data_str1(), test_null(), test_prepare(), test_prepare_insert_update(), test_prepare_noparam(), test_prepare_simple(), test_prepare_syntax(), test_select(), test_select_direct(), test_select_prepare(), test_set_variable(), test_simple_delete(), test_simple_update(), test_store_result(), test_store_result1(), test_store_result2(), test_subselect(), test_tran_bdb(), test_tran_innodb(), test_update(), and thread_query().
05089 { 05090 DBUG_ENTER("mysql_commit"); 05091 DBUG_RETURN((my_bool) mysql_real_query(mysql, "commit", 6)); 05092 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void STDCALL mysql_data_seek | ( | MYSQL_RES * | result, | |
| my_ulonglong | offset | |||
| ) |
Definition at line 1126 of file libmysql.c.
References st_mysql_res::current_row, st_mysql_res::data, st_mysql_data::data, st_mysql_res::data_cursor, DBUG_PRINT, and st_mysql_rows::next.
Referenced by build_completion_hash(), get_table_structure(), getTableName(), primary_key_fields(), process_all_tables_in_db(), test_bug1644(), and test_frm_bug().
01127 { 01128 MYSQL_ROWS *tmp=0; 01129 DBUG_PRINT("info",("mysql_data_seek(%ld)",(long) row)); 01130 if (result->data) 01131 for (tmp=result->data->data; row-- && tmp ; tmp = tmp->next) ; 01132 result->current_row=0; 01133 result->data_cursor = tmp; 01134 }
Here is the caller graph for this function:

| void STDCALL mysql_debug | ( | const char * | debug | ) |
Referenced by mysql_read_default_options(), and mysql_server_init().
Here is the caller graph for this function:

| void STDCALL mysql_disable_reads_from_master | ( | MYSQL * | mysql | ) |
Definition at line 389 of file libmysql.c.
References mysql, st_mysql_options::no_master_reads, and st_mysql::options.
00390 { 00391 mysql->options.no_master_reads = 1; 00392 }
| void STDCALL mysql_disable_rpl_parse | ( | MYSQL * | mysql | ) |
Definition at line 372 of file libmysql.c.
References mysql, st_mysql::options, and st_mysql_options::rpl_parse.
| int STDCALL mysql_dump_debug_info | ( | MYSQL * | mysql | ) |
Definition at line 1334 of file libmysql.c.
References COM_DEBUG, DBUG_ENTER, DBUG_RETURN, mysql, and simple_command.
Referenced by execute_commands().
01335 { 01336 DBUG_ENTER("mysql_dump_debug_info"); 01337 DBUG_RETURN(simple_command(mysql,COM_DEBUG,0,0,0)); 01338 }
Here is the caller graph for this function:

| my_bool STDCALL mysql_embedded | ( | void | ) |
Definition at line 1501 of file libmysql.c.
01502 { 01503 #ifdef EMBEDDED_LIBRARY 01504 return 1; 01505 #else 01506 return 0; 01507 #endif 01508 }
| void STDCALL mysql_enable_reads_from_master | ( | MYSQL * | mysql | ) |
Definition at line 384 of file libmysql.c.
References mysql, st_mysql_options::no_master_reads, and st_mysql::options.
00385 { 00386 mysql->options.no_master_reads = 0; 00387 }
| void STDCALL mysql_enable_rpl_parse | ( | MYSQL * | mysql | ) |
Definition at line 367 of file libmysql.c.
References mysql, st_mysql::options, and st_mysql_options::rpl_parse.
Definition at line 1408 of file libmysql.c.
References st_mysql_res::eof.
Referenced by com_go().
01409 { 01410 return res->eof; 01411 }
Here is the caller graph for this function:

| unsigned int STDCALL mysql_errno | ( | MYSQL * | mysql | ) |
Definition at line 2973 of file client.c.
References st_net::last_errno, mysql, and st_mysql::net.
Referenced by check_if_ignore_table(), com_use(), connect_n_handle_errors(), create_table(), db_error(), DB_error(), db_error_with_table(), DBerror(), do_connect(), do_save_master_pos(), do_sync_with_master2(), dump_table(), execute_commands(), get_table_structure(), list_table_status(), main(), my_process_result_set(), mysql_query_with_error_report(), mysql_real_query_for_lazy(), print_error(), put_error(), run_query(), run_query_normal(), run_task(), sql_connect(), sql_real_connect(), test_bug15752(), test_bug7990(), test_bug9992(), test_multi_statements(), test_prepare_grant(), util_query(), and var_query_set().
02974 { 02975 return mysql->net.last_errno; 02976 }
Here is the caller graph for this function:

| const char* STDCALL mysql_error | ( | MYSQL * | mysql | ) |
Definition at line 2979 of file client.c.
References st_net::last_error, mysql, and st_mysql::net.
Referenced by append_warnings(), build_completion_hash(), change_user(), check_if_ignore_table(), check_master_version(), com_status(), connect_n_handle_errors(), create_schema(), db_error(), DB_error(), db_error_with_table(), DBerror(), do_connect(), do_rpl_probe(), do_save_master_pos(), do_sync_with_master2(), do_wait_for_slave_to_stop(), drop_db(), drop_schema(), dump_all_databases(), dump_remote_log_entries(), dump_table(), execute_commands(), fix_object_name(), get_pidfile(), get_table_structure(), Instance::is_running(), list_dbs(), list_fields(), list_table_status(), list_tables(), main(), mysql_query_with_error_report(), mysql_store_result_for_lazy(), primary_key_fields(), print_error(), process_all_databases(), put_error(), run_query(), run_query_normal(), run_task(), safe_connect(), safe_query(), sql_connect(), test_bug10760(), test_bug15752(), test_bug9478(), test_bug9992(), test_manual_sample(), test_multi_statements(), test_parse_error_and_bad_length(), test_prepare_multi_statements(), thread_query(), util_query(), and var_query_set().
02980 { 02981 return mysql->net.last_error; 02982 }
Here is the caller graph for this function:

| unsigned long STDCALL mysql_escape_string | ( | char * | to, | |
| const char * | from, | |||
| unsigned long | from_length | |||
| ) |
Definition at line 1569 of file libmysql.c.
References default_charset_info, and escape_string_for_mysql().
01570 { 01571 return escape_string_for_mysql(default_charset_info, to, 0, from, length); 01572 }
Here is the call graph for this function:

| MYSQL_FIELD* STDCALL mysql_fetch_field | ( | MYSQL_RES * | result | ) |
Definition at line 1113 of file libmysql.c.
References st_mysql_res::current_field, st_mysql_res::field_count, st_mysql_res::fields, and NULL.
Referenced by build_completion_hash(), dump_table(), list_dbs(), list_tables(), main(), my_print_dashes(), my_print_result_metadata(), my_process_result_set(), my_process_stmt_result(), print_field_types(), print_header(), print_relative_row(), print_res_header(), print_res_row(), print_res_top(), print_row(), print_tab_data(), print_table_data(), print_table_data_html(), print_table_data_vertically(), print_top(), print_value(), print_xml_row(), store_values(), test_field_flags(), test_func_fields(), and test_long_data_str1().
01114 { 01115 if (result->current_field >= result->field_count) 01116 return(NULL); 01117 return &result->fields[result->current_field++]; 01118 }
Here is the caller graph for this function:

| MYSQL_FIELD* STDCALL mysql_fetch_field_direct | ( | MYSQL_RES * | res, | |
| unsigned int | fieldnr | |||
| ) |
Definition at line 1413 of file libmysql.c.
Referenced by do_verify_prepare_field(), get_table_structure(), and get_view_structure().
Here is the caller graph for this function:

| MYSQL_FIELD* STDCALL mysql_fetch_fields | ( | MYSQL_RES * | res | ) |
Definition at line 1418 of file libmysql.c.
Referenced by append_result(), com_server_help(), print_table_data_xml(), run_query_normal(), run_query_stmt(), test_bug14169(), test_bug15613(), test_bug6096(), test_long_data_str1(), and var_query_set().
Here is the caller graph for this function:

| unsigned long* STDCALL mysql_fetch_lengths | ( | MYSQL_RES * | result | ) |
Definition at line 2861 of file client.c.
References st_mysql_res::current_row, st_mysql_res::data, st_mysql_methods::fetch_lengths, st_mysql_res::field_count, st_mysql_res::lengths, and st_mysql_res::methods.
Referenced by append_result(), dump_table(), get_actual_table_name(), get_table_structure(), get_view_structure(), print_tab_data(), print_table_data(), print_table_data_html(), print_table_data_xml(), print_xml_row(), and var_query_set().
02862 { 02863 MYSQL_ROW column; 02864 02865 if (!(column=res->current_row)) 02866 return 0; /* Something is wrong */ 02867 if (res->data) 02868 (*res->methods->fetch_lengths)(res->lengths, column, res->field_count); 02869 return res->lengths; 02870 }
Here is the caller graph for this function:

Definition at line 2806 of file client.c.
References CR_COMMANDS_OUT_OF_SYNC, CR_FETCH_CANCELED, st_mysql_res::current_row, st_mysql_res::data, st_mysql_rows::data, st_mysql_res::data_cursor, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, st_mysql_res::eof, st_mysql_res::field_count, st_mysql_res::handle, st_mysql_res::lengths, mysql, MYSQL_STATUS_READY, MYSQL_STATUS_USE_RESULT, st_mysql_rows::next, read_one_row(), st_mysql_res::row, st_mysql_res::row_count, set_mysql_error(), st_mysql::status, st_mysql_res::unbuffered_fetch_cancelled, st_mysql::unbuffered_fetch_owner, and unknown_sqlstate.
Referenced by append_result(), build_completion_hash(), check_have_innodb(), check_if_ignore_table(), check_master_version(), com_server_help(), com_status(), do_save_master_pos(), do_show_master_status(), do_sync_with_master2(), do_wait_for_slave_to_stop(), dump_all_databases(), dump_all_tablespaces(), dump_events_for_db(), dump_routines_for_db(), dump_table(), dump_triggers_for_table(), execute_commands(), get_actual_table_name(), get_current_db(), get_pidfile(), get_slaves_from_master(), get_table_structure(), get_view_structure(), getTableName(), init_dumping(), init_username(), list_dbs(), list_fields(), list_table_status(), list_tables(), main(), my_process_result_set(), mysql_rpl_probe(), primary_key_fields(), print_result(), print_tab_data(), print_table_data(), print_table_data_html(), print_table_data_vertically(), print_table_data_xml(), print_warnings(), process_all_databases(), process_all_tables_in_db(), run_task(), store_values(), test_bug1644(), test_bug4172(), test_bug6049(), test_bug6058(), test_frm_bug(), test_tran_bdb(), test_tran_innodb(), var_query_set(), and verify_col_data().
02807 { 02808 DBUG_ENTER("mysql_fetch_row"); 02809 if (!res->data) 02810 { /* Unbufferred fetch */ 02811 if (!res->eof) 02812 { 02813 MYSQL *mysql= res->handle; 02814 if (mysql->status != MYSQL_STATUS_USE_RESULT) 02815 { 02816 set_mysql_error(mysql, 02817 res->unbuffered_fetch_cancelled ? 02818 CR_FETCH_CANCELED : CR_COMMANDS_OUT_OF_SYNC, 02819 unknown_sqlstate); 02820 } 02821 else if (!(read_one_row(mysql, res->field_count, res->row, res->lengths))) 02822 { 02823 res->row_count++; 02824 DBUG_RETURN(res->current_row=res->row); 02825 } 02826 DBUG_PRINT("info",("end of data")); 02827 res->eof=1; 02828 mysql->status=MYSQL_STATUS_READY; 02829 /* 02830 Reset only if owner points to us: there is a chance that somebody 02831 started new query after mysql_stmt_close(): 02832 */ 02833 if (mysql->unbuffered_fetch_owner == &res->unbuffered_fetch_cancelled) 02834 mysql->unbuffered_fetch_owner= 0; 02835 /* Don't clear handle in mysql_free_result */ 02836 res->handle=0; 02837 } 02838 DBUG_RETURN((MYSQL_ROW) NULL); 02839 } 02840 { 02841 MYSQL_ROW tmp; 02842 if (!res->data_cursor) 02843 { 02844 DBUG_PRINT("info",("end of data")); 02845 DBUG_RETURN(res->current_row=(MYSQL_ROW) NULL); 02846 } 02847 tmp = res->data_cursor->data; 02848 res->data_cursor = res->data_cursor->next; 02849 DBUG_RETURN(res->current_row=tmp); 02850 } 02851 }
Here is the call graph for this function:

Here is the caller graph for this function:

| unsigned int STDCALL mysql_field_count | ( | MYSQL * | mysql | ) |
Definition at line 1435 of file libmysql.c.
References st_mysql::field_count, st_mysql::last_used_con, and mysql.
Referenced by com_go(), run_query_normal(), run_task(), and test_bug12001().
01436 { 01437 return mysql->last_used_con->field_count; 01438 }
Here is the caller graph for this function:

| MYSQL_FIELD_OFFSET STDCALL mysql_field_seek | ( | MYSQL_RES * | result, | |
| MYSQL_FIELD_OFFSET | offset | |||
| ) |
Definition at line 1154 of file libmysql.c.
References st_mysql_res::current_field.
Referenced by dump_table(), my_print_dashes(), my_print_result_metadata(), my_process_result_set(), my_process_stmt_result(), print_header(), print_relative_row(), print_res_header(), print_res_row(), print_res_top(), print_row(), print_table_data(), print_table_data_html(), print_table_data_vertically(), print_table_data_xml(), print_top(), print_value(), print_xml_row(), test_field_flags(), and test_long_data_str1().
01155 { 01156 MYSQL_FIELD_OFFSET return_value=result->current_field; 01157 result->current_field=field_offset; 01158 return return_value; 01159 }
Here is the caller graph for this function:

| MYSQL_FIELD_OFFSET STDCALL mysql_field_tell | ( | MYSQL_RES * | res | ) |
| void STDCALL mysql_free_result | ( | MYSQL_RES * | result | ) |
Definition at line 865 of file client.c.
References st_mysql_res::data, DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, st_mysql_res::field_alloc, st_mysql_res::fields, st_mysql_methods::flush_use_result, free_root(), free_rows(), st_mysql_res::handle, st_mysql::methods, my_free, MYF, mysql, MYSQL_STATUS_READY, MYSQL_STATUS_USE_RESULT, st_mysql_res::row, st_mysql::status, TRUE, st_mysql_res::unbuffered_fetch_cancelled, and st_mysql::unbuffered_fetch_owner.
Referenced by append_warnings(), build_completion_hash(), check_have_innodb(), check_if_ignore_table(), check_master_version(), CLI_MYSQL_REAL_CONNECT(), client_store_result(), client_use_result(), com_go(), com_server_help(), com_status(), do_save_master_pos(), do_show_master_status(), do_sync_with_master2(), do_wait_for_slave_to_stop(), dump_events_for_db(), dump_result(), dump_routines_for_db(), dump_table(), dump_triggers_for_table(), execute_commands(), get_actual_table_name(), get_current_db(), get_pidfile(), get_slaves_from_master(), get_table_structure(), get_view_structure(), getTableName(), list_dbs(), list_fields(), list_table_status(), list_tables(), main(), my_process_result(), my_process_stmt_result(), mysql_rpl_probe(), primary_key_fields(), print_result(), print_warnings(), process_all_tables_in_db(), run_query_normal(), run_query_stmt(), run_task(), stmt_fetch_init(), test_bug12001(), test_bug15752(), test_bug1644(), test_bug19671(), test_bug2247(), test_bug4172(), test_bug6049(), test_bug6058(), test_bug6096(), test_bug6761(), test_bug9735(), test_bug9992(), test_cuted_rows(), test_debug_example(), test_double_compare(), test_errors(), test_explain_bug(), test_field_flags(), test_field_misc(), test_field_names(), test_frm_bug(), test_func_fields(), test_insert(), test_list_fields(), test_long_data(), test_long_data_bin(), test_long_data_str(), test_long_data_str1(), test_mem_overun(), test_multi_statements(), test_open_direct(), test_prepare_field_result(), test_prepare_noparam(), test_prepare_resultset(), test_select_direct(), test_set_option(), test_simple_delete(), test_simple_update(), test_stmt_close(), test_tran_bdb(), test_tran_innodb(), test_ts(), test_update(), test_view_sp_list_fields(), test_warnings(), var_query_set(), and verify_col_data().
00866 { 00867 DBUG_ENTER("mysql_free_result"); 00868 DBUG_PRINT("enter",("mysql_res: %lx",result)); 00869 if (result) 00870 { 00871 MYSQL *mysql= result->handle; 00872 if (mysql) 00873 { 00874 if (mysql->unbuffered_fetch_owner == &result->unbuffered_fetch_cancelled) 00875 mysql->unbuffered_fetch_owner= 0; 00876 if (mysql->status == MYSQL_STATUS_USE_RESULT) 00877 { 00878 (*mysql->methods->flush_use_result)(mysql); 00879 mysql->status=MYSQL_STATUS_READY; 00880 if (mysql->unbuffered_fetch_owner) 00881 *mysql->unbuffered_fetch_owner= TRUE; 00882 } 00883 } 00884 free_rows(result->data); 00885 if (result->fields) 00886 free_root(&result->field_alloc,MYF(0)); 00887 if (result->row) 00888 my_free((gptr) result->row,MYF(0)); 00889 my_free((gptr) result,MYF(0)); 00890 } 00891 DBUG_VOID_RETURN; 00892 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void STDCALL mysql_get_character_set_info | ( | MYSQL * | mysql, | |
| MY_CHARSET_INFO * | charset | |||
| ) |
Definition at line 1475 of file libmysql.c.
References st_mysql::charset, st_mysql_options::charset_dir, charsets_dir, character_set::comment, charset_info_st::comment, character_set::csname, charset_info_st::csname, character_set::dir, character_set::mbmaxlen, charset_info_st::mbmaxlen, character_set::mbminlen, charset_info_st::mbminlen, mysql, character_set::name, charset_info_st::name, character_set::number, charset_info_st::number, st_mysql::options, character_set::state, and charset_info_st::state.
Referenced by test_client_character_set().
01476 { 01477 csinfo->number = mysql->charset->number; 01478 csinfo->state = mysql->charset->state; 01479 csinfo->csname = mysql->charset->csname; 01480 csinfo->name = mysql->charset->name; 01481 csinfo->comment = mysql->charset->comment; 01482 csinfo->mbminlen = mysql->charset->mbminlen; 01483 csinfo->mbmaxlen = mysql->charset->mbmaxlen; 01484 01485 if (mysql->options.charset_dir) 01486 csinfo->dir = mysql->options.charset_dir; 01487 else 01488 csinfo->dir = charsets_dir; 01489 }
Here is the caller graph for this function:

| const char* STDCALL mysql_get_client_info | ( | void | ) |
Definition at line 1398 of file libmysql.c.
References MYSQL_SERVER_VERSION.
Referenced by main().
01399 { 01400 return (char*) MYSQL_SERVER_VERSION; 01401 }
Here is the caller graph for this function:

| unsigned long STDCALL mysql_get_client_version | ( | void | ) |
Definition at line 1403 of file libmysql.c.
References MYSQL_VERSION_ID.
01404 { 01405 return MYSQL_VERSION_ID; 01406 }
| const char* STDCALL mysql_get_host_info | ( | MYSQL * | mysql | ) |
Definition at line 1385 of file libmysql.c.
References st_mysql::host_info, and mysql.
Referenced by com_status(), construct_prompt(), execute_commands(), and main().
Here is the caller graph for this function:

| MYSQL_PARAMETERS* STDCALL mysql_get_parameters | ( | void | ) |
Definition at line 203 of file libmysql.c.
References mysql_internal_parameters.
Referenced by get_options().
00204 { 00205 return &mysql_internal_parameters; 00206 }
Here is the caller graph for this function:

| unsigned int STDCALL mysql_get_proto_info | ( | MYSQL * | mysql | ) |
Definition at line 1392 of file libmysql.c.
References mysql, and st_mysql::protocol_version.
Referenced by com_status(), and execute_commands().
01393 { 01394 return (mysql->protocol_version); 01395 }
Here is the caller graph for this function:

| const char* STDCALL mysql_get_server_info | ( | MYSQL * | mysql | ) |
Definition at line 1378 of file libmysql.c.
References mysql, and st_mysql::server_version.
Referenced by client_connect(), com_status(), construct_prompt(), execute_commands(), init_var_hash(), main(), and write_header().
01379 { 01380 return((char*) mysql->server_version); 01381 }
Here is the caller graph for this function:

| unsigned long STDCALL mysql_get_server_version | ( | MYSQL * | mysql | ) |
Definition at line 3003 of file client.c.
References mysql, pos(), st_mysql::server_version, strtoul(), and version().
Referenced by client_connect(), com_help(), dbConnect(), dump_all_tables_in_db(), dump_selected_tables(), init_dumping(), mysql_set_character_set(), test_explain_bug(), test_field_misc(), test_prepare_field_result(), and use_db().
03004 { 03005 uint major, minor, version; 03006 char *pos= mysql->server_version, *end_pos; 03007 major= (uint) strtoul(pos, &end_pos, 10); pos=end_pos+1; 03008 minor= (uint) strtoul(pos, &end_pos, 10); pos=end_pos+1; 03009 version= (uint) strtoul(pos, &end_pos, 10); 03010 return (ulong) major*10000L+(ulong) (minor*100+version); 03011 }
Here is the call graph for this function:

Here is the caller graph for this function:

| const char* STDCALL mysql_get_ssl_cipher | ( | MYSQL * | mysql | ) |
Definition at line 1562 of file client.c.
References DBUG_ENTER, DBUG_RETURN, mysql, st_mysql::net, SSL_get_cipher_name, and st_net::vio.
Referenced by com_status().
01563 { 01564 DBUG_ENTER("mysql_get_ssl_cipher"); 01565 #ifdef HAVE_OPENSSL 01566 if (mysql->net.vio && mysql->net.vio->ssl_arg) 01567 DBUG_RETURN(SSL_get_cipher_name((SSL*)mysql->net.vio->ssl_arg)); 01568 #endif /* HAVE_OPENSSL */ 01569 DBUG_RETURN(NULL); 01570 }
Here is the caller graph for this function:

| unsigned long STDCALL mysql_hex_string | ( | char * | to, | |
| const char * | from, | |||
| unsigned long | from_length | |||
| ) |
Definition at line 1548 of file libmysql.c.
References _dig_vec_upper.
Referenced by dump_table().
01549 { 01550 char *to0= to; 01551 const char *end; 01552 01553 for (end= from + length; from < end; from++) 01554 { 01555 *to++= _dig_vec_upper[((unsigned char) *from) >> 4]; 01556 *to++= _dig_vec_upper[((unsigned char) *from) & 0x0F]; 01557 } 01558 *to= '\0'; 01559 return (ulong) (to-to0); 01560 }
Here is the caller graph for this function:

| const char* STDCALL mysql_info | ( | MYSQL * | mysql | ) |
Definition at line 1460 of file libmysql.c.
References st_mysql::info, and mysql.
Referenced by com_go(), run_query_normal(), run_query_stmt(), and write_to_table().
Here is the caller graph for this function:

Definition at line 1429 of file client.c.
References bzero, CLIENT_LOCAL_FILES, CONNECT_TIMEOUT, default_client_charset_info, st_mysql::free_me, my_malloc(), MY_WME, MY_ZEROFILL, MYF, mysql, MYSQL_OPT_GUESS_CONNECTION, mysql_server_init, not_error_sqlstate, strmov(), and TRUE.
Referenced by client_connect(), db_connect(), dbConnect(), do_connect(), handle_sigint(), Instance::is_running(), main(), mysql_reconnect(), mysql_sigint(), run_task(), safe_connect(), spawn_init(), sql_real_connect(), test_bug12001(), test_bug15752(), test_bug8378(), test_bug9992(), test_multi_statements(), test_opt_reconnect(), test_prepare_grant(), test_prepare_multi_statements(), test_stmt_close(), thread_query(), and util_query().
01430 { 01431 if (mysql_server_init(0, NULL, NULL)) 01432 return 0; 01433 if (!mysql) 01434 { 01435 if (!(mysql=(MYSQL*) my_malloc(sizeof(*mysql),MYF(MY_WME | MY_ZEROFILL)))) 01436 return 0; 01437 mysql->free_me=1; 01438 } 01439 else 01440 bzero((char*) (mysql), sizeof(*(mysql))); 01441 mysql->options.connect_timeout= CONNECT_TIMEOUT; 01442 mysql->last_used_con= mysql->next_slave= mysql->master = mysql; 01443 mysql->charset=default_client_charset_info; 01444 strmov(mysql->net.sqlstate, not_error_sqlstate); 01445 /* 01446 By default, we are a replication pivot. The caller must reset it 01447 after we return if this is not the case. 01448 */ 01449 #ifndef TO_BE_DELETED 01450 mysql->rpl_pivot = 1; 01451 #endif 01452 01453 /* 01454 Only enable LOAD DATA INFILE by default if configured with 01455 --enable-local-infile 01456 */ 01457 01458 #if defined(ENABLED_LOCAL_INFILE) && !defined(MYSQL_SERVER) 01459 mysql->options.client_flag|= CLIENT_LOCAL_FILES; 01460 #endif 01461 01462 #ifdef HAVE_SMEM 01463 mysql->options.shared_memory_base_name= (char*) def_shared_memory_base_name; 01464 #endif 01465 01466 mysql->options.methods_to_use= MYSQL_OPT_GUESS_CONNECTION; 01467 mysql->options.report_data_truncation= TRUE; /* default */ 01468 01469 /* 01470 By default we don't reconnect because it could silently corrupt data (after 01471 reconnection you potentially lose table locks, user variables, session 01472 variables (transactions but they are specifically dealt with in 01473 mysql_reconnect()). 01474 This is a change: < 5.0.3 mysql->reconnect was set to 1 by default. 01475 How this change impacts existing apps: 01476 - existing apps which relyed on the default will see a behaviour change; 01477 they will have to set reconnect=1 after mysql_real_connect(). 01478 - existing apps which explicitely asked for reconnection (the only way they 01479 could do it was by setting mysql.reconnect to 1 after mysql_real_connect()) 01480 will not see a behaviour change. 01481 - existing apps which explicitely asked for no reconnection 01482 (mysql.reconnect=0) will not see a behaviour change. 01483 */ 01484 mysql->reconnect= 0; 01485 01486 return mysql; 01487 }
Here is the call graph for this function:

Here is the caller graph for this function:

| my_ulonglong STDCALL mysql_insert_id | ( | MYSQL * | mysql | ) |
Definition at line 1445 of file libmysql.c.
References st_mysql::insert_id, st_mysql::last_used_con, and mysql.
Referenced by com_status(), and test_mysql_insert_id().
01446 { 01447 return mysql->last_used_con->insert_id; 01448 }
Here is the caller graph for this function:

| int STDCALL mysql_kill | ( | MYSQL * | mysql, | |
| unsigned long | pid | |||
| ) |
Definition at line 1314 of file libmysql.c.
References COM_PROCESS_KILL, DBUG_ENTER, DBUG_RETURN, int4store, mysql, and simple_command.
Referenced by execute_commands().
01315 { 01316 char buff[4]; 01317 DBUG_ENTER("mysql_kill"); 01318 int4store(buff,pid); 01319 DBUG_RETURN(simple_command(mysql,COM_PROCESS_KILL,buff,sizeof(buff),0)); 01320 }
Here is the caller graph for this function:

Definition at line 1167 of file libmysql.c.
References append_wild(), DBUG_ENTER, DBUG_RETURN, mysql, mysql_query(), mysql_store_result(), and strmov().
Referenced by list_dbs(), and main().
01168 { 01169 char buff[255]; 01170 DBUG_ENTER("mysql_list_dbs"); 01171 01172 append_wild(strmov(buff,"show databases"),buff+sizeof(buff),wild); 01173 if (mysql_query(mysql,buff)) 01174 DBUG_RETURN(0); 01175 DBUG_RETURN (mysql_store_result(mysql)); 01176 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1218 of file libmysql.c.
References COM_FIELD_LIST, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, st_mysql_res::eof, st_mysql_res::field_alloc, st_mysql::field_alloc, st_mysql_res::field_count, st_mysql::field_count, st_mysql::fields, st_mysql_res::fields, free_old_query(), st_mysql_methods::list_fields, st_mysql::methods, st_mysql_res::methods, my_malloc(), MY_WME, MY_ZEROFILL, MYF, mysql, NULL, simple_command, and strmake().
Referenced by build_completion_hash(), list_tables(), test_bug19671(), test_bug6761(), test_list_fields(), and test_view_sp_list_fields().
01219 { 01220 MYSQL_RES *result; 01221 MYSQL_FIELD *fields; 01222 char buff[257],*end; 01223 DBUG_ENTER("mysql_list_fields"); 01224 DBUG_PRINT("enter",("table: '%s' wild: '%s'",table,wild ? wild : "")); 01225 01226 end=strmake(strmake(buff, table,128)+1,wild ? wild : "",128); 01227 free_old_query(mysql); 01228 if (simple_command(mysql,COM_FIELD_LIST,buff,(ulong) (end-buff),1) || 01229 !(fields= (*mysql->methods->list_fields)(mysql))) 01230 DBUG_RETURN(NULL); 01231 01232 if (!(result = (MYSQL_RES *) my_malloc(sizeof(MYSQL_RES), 01233 MYF(MY_WME | MY_ZEROFILL)))) 01234 DBUG_RETURN(NULL); 01235 01236 result->methods= mysql->methods; 01237 result->field_alloc=mysql->field_alloc; 01238 mysql->fields=0; 01239 result->field_count = mysql->field_count; 01240 result->fields= fields; 01241 result->eof=1; 01242 DBUG_RETURN(result); 01243 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1248 of file libmysql.c.
References COM_PROCESS_INFO, DBUG_ENTER, DBUG_RETURN, st_mysql::field_alloc, st_mysql::field_count, st_mysql::fields, free_old_query(), LINT_INIT, st_mysql::methods, mysql, MYSQL_STATUS_GET_RESULT, mysql_store_result(), st_mysql::net, net_field_length(), NULL, pos(), protocol_41, st_net::read_pos, st_mysql_methods::read_rows, st_mysql::server_capabilities, simple_command, st_mysql::status, and unpack_fields().
Referenced by main().
01249 { 01250 MYSQL_DATA *fields; 01251 uint field_count; 01252 uchar *pos; 01253 DBUG_ENTER("mysql_list_processes"); 01254 01255 LINT_INIT(fields); 01256 if (simple_command(mysql,COM_PROCESS_INFO,0,0,0)) 01257 DBUG_RETURN(0); 01258 free_old_query(mysql); 01259 pos=(uchar*) mysql->net.read_pos; 01260 field_count=(uint) net_field_length(&pos); 01261 if (!(fields = (*mysql->methods->read_rows)(mysql,(MYSQL_FIELD*) 0, 01262 protocol_41(mysql) ? 7 : 5))) 01263 DBUG_RETURN(NULL); 01264 if (!(mysql->fields=unpack_fields(fields,&mysql->field_alloc,field_count,0, 01265 mysql->server_capabilities))) 01266 DBUG_RETURN(0); 01267 mysql->status=MYSQL_STATUS_GET_RESULT; 01268 mysql->field_count=field_count; 01269 DBUG_RETURN(mysql_store_result(mysql)); 01270 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1185 of file libmysql.c.
References append_wild(), DBUG_ENTER, DBUG_RETURN, mysql, mysql_query(), mysql_store_result(), and strmov().
Referenced by getTableName(), list_dbs(), and main().
01186 { 01187 char buff[255]; 01188 DBUG_ENTER("mysql_list_tables"); 01189 01190 append_wild(strmov(buff,"show tables"),buff+sizeof(buff),wild); 01191 if (mysql_query(mysql,buff)) 01192 DBUG_RETURN(0); 01193 DBUG_RETURN (mysql_store_result(mysql)); 01194 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void STDCALL mysql_manager_close | ( | MYSQL_MANAGER * | con | ) |
Definition at line 202 of file manager.c.
References st_mysql_manager::free_me, st_mysql_manager::host, MY_ALLOW_ZERO_PTR, my_free, MYF, st_mysql_manager::net, and net_end().
Referenced by mysql_manager_connect().
00203 { 00204 /* 00205 No need to free con->user and con->passwd, because they were 00206 allocated in my_multimalloc() along with con->host, freeing 00207 con->hosts frees the whole block 00208 */ 00209 my_free((gptr)con->host,MYF(MY_ALLOW_ZERO_PTR)); 00210 net_end(&con->net); 00211 if (con->free_me) 00212 my_free((gptr)con,MYF(0)); 00213 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int STDCALL mysql_manager_command | ( | MYSQL_MANAGER * | con, | |
| const char * | cmd, | |||
| int | cmd_len | |||
| ) |
Definition at line 216 of file manager.c.
References st_mysql_manager::eof, errno, st_mysql_manager::last_errno, st_mysql_manager::last_error, my_net_write(), st_mysql_manager::net, net_flush(), strlen(), and strmov().
00218 { 00219 if (!cmd_len) 00220 cmd_len=strlen(cmd); 00221 if (my_net_write(&con->net,(char*)cmd,cmd_len) || net_flush(&con->net)) 00222 { 00223 con->last_errno=errno; 00224 strmov(con->last_error,"Write error on socket"); 00225 return 1; 00226 } 00227 con->eof=0; 00228 return 0; 00229 }
Here is the call graph for this function:

| MYSQL_MANAGER* STDCALL mysql_manager_connect | ( | MYSQL_MANAGER * | con, | |
| const char * | host, | |||
| const char * | user, | |||
| const char * | passwd, | |||
| unsigned int | port | |||
| ) |
Definition at line 86 of file manager.c.
References atoi(), bzero, st_mysql_manager::cmd_status, err, errno, FALSE, st_mysql_manager::free_me, GETHOSTBYNAME_BUFF_SIZE, st_mysql_manager::host, in_addr_t, INADDR_NONE, INVALID_SOCKET, st_mysql_manager::last_errno, st_net::last_errno, st_mysql_manager::last_error, MANAGER_OK, MAX_MYSQL_MANAGER_MSG, memcpy, memcpy_fixed, msg_buf, my_connect(), my_gethostbyname_r(), my_gethostbyname_r_free(), my_multi_malloc(), my_net_init(), my_net_read(), my_net_write(), my_socket, MYF, mysql_manager_close(), st_mysql_manager::net, net_flush(), NullS, packet_error, st_mysql_manager::passwd, st_net::read_pos, sock, strlen(), strmov(), TRUE, st_mysql_manager::user, vio_blocking, vio_new(), and VIO_TYPE_TCPIP.
00091 { 00092 my_socket sock; 00093 struct sockaddr_in sock_addr; 00094 in_addr_t ip_addr; 00095 char msg_buf[MAX_MYSQL_MANAGER_MSG]; 00096 int msg_len; 00097 Vio* vio; 00098 my_bool not_used; 00099 00100 if (!host) 00101 host="localhost"; 00102 if (!user) 00103 user="root"; 00104 if (!passwd) 00105 passwd=""; 00106 00107 if ((sock=(my_socket)socket(AF_INET,SOCK_STREAM,0)) == INVALID_SOCKET) 00108 { 00109 con->last_errno=errno; 00110 strmov(con->last_error,"Cannot create socket"); 00111 goto err; 00112 } 00113 if (!(vio=vio_new(sock,VIO_TYPE_TCPIP,FALSE))) 00114 { 00115 con->last_errno=ENOMEM; 00116 strmov(con->last_error,"Cannot create network I/O object"); 00117 goto err; 00118 } 00119 vio_blocking(vio, TRUE, ¬_used); 00120 my_net_init(&con->net,vio); 00121 bzero((char*) &sock_addr,sizeof(sock_addr)); 00122 sock_addr.sin_family = AF_INET; 00123 if ((int) (ip_addr = inet_addr(host)) != (int) INADDR_NONE) 00124 { 00125 memcpy_fixed(&sock_addr.sin_addr,&ip_addr,sizeof(ip_addr)); 00126 } 00127 else 00128 { 00129 int tmp_errno; 00130 struct hostent tmp_hostent,*hp; 00131 char buff2[GETHOSTBYNAME_BUFF_SIZE]; 00132 hp = my_gethostbyname_r(host,&tmp_hostent,buff2,sizeof(buff2), 00133 &tmp_errno); 00134 if (!hp) 00135 { 00136 con->last_errno=tmp_errno; 00137 sprintf(con->last_error,"Could not resolve host '%-.64s'",host); 00138 my_gethostbyname_r_free(); 00139 goto err; 00140 } 00141 memcpy(&sock_addr.sin_addr,hp->h_addr, (size_t) hp->h_length); 00142 my_gethostbyname_r_free(); 00143 } 00144 sock_addr.sin_port = (ushort) htons((ushort) port); 00145 if (my_connect(sock,(struct sockaddr *) &sock_addr, sizeof(sock_addr), 00146 0)) 00147 { 00148 con->last_errno=errno; 00149 sprintf(con->last_error ,"Could not connect to %-.64s", host); 00150 goto err; 00151 } 00152 /* read the greating */ 00153 if (my_net_read(&con->net) == packet_error) 00154 { 00155 con->last_errno=errno; 00156 strmov(con->last_error,"Read error on socket"); 00157 goto err; 00158 } 00159 sprintf(msg_buf,"%-.16s %-.16s\n",user,passwd); 00160 msg_len=strlen(msg_buf); 00161 if (my_net_write(&con->net,msg_buf,msg_len) || net_flush(&con->net)) 00162 { 00163 con->last_errno=con->net.last_errno; 00164 strmov(con->last_error,"Write error on socket"); 00165 goto err; 00166 } 00167 if (my_net_read(&con->net) == packet_error) 00168 { 00169 con->last_errno=errno; 00170 strmov(con->last_error,"Read error on socket"); 00171 goto err; 00172 } 00173 if ((con->cmd_status=atoi((char*) con->net.read_pos)) != MANAGER_OK) 00174 { 00175 strmov(con->last_error,"Access denied"); 00176 goto err; 00177 } 00178 if (!my_multi_malloc(MYF(0), &con->host, (uint)strlen(host)+1, 00179 &con->user, (uint)strlen(user)+1, 00180 &con->passwd, (uint)strlen(passwd)+1, 00181 NullS)) 00182 { 00183 con->last_errno=ENOMEM; 00184 strmov(con->last_error,"Out of memory"); 00185 goto err; 00186 } 00187 strmov(con->host,host); 00188 strmov(con->user,user); 00189 strmov(con->passwd,passwd); 00190 return con; 00191 00192 err: 00193 { 00194 my_bool free_me=con->free_me; 00195 con->free_me=0; 00196 mysql_manager_close(con); 00197 con->free_me=free_me; 00198 } 00199 return 0; 00200 }
Here is the call graph for this function:

| int STDCALL mysql_manager_fetch_line | ( | MYSQL_MANAGER * | con, | |
| char * | res_buf, | |||
| int | res_buf_size | |||
| ) |
Definition at line 232 of file manager.c.
References st_mysql_manager::eof, errno, st_mysql_manager::last_errno, st_mysql_manager::last_error, my_net_read(), st_mysql_manager::net, packet_error, st_net::read_pos, RES_BUF_SHIFT, and strmov().
00234 { 00235 char* res_buf_end=res_buf+res_buf_size; 00236 char* net_buf=(char*) con->net.read_pos, *net_buf_end; 00237 int res_buf_shift=RES_BUF_SHIFT; 00238 ulong num_bytes; 00239 00240 if (res_buf_size<RES_BUF_SHIFT) 00241 { 00242 con->last_errno=ENOMEM; 00243 strmov(con->last_error,"Result buffer too small"); 00244 return 1; 00245 } 00246 00247 if ((num_bytes=my_net_read(&con->net)) == packet_error) 00248 { 00249 con->last_errno=errno; 00250 strmov(con->last_error,"socket read failed"); 00251 return 1; 00252 } 00253 00254 net_buf_end=net_buf+num_bytes; 00255 00256 if ((con->eof=(net_buf[3]==' '))) 00257 res_buf_shift--; 00258 net_buf+=res_buf_shift; 00259 res_buf_end[-1]=0; 00260 for (;net_buf<net_buf_end && res_buf < res_buf_end;res_buf++,net_buf++) 00261 { 00262 if ((*res_buf=*net_buf) == '\r') 00263 { 00264 *res_buf=0; 00265 break; 00266 } 00267 } 00268 return 0; 00269 }
Here is the call graph for this function:

| MYSQL_MANAGER* STDCALL mysql_manager_init | ( | MYSQL_MANAGER * | con | ) |
Definition at line 64 of file manager.c.
References bzero, my_malloc(), MY_WME, MY_ZEROFILL, MYF, st_mysql_manager::net_buf, st_mysql_manager::net_buf_pos, NET_BUF_SIZE, st_mysql_manager::net_buf_size, and st_mysql_manager::net_data_end.
00065 { 00066 int net_buf_size=NET_BUF_SIZE; 00067 if (!con) 00068 { 00069 if (!(con=(MYSQL_MANAGER*)my_malloc(sizeof(*con)+net_buf_size, 00070 MYF(MY_WME|MY_ZEROFILL)))) 00071 return 0; 00072 con->free_me=1; 00073 con->net_buf=(char*)con+sizeof(*con); 00074 } 00075 else 00076 { 00077 bzero((char*)con,sizeof(*con)); 00078 if (!(con->net_buf=my_malloc(net_buf_size,MYF(0)))) 00079 return 0; 00080 } 00081 con->net_buf_pos=con->net_data_end=con->net_buf; 00082 con->net_buf_size=net_buf_size; 00083 return con; 00084 }
Here is the call graph for this function:

Definition at line 309 of file libmysql.c.
References DBUG_ENTER, DBUG_RETURN, st_mysql::methods, mysql, mysql_master_send_query, and st_mysql_methods::read_query_result.
00311 { 00312 DBUG_ENTER("mysql_master_query"); 00313 if (mysql_master_send_query(mysql, q, length)) 00314 DBUG_RETURN(1); 00315 DBUG_RETURN((*mysql->methods->read_query_result)(mysql)); 00316 }
Definition at line 318 of file libmysql.c.
References COM_QUERY, DBUG_ENTER, DBUG_RETURN, st_mysql::last_used_con, st_mysql::master, mysql, mysql_real_connect(), st_mysql::net, st_mysql::reconnect, simple_command, and st_net::vio.
00320 { 00321 MYSQL *master = mysql->master; 00322 DBUG_ENTER("mysql_master_send_query"); 00323 if (!master->net.vio && !mysql_real_connect(master,0,0,0,0,0,0,0)) 00324 DBUG_RETURN(1); 00325 master->reconnect= 1; 00326 mysql->last_used_con = master; 00327 DBUG_RETURN(simple_command(master, COM_QUERY, q, length, 1)); 00328 }
Here is the call graph for this function:

Definition at line 5129 of file libmysql.c.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, st_mysql::last_used_con, mysql, SERVER_MORE_RESULTS_EXISTS, and st_mysql::server_status.
Referenced by append_warnings(), run_query_normal(), and test_multi_statements().
05130 { 05131 my_bool res; 05132 DBUG_ENTER("mysql_more_results"); 05133 05134 res= ((mysql->last_used_con->server_status & SERVER_MORE_RESULTS_EXISTS) ? 05135 1: 0); 05136 DBUG_PRINT("exit",("More results exists ? %d", res)); 05137 DBUG_RETURN(res); 05138 }
Here is the caller graph for this function:

| int STDCALL mysql_next_result | ( | MYSQL * | mysql | ) |
Definition at line 5144 of file libmysql.c.
References st_mysql::affected_rows, CR_COMMANDS_OUT_OF_SYNC, DBUG_ENTER, DBUG_RETURN, ER, st_net::last_errno, st_net::last_error, st_mysql::last_used_con, st_mysql::methods, mysql, MYSQL_STATUS_READY, st_mysql::net, st_mysql_methods::next_result, not_error_sqlstate, SERVER_MORE_RESULTS_EXISTS, st_mysql::server_status, st_net::sqlstate, st_mysql::status, strmov(), and unknown_sqlstate.
Referenced by com_go(), run_query_normal(), test_bug12001(), test_bug15752(), test_bug9992(), and test_multi_statements().
05145 { 05146 DBUG_ENTER("mysql_next_result"); 05147 05148 if (mysql->status != MYSQL_STATUS_READY) 05149 { 05150 strmov(mysql->net.sqlstate, unknown_sqlstate); 05151 strmov(mysql->net.last_error, 05152 ER(mysql->net.last_errno=CR_COMMANDS_OUT_OF_SYNC)); 05153 DBUG_RETURN(1); 05154 } 05155 05156 mysql->net.last_error[0]= 0; 05157 mysql->net.last_errno= 0; 05158 strmov(mysql->net.sqlstate, not_error_sqlstate); 05159 mysql->affected_rows= ~(my_ulonglong) 0; 05160 05161 if (mysql->last_used_con->server_status & SERVER_MORE_RESULTS_EXISTS) 05162 DBUG_RETURN((*mysql->methods->next_result)(mysql)); 05163 05164 DBUG_RETURN(-1); /* No more results */ 05165 }
Here is the call graph for this function:

Here is the caller graph for this function:

| unsigned int STDCALL mysql_num_fields | ( | MYSQL_RES * | res | ) |
Definition at line 2968 of file client.c.
References st_mysql_res::field_count.
Referenced by append_result(), build_completion_hash(), com_server_help(), dump_table(), dump_triggers_for_table(), get_master(), get_slaves_from_master(), list_tables(), main(), my_print_dashes(), my_print_result_metadata(), my_process_result_set(), my_process_stmt_result(), print_res_row(), print_row(), print_tab_data(), print_table_data(), print_table_data_html(), print_table_data_vertically(), print_table_data_xml(), run_query_normal(), run_query_stmt(), stmt_fetch_init(), test_bug6096(), test_bug6761(), test_explain_bug(), test_field_flags(), test_field_misc(), test_mem_overun(), test_ts(), test_view_sp_list_fields(), var_query_set(), and verify_field_count().
02969 { 02970 return res->field_count; 02971 }
Here is the caller graph for this function:

| my_ulonglong STDCALL mysql_num_rows | ( | MYSQL_RES * | res | ) |
Definition at line 2963 of file client.c.
References st_mysql_res::row_count.
Referenced by build_completion_hash(), com_go(), com_server_help(), dump_events_for_db(), dump_routines_for_db(), dump_triggers_for_table(), execute_commands(), get_actual_table_name(), get_table_structure(), list_dbs(), list_fields(), main(), print_table_data(), and print_warnings().
02964 { 02965 return res->row_count; 02966 }
Here is the caller graph for this function:

| char* STDCALL mysql_odbc_escape_string | ( | MYSQL * | mysql, | |
| char * | to, | |||
| unsigned long | to_length, | |||
| const char * | from, | |||
| unsigned long | from_length, | |||
| void * | param, | |||
| char *(*)(void *, char *to, unsigned long *length) | extend_buffer | |||
| ) |
| int STDCALL mysql_options | ( | MYSQL * | mysql, | |
| enum mysql_option | option, | |||
| const char * | arg | |||
| ) |
Definition at line 2874 of file client.c.
References add_init_command(), st_mysql_options::charset_dir, st_mysql_options::charset_name, CLIENT_COMPRESS, st_mysql_options::client_flag, st_mysql_options::client_ip, CLIENT_LOCAL_FILES, st_mysql_options::compress, st_mysql_options::connect_timeout, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, st_mysql_options::methods_to_use, MY_ALLOW_ZERO_PTR, st_mysql_options::my_cnf_file, st_mysql_options::my_cnf_group, my_free, my_strdup(), MY_WME, MYF, mysql, MYSQL_INIT_COMMAND, MYSQL_OPT_COMPRESS, MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_GUESS_CONNECTION, MYSQL_OPT_LOCAL_INFILE, MYSQL_OPT_NAMED_PIPE, MYSQL_OPT_PROTOCOL, MYSQL_OPT_READ_TIMEOUT, MYSQL_OPT_RECONNECT, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_OPT_USE_EMBEDDED_CONNECTION, MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_WRITE_TIMEOUT, MYSQL_PROTOCOL_PIPE, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP, MYSQL_REPORT_DATA_TRUNCATION, MYSQL_SECURE_AUTH, MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_SET_CLIENT_IP, MYSQL_SHARED_MEMORY_BASE_NAME, st_mysql::options, st_mysql_options::protocol, st_mysql_options::read_timeout, st_mysql::reconnect, st_mysql_options::report_data_truncation, st_mysql_options::secure_auth, st_mysql_options::shared_memory_base_name, st_mysql_options::ssl_verify_server_cert, test, and st_mysql_options::write_timeout.
Referenced by connect_n_handle_errors(), db_connect(), dbConnect(), do_connect(), main(), safe_connect(), sql_real_connect(), test_bug8378(), test_opt_reconnect(), and test_truncation_option().
02875 { 02876 DBUG_ENTER("mysql_option"); 02877 DBUG_PRINT("enter",("option: %d",(int) option)); 02878 switch (option) { 02879 case MYSQL_OPT_CONNECT_TIMEOUT: 02880 mysql->options.connect_timeout= *(uint*) arg; 02881 break; 02882 case MYSQL_OPT_READ_TIMEOUT: 02883 mysql->options.read_timeout= *(uint*) arg; 02884 break; 02885 case MYSQL_OPT_WRITE_TIMEOUT: 02886 mysql->options.write_timeout= *(uint*) arg; 02887 break; 02888 case MYSQL_OPT_COMPRESS: 02889 mysql->options.compress= 1; /* Remember for connect */ 02890 mysql->options.client_flag|= CLIENT_COMPRESS; 02891 break; 02892 case MYSQL_OPT_NAMED_PIPE: /* This option is depricated */ 02893 mysql->options.protocol=MYSQL_PROTOCOL_PIPE; /* Force named pipe */ 02894 break; 02895 case MYSQL_OPT_LOCAL_INFILE: /* Allow LOAD DATA LOCAL ?*/ 02896 if (!arg || test(*(uint*) arg)) 02897 mysql->options.client_flag|= CLIENT_LOCAL_FILES; 02898 else 02899 mysql->options.client_flag&= ~CLIENT_LOCAL_FILES; 02900 break; 02901 case MYSQL_INIT_COMMAND: 02902 add_init_command(&mysql->options,arg); 02903 break; 02904 case MYSQL_READ_DEFAULT_FILE: 02905 my_free(mysql->options.my_cnf_file,MYF(MY_ALLOW_ZERO_PTR)); 02906 mysql->options.my_cnf_file=my_strdup(arg,MYF(MY_WME)); 02907 break; 02908 case MYSQL_READ_DEFAULT_GROUP: 02909 my_free(mysql->options.my_cnf_group,MYF(MY_ALLOW_ZERO_PTR)); 02910 mysql->options.my_cnf_group=my_strdup(arg,MYF(MY_WME)); 02911 break; 02912 case MYSQL_SET_CHARSET_DIR: 02913 my_free(mysql->options.charset_dir,MYF(MY_ALLOW_ZERO_PTR)); 02914 mysql->options.charset_dir=my_strdup(arg,MYF(MY_WME)); 02915 break; 02916 case MYSQL_SET_CHARSET_NAME: 02917 my_free(mysql->options.charset_name,MYF(MY_ALLOW_ZERO_PTR)); 02918 mysql->options.charset_name=my_strdup(arg,MYF(MY_WME)); 02919 break; 02920 case MYSQL_OPT_PROTOCOL: 02921 mysql->options.protocol= *(uint*) arg; 02922 break; 02923 case MYSQL_SHARED_MEMORY_BASE_NAME: 02924 #ifdef HAVE_SMEM 02925 if (mysql->options.shared_memory_base_name != def_shared_memory_base_name) 02926 my_free(mysql->options.shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); 02927 mysql->options.shared_memory_base_name=my_strdup(arg,MYF(MY_WME)); 02928 #endif 02929 break; 02930 case MYSQL_OPT_USE_REMOTE_CONNECTION: 02931 case MYSQL_OPT_USE_EMBEDDED_CONNECTION: 02932 case MYSQL_OPT_GUESS_CONNECTION: 02933 mysql->options.methods_to_use= option; 02934 break; 02935 case MYSQL_SET_CLIENT_IP: 02936 mysql->options.client_ip= my_strdup(arg, MYF(MY_WME)); 02937 break; 02938 case MYSQL_SECURE_AUTH: 02939 mysql->options.secure_auth= *(my_bool *) arg; 02940 break; 02941 case MYSQL_REPORT_DATA_TRUNCATION: 02942 mysql->options.report_data_truncation= test(*(my_bool *) arg); 02943 break; 02944 case MYSQL_OPT_RECONNECT: 02945 mysql->reconnect= *(my_bool *) arg; 02946 break; 02947 case MYSQL_OPT_SSL_VERIFY_SERVER_CERT: 02948 mysql->options.ssl_verify_server_cert= *(my_bool *) arg; 02949 break; 02950 default: 02951 DBUG_RETURN(1); 02952 } 02953 DBUG_RETURN(0); 02954 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int STDCALL mysql_ping | ( | MYSQL * | mysql | ) |
Definition at line 1366 of file libmysql.c.
References COM_PING, CR_SERVER_LOST, DBUG_ENTER, DBUG_RETURN, mysql, st_mysql::reconnect, and simple_command.
Referenced by execute_commands(), and main().
01367 { 01368 int res; 01369 DBUG_ENTER("mysql_ping"); 01370 res= simple_command(mysql,COM_PING,0,0,0); 01371 if (res == CR_SERVER_LOST && mysql->reconnect) 01372 res= simple_command(mysql,COM_PING,0,0,0); 01373 DBUG_RETURN(res); 01374 }
Here is the caller graph for this function:

| int STDCALL mysql_query | ( | MYSQL * | mysql, | |
| const char * | q | |||
| ) |
Definition at line 1040 of file libmysql.c.
References mysql, mysql_real_query(), and strlen().
Referenced by build_completion_hash(), check_have_innodb(), check_master_version(), client_connect(), client_disconnect(), client_query(), client_store_result(), client_use_result(), com_status(), create_table(), do_save_master_pos(), do_sync_with_master2(), do_wait_for_slave_to_stop(), drop_db(), dump_all_databases(), dump_events_for_db(), dump_routines_for_db(), execute_commands(), fill_tables(), fix_object_name(), get_current_db(), get_pidfile(), get_slaves_from_master(), get_view_structure(), init_dumping(), init_username(), list_dbs(), list_fields(), list_table_status(), list_tables(), main(), mysql_list_dbs(), mysql_list_tables(), mysql_query_with_error_report(), mysql_rpl_probe(), primary_key_fields(), process_all_databases(), process_all_tables_in_db(), run_application(), test_bind_nagative(), test_bind_result(), test_bind_result_ext(), test_bind_result_ext1(), test_buffers(), test_bug10214(), test_bug10729(), test_bug10736(), test_bug10760(), test_bug10794(), test_bug11037(), test_bug11111(), test_bug1115(), test_bug11172(), test_bug11183(), test_bug11656(), test_bug11718(), test_bug1180(), test_bug11901(), test_bug11904(), test_bug11909(), test_bug12001(), test_bug12243(), test_bug13488(), test_bug13524(), test_bug14169(), test_bug14210(), test_bug14845(), test_bug1500(), test_bug15510(), test_bug15613(), test_bug15752(), test_bug1644(), test_bug1664(), test_bug17667(), test_bug1946(), test_bug19671(), test_bug20152(), test_bug2247(), test_bug2248(), test_bug3117(), test_bug4079(), test_bug4172(), test_bug6096(), test_bug8880(), test_bug9159(), test_bug9478(), test_bug9520(), test_bug9643(), test_bug9735(), test_bug9992(), test_create_drop(), test_cuted_rows(), test_date(), test_date_date(), test_date_dt(), test_date_time(), test_date_ts(), test_debug_example(), test_decimal_bug(), test_derived(), test_distinct(), test_do_set(), test_double_compare(), test_errors(), test_explain_bug(), test_fetch_bigint(), test_fetch_column(), test_fetch_date(), test_fetch_double(), test_fetch_float(), test_fetch_long(), test_fetch_null(), test_fetch_offset(), test_fetch_seek(), test_fetch_short(), test_fetch_str(), test_fetch_tiny(), test_field_flags(), test_field_misc(), test_field_names(), test_free_result(), test_free_store_result(), test_frm_bug(), test_func_fields(), test_insert(), test_insert_select(), test_join(), test_left_join_view(), test_list_fields(), test_logs(), test_long_data(), test_long_data_bin(), test_long_data_str(), test_long_data_str1(), test_manual_sample(), test_mem_overun(), test_multi(), test_multi_statements(), test_multi_stmt(), test_mysql_insert_id(), test_nstmts(), test_null(), test_open_direct(), test_order_param(), test_parse_error_and_bad_length(), test_prepare(), test_prepare_alter(), test_prepare_ext(), test_prepare_field_result(), test_prepare_grant(), test_prepare_noparam(), test_prepare_resultset(), test_prepare_simple(), test_prepare_syntax(), test_ps_conj_select(), test_ps_null_param(), test_pure_coverage(), test_rename(), test_select(), test_select_direct(), test_select_prepare(), test_select_show(), test_selecttmp(), test_set_option(), test_simple_delete(), test_simple_update(), test_sqlmode(), test_sshort_bug(), test_stiny_bug(), test_stmt_close(), test_store_result(), test_store_result1(), test_store_result2(), test_subqueries(), test_subqueries_ref(), test_subselect(), test_tran_bdb(), test_tran_innodb(), test_truncation(), test_ts(), test_union(), test_union2(), test_update(), test_ushort_bug(), test_view(), test_view_2where(), test_view_insert(), test_view_insert_fields(), test_view_sp_list_fields(), test_view_star(), test_view_where(), test_warnings(), test_xjoin(), thread_query(), util_query(), verify_col_data(), and write_to_table().
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 5173 of file libmysql.c.
References st_mysql::methods, mysql, and st_mysql_methods::read_query_result.
Referenced by run_query_normal().
05174 { 05175 return (*mysql->methods->read_query_result)(mysql); 05176 }
Here is the caller graph for this function:

Definition at line 395 of file libmysql.c.
References mysql, st_mysql_options::no_master_reads, and st_mysql::options.
00396 { 00397 return !(mysql->options.no_master_reads); 00398 }
| MYSQL* STDCALL mysql_real_connect | ( | MYSQL * | mysql, | |
| const char * | host, | |||
| const char * | user, | |||
| const char * | passwd, | |||
| const char * | db, | |||
| unsigned int | port, | |||
| const char * | unix_socket, | |||
| unsigned long | clientflag | |||
| ) |
Referenced by client_connect(), connect_n_handle_errors(), db_connect(), dbConnect(), get_slaves_from_master(), handle_sigint(), Instance::is_running(), main(), mysql_master_send_query(), mysql_reconnect(), mysql_sigint(), mysql_slave_send_query(), run_task(), safe_connect(), sql_connect(), sql_real_connect(), test_bug12001(), test_bug15752(), test_bug8378(), test_bug9992(), test_multi_statements(), test_opt_reconnect(), test_prepare_grant(), test_prepare_multi_statements(), test_stmt_close(), and thread_query().
Here is the caller graph for this function:

| unsigned long STDCALL mysql_real_escape_string | ( | MYSQL * | mysql, | |
| char * | to, | |||
| const char * | from, | |||
| unsigned long | length | |||
| ) |
Definition at line 1575 of file libmysql.c.
References st_mysql::charset, escape_quotes_for_mysql(), escape_string_for_mysql(), mysql, st_mysql::server_status, and SERVER_STATUS_NO_BACKSLASH_ESCAPES.
Referenced by dump_events_for_db(), dump_routines_for_db(), dump_table(), list_tables(), test_bug10214(), test_bug8378(), and unescape().
01577 { 01578 if (mysql->server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES) 01579 return escape_quotes_for_mysql(mysql->charset, to, 0, from, length); 01580 return escape_string_for_mysql(mysql->charset, to, 0, from, length); 01581 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int STDCALL mysql_real_query | ( | MYSQL * | mysql, | |
| const char * | q, | |||
| unsigned long | length | |||
| ) |
Definition at line 2691 of file client.c.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, st_mysql::methods, mysql, mysql_send_query(), and st_mysql_methods::read_query_result.
Referenced by append_warnings(), CLI_MYSQL_REAL_CONNECT(), dump_all_tables_in_db(), dump_all_views_in_db(), dump_selected_tables(), dump_table(), handle_request_for_tables(), handle_sigint(), lock_table(), mysql_autocommit(), mysql_commit(), mysql_query(), mysql_real_query_for_lazy(), mysql_rollback(), mysql_set_character_set(), mysql_sigint(), run_query(), test_bug11901(), test_bug11909(), test_bug15752(), test_bug17667(), test_bug1946(), test_bug3035(), test_bug3796(), test_bug4172(), test_bug4231(), test_bug5126(), test_bug5194(), test_bug6046(), test_bug6049(), test_bug6058(), test_bug6096(), test_bug6761(), test_bug8330(), test_bug8378(), test_bug8722(), test_conversion(), test_datetime_ranges(), test_mem_overun(), test_parse_error_and_bad_length(), test_ps_i18n(), test_rewind(), test_truncation(), and var_query_set().
02692 { 02693 DBUG_ENTER("mysql_real_query"); 02694 DBUG_PRINT("enter",("handle: %lx",mysql)); 02695 DBUG_PRINT("query",("Query = '%-.4096s'",query)); 02696 02697 if (mysql_send_query(mysql,query,length)) 02698 DBUG_RETURN(1); 02699 DBUG_RETURN((int) (*mysql->methods->read_query_result)(mysql)); 02700 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int STDCALL mysql_refresh | ( | MYSQL * | mysql, | |
| unsigned int | refresh_options | |||
| ) |
Definition at line 1304 of file libmysql.c.
References COM_REFRESH, DBUG_ENTER, DBUG_RETURN, mysql, and simple_command.
Referenced by dump_all_tables_in_db(), dump_all_views_in_db(), dump_selected_tables(), execute_commands(), and main().
01305 { 01306 uchar bits[1]; 01307 DBUG_ENTER("mysql_refresh"); 01308 bits[0]= (uchar) options; 01309 DBUG_RETURN(simple_command(mysql,COM_REFRESH,(char*) bits,1,0)); 01310 }
Here is the caller graph for this function:

Definition at line 5098 of file libmysql.c.
References DBUG_ENTER, DBUG_RETURN, mysql, and mysql_real_query().
Referenced by test_bug10760(), test_bug11172(), test_bug11909(), test_tran_bdb(), and test_tran_innodb().
05099 { 05100 DBUG_ENTER("mysql_rollback"); 05101 DBUG_RETURN((my_bool) mysql_real_query(mysql, "rollback", 8)); 05102 }
Here is the call graph for this function:

Here is the caller graph for this function:

| MYSQL_ROW_OFFSET STDCALL mysql_row_seek | ( | MYSQL_RES * | result, | |
| MYSQL_ROW_OFFSET | offset | |||
| ) |
Definition at line 1144 of file libmysql.c.
References st_mysql_res::current_row, and st_mysql_res::data_cursor.
01145 { 01146 MYSQL_ROW_OFFSET return_value=result->data_cursor; 01147 result->current_row= 0; 01148 result->data_cursor= row; 01149 return return_value; 01150 }
| MYSQL_ROW_OFFSET STDCALL mysql_row_tell | ( | MYSQL_RES * | res | ) |
Definition at line 1423 of file libmysql.c.
References st_mysql_res::data_cursor.
01424 { 01425 return res->data_cursor; 01426 }
| int STDCALL mysql_rpl_parse_enabled | ( | MYSQL * | mysql | ) |
Definition at line 378 of file libmysql.c.
References mysql, st_mysql::options, and st_mysql_options::rpl_parse.
Definition at line 512 of file libmysql.c.
References CR_PROBE_SLAVE_STATUS, DBUG_ENTER, DBUG_RETURN, err, error, expand_error(), get_master(), get_slaves_from_master(), st_mysql::master, mysql, mysql_fetch_row(), mysql_free_result(), mysql_query(), and mysql_store_result().
00513 { 00514 MYSQL_RES *res= 0; 00515 MYSQL_ROW row; 00516 my_bool error= 1; 00517 DBUG_ENTER("mysql_rpl_probe"); 00518 00519 /* 00520 First determine the replication role of the server we connected to 00521 the most reliable way to do this is to run SHOW SLAVE STATUS and see 00522 if we have a non-empty master host. This is still not fool-proof - 00523 it is not a sin to have a master that has a dormant slave thread with 00524 a non-empty master host. However, it is more reliable to check 00525 for empty master than whether the slave thread is actually running 00526 */ 00527 if (mysql_query(mysql, "SHOW SLAVE STATUS") || 00528 !(res = mysql_store_result(mysql))) 00529 { 00530 expand_error(mysql, CR_PROBE_SLAVE_STATUS); 00531 DBUG_RETURN(1); 00532 } 00533 00534 row= mysql_fetch_row(res); 00535 /* 00536 Check master host for emptiness/NULL 00537 For MySQL 4.0 it's enough to check for row[0] 00538 */ 00539 if (row && row[0] && *(row[0])) 00540 { 00541 /* this is a slave, ask it for the master */ 00542 if (get_master(mysql, res, row) || get_slaves_from_master(mysql)) 00543 goto err; 00544 } 00545 else 00546 { 00547 mysql->master = mysql; 00548 if (get_slaves_from_master(mysql)) 00549 goto err; 00550 } 00551 00552 error = 0; 00553 err: 00554 if (res) 00555 mysql_free_result(res); 00556 DBUG_RETURN(error); 00557 }
Here is the call graph for this function:

| enum mysql_rpl_type STDCALL mysql_rpl_query_type | ( | const char * | q, | |
| int | len | |||
| ) |
Definition at line 573 of file libmysql.c.
References my_charset_latin1, my_isalpha, my_tolower, MYSQL_RPL_ADMIN, MYSQL_RPL_MASTER, and MYSQL_RPL_SLAVE.
00574 { 00575 const char *q_end= q + len; 00576 for (; q < q_end; ++q) 00577 { 00578 char c; 00579 if (my_isalpha(&my_charset_latin1, (c= *q))) 00580 { 00581 switch (my_tolower(&my_charset_latin1,c)) { 00582 case 'i': /* insert */ 00583 case 'u': /* update or unlock tables */ 00584 case 'l': /* lock tables or load data infile */ 00585 case 'd': /* drop or delete */ 00586 case 'a': /* alter */ 00587 return MYSQL_RPL_MASTER; 00588 case 'c': /* create or check */ 00589 return my_tolower(&my_charset_latin1,q[1]) == 'h' ? MYSQL_RPL_ADMIN : 00590 MYSQL_RPL_MASTER; 00591 case 's': /* select or show */ 00592 return my_tolower(&my_charset_latin1,q[1]) == 'h' ? MYSQL_RPL_ADMIN : 00593 MYSQL_RPL_SLAVE; 00594 case 'f': /* flush */ 00595 case 'r': /* repair */ 00596 case 'g': /* grant */ 00597 return MYSQL_RPL_ADMIN; 00598 default: 00599 return MYSQL_RPL_SLAVE; 00600 } 00601 } 00602 } 00603 return MYSQL_RPL_MASTER; /* By default, send to master */ 00604 }
| int STDCALL mysql_select_db | ( | MYSQL * | mysql, | |
| const char * | db | |||
| ) |
Definition at line 2444 of file client.c.
References COM_INIT_DB, st_mysql::db, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, error, MY_ALLOW_ZERO_PTR, my_free, my_strdup(), MY_WME, MYF, mysql, simple_command, and strlen().
Referenced by CLI_MYSQL_REAL_CONNECT(), com_use(), create_schema(), db_connect(), dump_all_views_in_db(), init_dumping(), list_dbs(), list_fields(), list_tables(), main(), test_bug6081(), and use_db().
02445 { 02446 int error; 02447 DBUG_ENTER("mysql_select_db"); 02448 DBUG_PRINT("enter",("db: '%s'",db)); 02449 02450 if ((error=simple_command(mysql,COM_INIT_DB,db,(ulong) strlen(db),0))) 02451 DBUG_RETURN(error); 02452 my_free(mysql->db,MYF(MY_ALLOW_ZERO_PTR)); 02453 mysql->db=my_strdup(db,MYF(MY_WME)); 02454 DBUG_RETURN(0); 02455 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int STDCALL mysql_send_query | ( | MYSQL * | mysql, | |
| const char * | q, | |||
| unsigned long | length | |||
| ) |
Definition at line 2666 of file client.c.
References COM_QUERY, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, st_mysql::last_used_con, mysql, mysql_master_send_query, MYSQL_RPL_ADMIN, MYSQL_RPL_MASTER, mysql_rpl_query_type, MYSQL_RPL_SLAVE, mysql_slave_send_query, st_mysql::options, st_mysql_options::rpl_parse, st_mysql::rpl_pivot, and simple_command.
Referenced by mysql_real_query(), and run_query_normal().
02667 { 02668 DBUG_ENTER("mysql_send_query"); 02669 DBUG_PRINT("enter",("rpl_parse: %d rpl_pivot: %d", 02670 mysql->options.rpl_parse, mysql->rpl_pivot)); 02671 #ifndef TO_BE_DELETED 02672 if (mysql->options.rpl_parse && mysql->rpl_pivot) 02673 { 02674 switch (mysql_rpl_query_type(query, length)) { 02675 case MYSQL_RPL_MASTER: 02676 DBUG_RETURN(mysql_master_send_query(mysql, query, length)); 02677 case MYSQL_RPL_SLAVE: 02678 DBUG_RETURN(mysql_slave_send_query(mysql, query, length)); 02679 case MYSQL_RPL_ADMIN: 02680 break; /* fall through */ 02681 } 02682 } 02683 mysql->last_used_con = mysql; 02684 #endif 02685 02686 DBUG_RETURN(simple_command(mysql, COM_QUERY, query, length, 1)); 02687 }
Here is the caller graph for this function:

| void STDCALL mysql_server_end | ( | void | ) |
Definition at line 173 of file libmysql.c.
References DBUG_POP, finish_client_errs(), free_charsets(), MY_DONT_FREE_DBUG, my_end(), mysql_client_init, mysql_thread_end(), org_my_init_done, stderror_file, and vio_end().
Referenced by free_used_memory(), and mysql_end().
00174 { 00175 #ifdef EMBEDDED_LIBRARY 00176 end_embedded_server(); 00177 #endif 00178 /* If library called my_init(), free memory allocated by it */ 00179 if (!org_my_init_done) 00180 { 00181 my_end(MY_DONT_FREE_DBUG); 00182 /* Remove TRACING, if enabled by mysql_debug() */ 00183 DBUG_POP(); 00184 } 00185 else 00186 mysql_thread_end(); 00187 finish_client_errs(); 00188 free_charsets(); 00189 vio_end(); 00190 mysql_client_init= org_my_init_done= 0; 00191 #ifdef EMBEDDED_SERVER 00192 if (stderror_file) 00193 { 00194 fclose(stderror_file); 00195 stderror_file= 0; 00196 } 00197 #endif 00198 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int STDCALL mysql_server_init | ( | int | argc, | |
| char ** | argv, | |||
| char ** | groups | |||
| ) |
| int STDCALL mysql_set_character_set | ( | MYSQL * | mysql, | |
| const char * | csname | |||
| ) |
Definition at line 3020 of file client.c.
References st_mysql::charset, st_mysql_options::charset_dir, charsets_dir, CR_CANT_READ_CHARSET, ER, FN_REFLEN, get_charset_by_csname(), get_charsets_dir(), st_net::last_errno, st_net::last_error, MY_CS_NAME_SIZE, MY_CS_PRIMARY, my_snprintf(), MYF, mysql, mysql_get_server_version(), mysql_real_query(), st_mysql::net, st_mysql::options, st_net::sqlstate, strlen(), strmov(), and unknown_sqlstate.
Referenced by mysql_reconnect(), and test_client_character_set().
03021 { 03022 struct charset_info_st *cs; 03023 const char *save_csdir= charsets_dir; 03024 03025 if (mysql->options.charset_dir) 03026 charsets_dir= mysql->options.charset_dir; 03027 03028 if (strlen(cs_name) < MY_CS_NAME_SIZE && 03029 (cs= get_charset_by_csname(cs_name, MY_CS_PRIMARY, MYF(0)))) 03030 { 03031 char buff[MY_CS_NAME_SIZE + 10]; 03032 charsets_dir= save_csdir; 03033 /* Skip execution of "SET NAMES" for pre-4.1 servers */ 03034 if (mysql_get_server_version(mysql) < 40100) 03035 return 0; 03036 sprintf(buff, "SET NAMES %s", cs_name); 03037 if (!mysql_real_query(mysql, buff, strlen(buff))) 03038 { 03039 mysql->charset= cs; 03040 } 03041 } 03042 else 03043 { 03044 char cs_dir_name[FN_REFLEN]; 03045 get_charsets_dir(cs_dir_name); 03046 mysql->net.last_errno= CR_CANT_READ_CHARSET; 03047 strmov(mysql->net.sqlstate, unknown_sqlstate); 03048 my_snprintf(mysql->net.last_error, sizeof(mysql->net.last_error) - 1, 03049 ER(mysql->net.last_errno), cs_name, cs_dir_name); 03050 03051 } 03052 charsets_dir= save_csdir; 03053 return mysql->net.last_errno; 03054 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void mysql_set_local_infile_default | ( | MYSQL * | mysql | ) |
Definition at line 1025 of file libmysql.c.
References default_local_infile_end(), default_local_infile_error(), default_local_infile_init(), default_local_infile_read(), st_mysql_options::local_infile_end, st_mysql_options::local_infile_error, st_mysql_options::local_infile_init, st_mysql_options::local_infile_read, mysql, and st_mysql::options.
Referenced by handle_local_infile().
01026 { 01027 mysql->options.local_infile_init= default_local_infile_init; 01028 mysql->options.local_infile_read= default_local_infile_read; 01029 mysql->options.local_infile_end= default_local_infile_end; 01030 mysql->options.local_infile_error= default_local_infile_error; 01031 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void mysql_set_local_infile_handler | ( | MYSQL * | mysql, | |
| int(*)(void **, const char *, void *) | local_infile_init, | |||
| int(*)(void *, char *, unsigned int) | local_infile_read, | |||
| void(*)(void *) | local_infile_end, | |||
| int(*)(void *, char *, unsigned int) | local_infile_error, | |||
| void * | ||||
| ) |
Definition at line 1009 of file libmysql.c.
References st_mysql_options::local_infile_end, st_mysql_options::local_infile_error, st_mysql_options::local_infile_init, st_mysql_options::local_infile_read, st_mysql_options::local_infile_userdata, mysql, and st_mysql::options.
01016 { 01017 mysql->options.local_infile_init= local_infile_init; 01018 mysql->options.local_infile_read= local_infile_read; 01019 mysql->options.local_infile_end= local_infile_end; 01020 mysql->options.local_infile_error= local_infile_error; 01021 mysql->options.local_infile_userdata = userdata; 01022 }
| int STDCALL mysql_set_master | ( | MYSQL * | mysql, | |
| const char * | host, | |||
| unsigned int | port, | |||
| const char * | user, | |||
| const char * | passwd | |||
| ) |
Definition at line 1082 of file libmysql.c.
References st_mysql::master, mysql, mysql_close(), st_mysql::rpl_pivot, and spawn_init().
01085 { 01086 if (mysql->master != mysql && !mysql->master->rpl_pivot) 01087 mysql_close(mysql->master); 01088 if (!(mysql->master = spawn_init(mysql, host, port, user, passwd))) 01089 return 1; 01090 return 0; 01091 }
Here is the call graph for this function:

| int STDCALL mysql_set_server_option | ( | MYSQL * | mysql, | |
| enum enum_mysql_set_option | option | |||
| ) |
Definition at line 1324 of file libmysql.c.
References COM_SET_OPTION, DBUG_ENTER, DBUG_RETURN, int2store, mysql, and simple_command.
01325 { 01326 char buff[2]; 01327 DBUG_ENTER("mysql_set_server_option"); 01328 int2store(buff, (uint) option); 01329 DBUG_RETURN(simple_command(mysql, COM_SET_OPTION, buff, sizeof(buff), 0)); 01330 }
| int STDCALL mysql_shutdown | ( | MYSQL * | mysql, | |
| enum mysql_enum_shutdown_level | shutdown_level | |||
| ) |
Definition at line 1294 of file libmysql.c.
References COM_SHUTDOWN, DBUG_ENTER, DBUG_RETURN, mysql, and simple_command.
Referenced by execute_commands().
01295 { 01296 uchar level[1]; 01297 DBUG_ENTER("mysql_shutdown"); 01298 level[0]= (uchar) shutdown_level; 01299 DBUG_RETURN(simple_command(mysql, COM_SHUTDOWN, (char *)level, 1, 0)); 01300 }
Here is the caller graph for this function:

Definition at line 332 of file libmysql.c.
References DBUG_ENTER, DBUG_RETURN, st_mysql::methods, mysql, mysql_slave_send_query, and st_mysql_methods::read_query_result.
00334 { 00335 DBUG_ENTER("mysql_slave_query"); 00336 if (mysql_slave_send_query(mysql, q, length)) 00337 DBUG_RETURN(1); 00338 DBUG_RETURN((*mysql->methods->read_query_result)(mysql)); 00339 }
Definition at line 342 of file libmysql.c.
References COM_QUERY, DBUG_ENTER, DBUG_RETURN, st_mysql::last_used_con, st_mysql::last_used_slave, mysql, mysql_real_connect(), st_mysql::net, st_mysql::next_slave, st_mysql::reconnect, simple_command, and st_net::vio.
00344 { 00345 MYSQL* last_used_slave, *slave_to_use = 0; 00346 DBUG_ENTER("mysql_slave_send_query"); 00347 00348 if ((last_used_slave = mysql->last_used_slave)) 00349 slave_to_use = last_used_slave->next_slave; 00350 else 00351 slave_to_use = mysql->next_slave; 00352 /* 00353 Next_slave is always safe to use - we have a circular list of slaves 00354 if there are no slaves, mysql->next_slave == mysql 00355 */ 00356 mysql->last_used_con = mysql->last_used_slave = slave_to_use; 00357 if (!slave_to_use->net.vio && !mysql_real_connect(slave_to_use, 0,0,0, 00358 0,0,0,0)) 00359 DBUG_RETURN(1); 00360 slave_to_use->reconnect= 1; 00361 DBUG_RETURN(simple_command(slave_to_use, COM_QUERY, q, length, 1)); 00362 }
Here is the call graph for this function:

| const char* STDCALL mysql_sqlstate | ( | MYSQL * | mysql | ) |
Definition at line 1450 of file libmysql.c.
References mysql, st_mysql::net, and st_net::sqlstate.
Referenced by connect_n_handle_errors(), put_error(), and run_query_normal().
Here is the caller graph for this function:

| my_bool STDCALL mysql_ssl_set | ( | MYSQL * | mysql, | |
| const char * | key, | |||
| const char * | cert, | |||
| const char * | ca, | |||
| const char * | capath, | |||
| const char * | cipher | |||
| ) |
Referenced by db_connect(), dbConnect(), do_connect(), main(), and sql_real_connect().
Here is the caller graph for this function:

| const char* STDCALL mysql_stat | ( | MYSQL * | mysql | ) |
Definition at line 1356 of file libmysql.c.
References COM_STATISTICS, DBUG_ENTER, DBUG_RETURN, st_net::last_error, st_mysql::methods, mysql, st_mysql::net, st_mysql_methods::read_statistics, and simple_command.
Referenced by com_status(), execute_commands(), and main().
01357 { 01358 DBUG_ENTER("mysql_stat"); 01359 if (simple_command(mysql,COM_STATISTICS,0,0,0)) 01360 return mysql->net.last_error; 01361 DBUG_RETURN((*mysql->methods->read_statistics)(mysql)); 01362 }
Here is the caller graph for this function:

| my_ulonglong STDCALL mysql_stmt_affected_rows | ( | MYSQL_STMT * | stmt | ) |
Definition at line 2946 of file libmysql.c.
References st_mysql_stmt::affected_rows.
Referenced by execute_prepare_query(), test_bug2247(), test_manual_sample(), and verify_st_affected_rows().
02947 { 02948 return stmt->affected_rows; 02949 }
Here is the caller graph for this function:

| my_bool STDCALL mysql_stmt_attr_get | ( | MYSQL_STMT * | stmt, | |
| enum enum_stmt_attr_type | attr_type, | |||
| void * | attr | |||
| ) |
Definition at line 2787 of file libmysql.c.
References FALSE, st_mysql_stmt::flags, st_mysql_stmt::prefetch_rows, STMT_ATTR_CURSOR_TYPE, STMT_ATTR_PREFETCH_ROWS, STMT_ATTR_UPDATE_MAX_LENGTH, TRUE, and st_mysql_stmt::update_max_length.
Referenced by test_bug16144().
02790 { 02791 switch (attr_type) { 02792 case STMT_ATTR_UPDATE_MAX_LENGTH: 02793 *(my_bool*) value= stmt->update_max_length; 02794 break; 02795 case STMT_ATTR_CURSOR_TYPE: 02796 *(ulong*) value= stmt->flags; 02797 break; 02798 case STMT_ATTR_PREFETCH_ROWS: 02799 *(ulong*) value= stmt->prefetch_rows; 02800 break; 02801 default: 02802 return TRUE; 02803 } 02804 return FALSE; 02805 }
Here is the caller graph for this function:

| my_bool STDCALL mysql_stmt_attr_set | ( | MYSQL_STMT * | stmt, | |
| enum enum_stmt_attr_type | attr_type, | |||
| const void * | attr | |||
| ) |
Definition at line 2752 of file libmysql.c.
References CR_NOT_IMPLEMENTED, CURSOR_TYPE_READ_ONLY, DEFAULT_PREFETCH_ROWS, FALSE, st_mysql_stmt::flags, st_mysql_stmt::prefetch_rows, set_stmt_error(), STMT_ATTR_CURSOR_TYPE, STMT_ATTR_PREFETCH_ROWS, STMT_ATTR_UPDATE_MAX_LENGTH, TRUE, unknown_sqlstate, and st_mysql_stmt::update_max_length.
Referenced by my_process_stmt_result(), open_cursor(), run_query_stmt(), stmt_fetch_init(), test_bug10729(), test_bug10736(), test_bug10760(), test_bug10794(), test_bug11172(), test_bug11656(), test_bug11904(), test_bug12243(), test_bug13488(), test_bug13524(), test_bug14210(), test_bug14845(), test_bug16144(), test_bug6096(), test_bug9159(), test_bug9643(), and test_long_data_str1().
02755 { 02756 switch (attr_type) { 02757 case STMT_ATTR_UPDATE_MAX_LENGTH: 02758 stmt->update_max_length= value ? *(const my_bool*) value : 0; 02759 break; 02760 case STMT_ATTR_CURSOR_TYPE: 02761 { 02762 ulong cursor_type; 02763 cursor_type= value ? *(ulong*) value : 0UL; 02764 if (cursor_type > (ulong) CURSOR_TYPE_READ_ONLY) 02765 goto err_not_implemented; 02766 stmt->flags= cursor_type; 02767 break; 02768 } 02769 case STMT_ATTR_PREFETCH_ROWS: 02770 { 02771 ulong prefetch_rows= value ? *(ulong*) value : DEFAULT_PREFETCH_ROWS; 02772 if (value == 0) 02773 return TRUE; 02774 stmt->prefetch_rows= prefetch_rows; 02775 break; 02776 } 02777 default: 02778 goto err_not_implemented; 02779 } 02780 return FALSE; 02781 err_not_implemented: 02782 set_stmt_error(stmt, CR_NOT_IMPLEMENTED, unknown_sqlstate); 02783 return TRUE; 02784 }
Here is the call graph for this function:

Here is the caller graph for this function:

| my_bool STDCALL mysql_stmt_bind_param | ( | MYSQL_STMT * | stmt, | |
| MYSQL_BIND * | bnd | |||
| ) |
Definition at line 3156 of file libmysql.c.
References st_mysql_stmt::bind_param_done, st_mysql_bind::buffer_length, st_mysql_bind::buffer_type, count, CR_NO_PREPARE_STMT, CR_UNSUPPORTED_PARAM_TYPE, DBUG_ENTER, DBUG_RETURN, ER, st_mysql_bind::is_null, st_mysql_stmt::last_errno, st_mysql_stmt::last_error, st_mysql_bind::length, st_mysql_bind::long_data_used, MAX_DATE_REP_LENGTH, MAX_DATETIME_REP_LENGTH, MAX_TIME_REP_LENGTH, memcpy, MYSQL_STMT_PREPARE_DONE, MYSQL_TYPE_BLOB, MYSQL_TYPE_DATE, MYSQL_TYPE_DATETIME, MYSQL_TYPE_DECIMAL, MYSQL_TYPE_DOUBLE, MYSQL_TYPE_FLOAT, MYSQL_TYPE_LONG, MYSQL_TYPE_LONG_BLOB, MYSQL_TYPE_LONGLONG, MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_NEWDECIMAL, MYSQL_TYPE_NULL, MYSQL_TYPE_SHORT, MYSQL_TYPE_STRING, MYSQL_TYPE_TIME, MYSQL_TYPE_TIMESTAMP, MYSQL_TYPE_TINY, MYSQL_TYPE_TINY_BLOB, MYSQL_TYPE_VAR_STRING, MYSQL_TYPE_VARCHAR, st_mysql_stmt::param_count, st_mysql_bind::param_number, st_mysql_stmt::params, st_mysql_stmt::send_types_to_server, set_stmt_error(), st_mysql_stmt::sqlstate, st_mysql_stmt::state, store_param_date(), store_param_datetime(), store_param_double(), store_param_float(), st_mysql_bind::store_param_func, store_param_int32(), store_param_int64(), store_param_short(), store_param_str(), store_param_time(), store_param_tinyint(), strmov(), TRUE, and unknown_sqlstate.
Referenced by bind_fetch(), test_bind_date_conv(), test_bind_nagative(), test_bug10794(), test_bug1115(), test_bug11172(), test_bug11656(), test_bug1180(), test_bug11901(), test_bug1500(), test_bug1644(), test_bug1664(), test_bug20152(), test_bug3035(), test_bug3796(), test_bug4026(), test_bug4231(), test_bug5194(), test_bug6046(), test_bug8330(), test_conversion(), test_datetime_ranges(), test_decimal_bug(), test_derived(), test_double_compare(), test_insert(), test_logs(), test_long_data(), test_long_data_bin(), test_long_data_str(), test_long_data_str1(), test_manual_sample(), test_multi(), test_multi_stmt(), test_nstmts(), test_null(), test_prepare(), test_prepare_alter(), test_prepare_ext(), test_ps_conj_select(), test_ps_i18n(), test_ps_null_param(), test_pure_coverage(), test_select(), test_set_variable(), test_simple_delete(), test_simple_update(), test_sqlmode(), test_stmt_close(), test_store_result2(), test_subselect(), test_ts(), test_union_param(), test_update(), test_view(), test_view_2where(), test_view_insert(), test_view_insert_fields(), and test_view_star().
03157 { 03158 uint count=0; 03159 MYSQL_BIND *param, *end; 03160 DBUG_ENTER("mysql_stmt_bind_param"); 03161 03162 if (!stmt->param_count) 03163 { 03164 if ((int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE) 03165 { 03166 set_stmt_error(stmt, CR_NO_PREPARE_STMT, unknown_sqlstate); 03167 DBUG_RETURN(1); 03168 } 03169 DBUG_RETURN(0); 03170 } 03171 03172 /* Allocated on prepare */ 03173 memcpy((char*) stmt->params, (char*) bind, 03174 sizeof(MYSQL_BIND) * stmt->param_count); 03175 03176 for (param= stmt->params, end= param+stmt->param_count; 03177 param < end ; 03178 param++) 03179 { 03180 param->param_number= count++; 03181 param->long_data_used= 0; 03182 03183 /* If param->is_null is not set, then the value can never be NULL */ 03184 if (!param->is_null) 03185 param->is_null= &int_is_null_false; 03186 03187 /* Setup data copy functions for the different supported types */ 03188 switch (param->buffer_type) { 03189 case MYSQL_TYPE_NULL: 03190 param->is_null= &int_is_null_true; 03191 break; 03192 case MYSQL_TYPE_TINY: 03193 /* Force param->length as this is fixed for this type */ 03194 param->length= ¶m->buffer_length; 03195 param->buffer_length= 1; 03196 param->store_param_func= store_param_tinyint; 03197 break; 03198 case MYSQL_TYPE_SHORT: 03199 param->length= ¶m->buffer_length; 03200 param->buffer_length= 2; 03201 param->store_param_func= store_param_short; 03202 break; 03203 case MYSQL_TYPE_LONG: 03204 param->length= ¶m->buffer_length; 03205 param->buffer_length= 4; 03206 param->store_param_func= store_param_int32; 03207 break; 03208 case MYSQL_TYPE_LONGLONG: 03209 param->length= ¶m->buffer_length; 03210 param->buffer_length= 8; 03211 param->store_param_func= store_param_int64; 03212 break; 03213 case MYSQL_TYPE_FLOAT: 03214 param->length= ¶m->buffer_length; 03215 param->buffer_length= 4; 03216 param->store_param_func= store_param_float; 03217 break; 03218 case MYSQL_TYPE_DOUBLE: 03219 param->length= ¶m->buffer_length; 03220 param->buffer_length= 8; 03221 param->store_param_func= store_param_double; 03222 break; 03223 case MYSQL_TYPE_TIME: 03224 param->store_param_func= store_param_time; 03225 param->buffer_length= MAX_TIME_REP_LENGTH; 03226 break; 03227 case MYSQL_TYPE_DATE: 03228 param->store_param_func= store_param_date; 03229 param->buffer_length= MAX_DATE_REP_LENGTH; 03230 break; 03231 case MYSQL_TYPE_DATETIME: 03232 case MYSQL_TYPE_TIMESTAMP: 03233 param->store_param_func= store_param_datetime; 03234 param->buffer_length= MAX_DATETIME_REP_LENGTH; 03235 break; 03236 case MYSQL_TYPE_TINY_BLOB: 03237 case MYSQL_TYPE_MEDIUM_BLOB: 03238 case MYSQL_TYPE_LONG_BLOB: 03239 case MYSQL_TYPE_BLOB: 03240 case MYSQL_TYPE_VARCHAR: 03241 case MYSQL_TYPE_VAR_STRING: 03242 case MYSQL_TYPE_STRING: 03243 case MYSQL_TYPE_DECIMAL: 03244 case MYSQL_TYPE_NEWDECIMAL: 03245 param->store_param_func= store_param_str; 03246 /* 03247 For variable length types user must set either length or 03248 buffer_length. 03249 */ 03250 break; 03251 default: 03252 strmov(stmt->sqlstate, unknown_sqlstate); 03253 sprintf(stmt->last_error, 03254 ER(stmt->last_errno= CR_UNSUPPORTED_PARAM_TYPE), 03255 param->buffer_type, count); 03256 DBUG_RETURN(1); 03257 } 03258 /* 03259 If param->length is not given, change it to point to buffer_length. 03260 This way we can always use *param->length to get the length of data 03261 */ 03262 if (!param->length) 03263 param->length= ¶m->buffer_length; 03264 } 03265 /* We have to send/resend type information to MySQL */ 03266 stmt->send_types_to_server= TRUE; 03267 stmt->bind_param_done= TRUE; 03268 DBUG_RETURN(0); 03269 }
Here is the call graph for this function:

Here is the caller graph for this function:

| my_bool STDCALL mysql_stmt_bind_result | ( | MYSQL_STMT * | stmt, | |
| MYSQL_BIND * | bnd | |||
| ) |
Definition at line 4399 of file libmysql.c.
References st_mysql_stmt::bind, st_mysql_stmt::bind_result_done, BIND_RESULT_DONE, st_mysql_bind::buffer_type, CR_NO_PREPARE_STMT, CR_NO_STMT_METADATA, CR_UNSUPPORTED_PARAM_TYPE, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, ER, st_mysql_bind::error, st_mysql_bind::error_value, st_mysql_stmt::field_count, st_mysql_stmt::fields, int(), st_mysql_bind::is_null, st_mysql_bind::is_null_value, st_mysql_stmt::last_errno, st_mysql_stmt::last_error, st_mysql_bind::length, st_mysql_bind::length_value, memcpy, st_mysql_stmt::mysql, MYSQL_STMT_PREPARE_DONE, st_mysql_bind::offset, st_mysql::options, st_mysql_bind::param_number, st_mysql_options::report_data_truncation, REPORT_DATA_TRUNCATION, set_stmt_error(), setup_one_fetch_function(), st_mysql_stmt::sqlstate, st_mysql_stmt::state, strmov(), st_mysql_field::type, and unknown_sqlstate.
Referenced by append_stmt_result(), bind_fetch(), my_process_stmt_result(), mysql_stmt_store_result(), stmt_fetch_init(), test_bind_date_conv(), test_bind_result(), test_bind_result_ext(), test_bind_result_ext1(), test_buffers(), test_bug10729(), test_bug10736(), test_bug10760(), test_bug10794(), test_bug11111(), test_bug11172(), test_bug11901(), test_bug11904(), test_bug11909(), test_bug13488(), test_bug3035(), test_bug3117(), test_bug3796(), test_bug4026(), test_bug4030(), test_bug4079(), test_bug4172(), test_bug5126(), test_bug5399(), test_bug6049(), test_bug6058(), test_bug6096(), test_bug9478(), test_bug9520(), test_bug9643(), test_conversion(), test_decimal_bug(), test_fetch_column(), test_fetch_date(), test_fetch_nobuffs(), test_fetch_null(), test_fetch_offset(), test_fetch_seek(), test_field_misc(), test_free_result(), test_free_store_result(), test_frm_bug(), test_logs(), test_long_data_str1(), test_multi_stmt(), test_nstmts(), test_null(), test_prepare(), test_ps_i18n(), test_ps_null_param(), test_pure_coverage(), test_rewind(), test_set_variable(), test_sshort_bug(), test_stiny_bug(), test_store_result(), test_store_result2(), test_subselect(), test_truncation(), test_truncation_option(), and test_ushort_bug().
04400 { 04401 MYSQL_BIND *param, *end; 04402 MYSQL_FIELD *field; 04403 ulong bind_count= stmt->field_count; 04404 uint param_count= 0; 04405 DBUG_ENTER("mysql_stmt_bind_result"); 04406 DBUG_PRINT("enter",("field_count: %d", bind_count)); 04407 04408 if (!bind_count) 04409 { 04410 int errorcode= (int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE ? 04411 CR_NO_PREPARE_STMT : CR_NO_STMT_METADATA; 04412 set_stmt_error(stmt, errorcode, unknown_sqlstate); 04413 DBUG_RETURN(1); 04414 } 04415 04416 /* 04417 We only need to check that stmt->field_count - if it is not null 04418 stmt->bind was initialized in mysql_stmt_prepare 04419 stmt->bind overlaps with bind if mysql_stmt_bind_param 04420 is called from mysql_stmt_store_result. 04421 */ 04422 04423 if (stmt->bind != bind) 04424 memcpy((char*) stmt->bind, (char*) bind, sizeof(MYSQL_BIND) * bind_count); 04425 04426 for (param= stmt->bind, end= param + bind_count, field= stmt->fields ; 04427 param < end ; 04428 param++, field++) 04429 { 04430 DBUG_PRINT("info",("buffer_type: %u field_type: %u", 04431 (uint) param->buffer_type, (uint) field->type)); 04432 /* 04433 Set param->is_null to point to a dummy variable if it's not set. 04434 This is to make the execute code easier 04435 */ 04436 if (!param->is_null) 04437 param->is_null= ¶m->is_null_value; 04438 04439 if (!param->length) 04440 param->length= ¶m->length_value; 04441 04442 if (!param->error) 04443 param->error= ¶m->error_value; 04444 04445 param->param_number= param_count++; 04446 param->offset= 0; 04447 04448 if (setup_one_fetch_function(param, field)) 04449 { 04450 strmov(stmt->sqlstate, unknown_sqlstate); 04451 sprintf(stmt->last_error, 04452 ER(stmt->last_errno= CR_UNSUPPORTED_PARAM_TYPE), 04453 field->type, param_count); 04454 DBUG_RETURN(1); 04455 } 04456 } 04457 stmt->bind_result_done= BIND_RESULT_DONE; 04458 if (stmt->mysql->options.report_data_truncation) 04459 stmt->bind_result_done|= REPORT_DATA_TRUNCATION; 04460 04461 DBUG_RETURN(0); 04462 }
Here is the call graph for this function:

Here is the caller graph for this function:

| my_bool STDCALL mysql_stmt_close | ( | MYSQL_STMT * | stmt | ) |
Definition at line 4987 of file libmysql.c.
Referenced by bind_fetch(), close_cons(), dispatch_command(), execute_prepare_query(), my_stmt_result(), mysql_simple_prepare(), run_query_stmt(), stmt_fetch_close(), test_bind_date_conv(), test_bind_nagative(), test_bind_result(), test_bind_result_ext(), test_bind_result_ext1(), test_buffers(), test_bug10729(), test_bug10736(), test_bug10760(), test_bug10794(), test_bug11037(), test_bug11111(), test_bug1115(), test_bug11172(), test_bug11183(), test_bug11656(), test_bug1180(), test_bug11901(), test_bug11904(), test_bug11909(), test_bug12243(), test_bug12744(), test_bug13488(), test_bug13524(), test_bug14210(), test_bug14845(), test_bug1500(), test_bug15510(), test_bug15613(), test_bug16143(), test_bug16144(), test_bug1644(), test_bug1664(), test_bug1946(), test_bug20152(), test_bug2247(), test_bug2248(), test_bug3035(), test_bug3117(), test_bug3796(), test_bug4026(), test_bug4030(), test_bug4079(), test_bug4172(), test_bug4231(), test_bug4236(), test_bug5126(), test_bug5194(), test_bug5315(), test_bug5399(), test_bug6046(), test_bug6049(), test_bug6058(), test_bug6059(), test_bug6096(), test_bug7990(), test_bug8330(), test_bug8722(), test_bug8880(), test_bug9159(), test_bug9478(), test_bug9520(), test_bug9643(), test_conversion(), test_create_drop(), test_datetime_ranges(), test_decimal_bug(), test_derived(), test_distinct(), test_do_set(), test_double_compare(), test_explain_bug(), test_fetch_column(), test_fetch_date(), test_fetch_nobuffs(), test_fetch_null(), test_fetch_offset(), test_fetch_seek(), test_field_misc(), test_free_result(), test_free_store_result(), test_frm_bug(), test_insert(), test_insert_select(), test_join(), test_left_join_view(), test_logs(), test_long_data(), test_long_data_bin(), test_long_data_str(), test_long_data_str1(), test_manual_sample(), test_mem_overun(), test_multi(), test_multi_stmt(), test_nstmts(), test_null(), test_open_direct(), test_order_param(), test_parse_error_and_bad_length(), test_prepare(), test_prepare_alter(), test_prepare_ext(), test_prepare_field_result(), test_prepare_insert_update(), test_prepare_noparam(), test_prepare_resultset(), test_prepare_simple(), test_ps_conj_select(), test_ps_i18n(), test_ps_null_param(), test_pure_coverage(), test_rename(), test_rewind(), test_select(), test_select_prepare(), test_select_show(), test_select_show_table(), test_select_version(), test_selecttmp(), test_set_option(), test_set_variable(), test_simple_delete(), test_simple_update(), test_sqlmode(), test_sshort_bug(), test_stiny_bug(), test_stmt_close(), test_store_result(), test_store_result1(), test_store_result2(), test_subqueries(), test_subqueries_ref(), test_subselect(), test_truncation(), test_truncation_option(), test_ts(), test_union(), test_union2(), test_union_param(), test_update(), test_ushort_bug(), test_view(), test_view_2where(), test_view_insert(), test_view_insert_fields(), test_view_star(), test_view_where(), and test_xjoin().
04988 { 04989 MYSQL *mysql= stmt->mysql; 04990 int rc= 0; 04991 DBUG_ENTER("mysql_stmt_close"); 04992 04993 free_root(&stmt->result.alloc, MYF(0)); 04994 free_root(&stmt->mem_root, MYF(0)); 04995 04996 if (mysql) 04997 { 04998 mysql->stmts= list_delete(mysql->stmts, &stmt->list); 04999 /* 05000 Clear NET error state: if the following commands come through 05001 successfully, connection will still be usable for other commands. 05002 */ 05003 net_clear_error(&mysql->net); 05004 if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE) 05005 { 05006 char buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */ 05007 05008 if (mysql->unbuffered_fetch_owner == &stmt->unbuffered_fetch_cancelled) 05009 mysql->unbuffered_fetch_owner= 0; 05010 if (mysql->status != MYSQL_STATUS_READY) 05011 { 05012 /* 05013 Flush result set of the connection. If it does not belong 05014 to this statement, set a warning. 05015 */ 05016 (*mysql->methods->flush_use_result)(mysql); 05017 if (mysql->unbuffered_fetch_owner) 05018 *mysql->unbuffered_fetch_owner= TRUE; 05019 mysql->status= MYSQL_STATUS_READY; 05020 } 05021 int4store(buff, stmt->stmt_id); 05022 if ((rc= stmt_command(mysql, COM_STMT_CLOSE, buff, 4, stmt))) 05023 { 05024 set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno, 05025 mysql->net.sqlstate); 05026 } 05027 } 05028 } 05029 05030 my_free((gptr) stmt, MYF(MY_WME)); 05031 05032 DBUG_RETURN(test(rc)); 05033 }
Here is the caller graph for this function:

| void STDCALL mysql_stmt_data_seek | ( | MYSQL_STMT * | stmt, | |
| my_ulonglong | offset | |||
| ) |
Definition at line 4859 of file libmysql.c.
References st_mysql_data::data, st_mysql_stmt::data_cursor, DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, MYSQL_STMT_EXECUTE_DONE, st_mysql_rows::next, st_mysql_stmt::read_row_func, st_mysql_stmt::result, st_mysql_stmt::state, and stmt_read_row_buffered().
Referenced by test_fetch_seek(), and test_rewind().
04860 { 04861 MYSQL_ROWS *tmp= stmt->result.data; 04862 DBUG_ENTER("mysql_stmt_data_seek"); 04863 DBUG_PRINT("enter",("row id to seek: %ld",(long) row)); 04864 04865 for (; tmp && row; --row, tmp= tmp->next) 04866 ; 04867 stmt->data_cursor= tmp; 04868 if (!row && tmp) 04869 { 04870 /* Rewind the counter */ 04871 stmt->read_row_func= stmt_read_row_buffered; 04872 stmt->state= MYSQL_STMT_EXECUTE_DONE; 04873 } 04874 DBUG_VOID_RETURN; 04875 }
Here is the call graph for this function:

Here is the caller graph for this function:

| unsigned int STDCALL mysql_stmt_errno | ( | MYSQL_STMT * | stmt | ) |
Definition at line 5057 of file libmysql.c.
References DBUG_ENTER, DBUG_RETURN, and st_mysql_stmt::last_errno.
Referenced by append_stmt_result(), print_st_error(), run_query_stmt(), test_bug11037(), test_bug11183(), test_bug7990(), test_bug8330(), and test_bug9478().
05058 { 05059 DBUG_ENTER("mysql_stmt_errno"); 05060 DBUG_RETURN(stmt->last_errno); 05061 }
Here is the caller graph for this function:

| const char* STDCALL mysql_stmt_error | ( | MYSQL_STMT * | stmt | ) |
Definition at line 5073 of file libmysql.c.
References DBUG_ENTER, DBUG_RETURN, and st_mysql_stmt::last_error.
Referenced by append_stmt_result(), fetch_n(), print_st_error(), run_query_stmt(), test_bug11037(), test_bug4079(), test_bug5315(), test_bug9478(), test_bug9643(), test_manual_sample(), and test_parse_error_and_bad_length().
05074 { 05075 DBUG_ENTER("mysql_stmt_error"); 05076 DBUG_RETURN(stmt->last_error); 05077 }
Here is the caller graph for this function:

| int STDCALL mysql_stmt_execute | ( | MYSQL_STMT * | stmt | ) |
Definition at line 2852 of file libmysql.c.
Referenced by bind_fetch(), dispatch_command(), execute_prepare_query(), my_stmt_result(), run_query_stmt(), stmt_fetch_init(), test_bind_date_conv(), test_bind_nagative(), test_bind_result(), test_bind_result_ext(), test_bind_result_ext1(), test_buffers(), test_bug10729(), test_bug10736(), test_bug10760(), test_bug10794(), test_bug11037(), test_bug11111(), test_bug1115(), test_bug11172(), test_bug11183(), test_bug11656(), test_bug1180(), test_bug11901(), test_bug11904(), test_bug11909(), test_bug12243(), test_bug12744(), test_bug13488(), test_bug13524(), test_bug14210(), test_bug14845(), test_bug1500(), test_bug15510(), test_bug1644(), test_bug1664(), test_bug20152(), test_bug2247(), test_bug2248(), test_bug3035(), test_bug3117(), test_bug3796(), test_bug4026(), test_bug4030(), test_bug4079(), test_bug4172(), test_bug4231(), test_bug4236(), test_bug5126(), test_bug5194(), test_bug5315(), test_bug5399(), test_bug6046(), test_bug6049(), test_bug6058(), test_bug6096(), test_bug8330(), test_bug8880(), test_bug9159(), test_bug9478(), test_bug9520(), test_bug9643(), test_conversion(), test_create_drop(), test_datetime_ranges(), test_decimal_bug(), test_derived(), test_distinct(), test_do_set(), test_double_compare(), test_explain_bug(), test_fetch_column(), test_fetch_date(), test_fetch_nobuffs(), test_fetch_null(), test_fetch_offset(), test_fetch_seek(), test_field_misc(), test_free_result(), test_free_store_result(), test_frm_bug(), test_insert(), test_insert_select(), test_join(), test_left_join_view(), test_logs(), test_long_data(), test_long_data_bin(), test_long_data_str(), test_long_data_str1(), test_manual_sample(), test_mem_overun(), test_multi(), test_multi_stmt(), test_nstmts(), test_null(), test_open_direct(), test_prepare(), test_prepare_alter(), test_prepare_ext(), test_prepare_insert_update(), test_prepare_noparam(), test_prepare_simple(), test_ps_conj_select(), test_ps_i18n(), test_ps_null_param(), test_pure_coverage(), test_rename(), test_rewind(), test_select(), test_select_prepare(), test_select_show(), test_select_show_table(), test_select_version(), test_selecttmp(), test_set_option(), test_set_variable(), test_simple_delete(), test_simple_update(), test_sqlmode(), test_sshort_bug(), test_stiny_bug(), test_stmt_close(), test_store_result(), test_store_result1(), test_store_result2(), test_subqueries(), test_subqueries_ref(), test_subselect(), test_truncation(), test_truncation_option(), test_ts(), test_union(), test_union2(), test_union_param(), test_update(), test_ushort_bug(), test_view(), test_view_2where(), test_view_insert(), test_view_insert_fields(), test_view_star(), test_view_where(), and test_xjoin().
02853 { 02854 MYSQL *mysql= stmt->mysql; 02855 DBUG_ENTER("mysql_stmt_execute"); 02856 02857 if (!mysql) 02858 { 02859 set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate); 02860 DBUG_RETURN(1); 02861 } 02862 02863 if (reset_stmt_handle(stmt, RESET_STORE_RESULT)) 02864 DBUG_RETURN(1); 02865 /* 02866 No need to check for stmt->state: if the statement wasn't 02867 prepared we'll get 'unknown statement handler' error from server. 02868 */ 02869 if (mysql->methods->stmt_execute(stmt)) 02870 DBUG_RETURN(1); 02871 if (mysql->field_count) 02872 { 02873 /* Server has sent result set metadata */ 02874 if (stmt->field_count == 0) 02875 { 02876 /* 02877 This is 'SHOW'/'EXPLAIN'-like query. Current implementation of 02878 prepared statements can't send result set metadata for these queries 02879 on prepare stage. Read it now. 02880 */ 02881 alloc_stmt_fields(stmt); 02882 } 02883 else 02884 { 02885 /* 02886 Update result set metadata if it for some reason changed between 02887 prepare and execute, i.e.: 02888 - in case of 'SELECT ?' we don't know column type unless data was 02889 supplied to mysql_stmt_execute, so updated column type is sent 02890 now. 02891 - if data dictionary changed between prepare and execute, for 02892 example a table used in the query was altered. 02893 Note, that now (4.1.3) we always send metadata in reply to 02894 COM_STMT_EXECUTE (even if it is not necessary), so either this or 02895 previous branch always works. 02896 TODO: send metadata only when it's really necessary and add a warning 02897 'Metadata changed' when it's sent twice. 02898 */ 02899 update_stmt_fields(stmt); 02900 } 02901 } 02902 stmt->state= MYSQL_STMT_EXECUTE_DONE; 02903 if (stmt->field_count) 02904 { 02905 if (stmt->server_status & SERVER_STATUS_CURSOR_EXISTS) 02906 { 02907 mysql->status= MYSQL_STATUS_READY; 02908 stmt->read_row_func= stmt_read_row_from_cursor; 02909 } 02910 else if (stmt->flags & CURSOR_TYPE_READ_ONLY) 02911 { 02912 /* 02913 This is a single-row result set, a result set with no rows, EXPLAIN, 02914 SHOW VARIABLES, or some other command which either a) bypasses the 02915 cursors framework in the server and writes rows directly to the 02916 network or b) is more efficient if all (few) result set rows are 02917 precached on client and server's resources are freed. 02918 */ 02919 DBUG_RETURN(mysql_stmt_store_result(stmt)); 02920 } 02921 else 02922 { 02923 stmt->mysql->unbuffered_fetch_owner= &stmt->unbuffered_fetch_cancelled; 02924 stmt->unbuffered_fetch_cancelled= FALSE; 02925 stmt->read_row_func= stmt_read_row_unbuffered; 02926 } 02927 } 02928 DBUG_RETURN(0); 02929 }
Here is the caller graph for this function:

| int STDCALL mysql_stmt_fetch | ( | MYSQL_STMT * | stmt | ) |
Definition at line 4544 of file libmysql.c.
Referenced by append_stmt_result(), bind_fetch(), dispatch_command(), my_process_stmt_result(), stmt_fetch_fetch_row(), test_bind_date_conv(), test_bind_result(), test_bind_result_ext(), test_bind_result_ext1(), test_buffers(), test_bug10729(), test_bug10736(), test_bug10760(), test_bug10794(), test_bug11037(), test_bug11111(), test_bug11172(), test_bug11656(), test_bug11904(), test_bug11909(), test_bug12243(), test_bug13488(), test_bug13524(), test_bug14210(), test_bug14845(), test_bug15510(), test_bug2248(), test_bug3035(), test_bug3117(), test_bug3796(), test_bug4026(), test_bug4030(), test_bug4079(), test_bug4172(), test_bug4231(), test_bug5126(), test_bug5399(), test_bug6049(), test_bug6058(), test_bug6096(), test_bug9478(), test_bug9520(), test_bug9643(), test_conversion(), test_decimal_bug(), test_fetch_column(), test_fetch_date(), test_fetch_nobuffs(), test_fetch_null(), test_fetch_offset(), test_fetch_seek(), test_field_misc(), test_free_result(), test_free_store_result(), test_frm_bug(), test_logs(), test_long_data_str1(), test_mem_overun(), test_multi_stmt(), test_nstmts(), test_null(), test_open_direct(), test_prepare(), test_ps_i18n(), test_ps_null_param(), test_rewind(), test_set_variable(), test_sqlmode(), test_sshort_bug(), test_stiny_bug(), test_store_result(), test_store_result1(), test_store_result2(), test_subselect(), test_truncation(), test_truncation_option(), test_ts(), and test_ushort_bug().
04545 { 04546 int rc; 04547 uchar *row; 04548 DBUG_ENTER("mysql_stmt_fetch"); 04549 04550 if ((rc= (*stmt->read_row_func)(stmt, &row)) || 04551 ((rc= stmt_fetch_row(stmt, row)) && rc != MYSQL_DATA_TRUNCATED)) 04552 { 04553 stmt->state= MYSQL_STMT_PREPARE_DONE; /* XXX: this is buggy */ 04554 stmt->read_row_func= (rc == MYSQL_NO_DATA) ? 04555 stmt_read_row_no_data : stmt_read_row_no_result_set; 04556 } 04557 else 04558 { 04559 /* This is to know in mysql_stmt_fetch_column that data was fetched */ 04560 stmt->state= MYSQL_STMT_FETCH_DONE; 04561 } 04562 DBUG_RETURN(rc); 04563 }
Here is the caller graph for this function:

| int STDCALL mysql_stmt_fetch_column | ( | MYSQL_STMT * | stmt, | |
| MYSQL_BIND * | bind, | |||
| unsigned int | column, | |||
| unsigned long | offset | |||
| ) |
Definition at line 4582 of file libmysql.c.
References st_mysql_stmt::bind, CR_INVALID_PARAMETER_NO, CR_NO_DATA, DBUG_ENTER, DBUG_RETURN, st_mysql_bind::error, st_mysql_bind::error_value, fetch_result_with_conversion(), st_mysql_stmt::field_count, st_mysql_stmt::fields, st_mysql_bind::is_null, st_mysql_bind::length, st_mysql_bind::length_value, MYSQL_STMT_FETCH_DONE, st_mysql_bind::offset, st_mysql_bind::row_ptr, set_stmt_error(), st_mysql_stmt::state, and unknown_sqlstate.
Referenced by test_fetch_column(), test_fetch_offset(), test_free_result(), test_free_store_result(), and test_long_data_str1().
04584 { 04585 MYSQL_BIND *param= stmt->bind+column; 04586 DBUG_ENTER("mysql_stmt_fetch_column"); 04587 04588 if ((int) stmt->state < (int) MYSQL_STMT_FETCH_DONE) 04589 { 04590 set_stmt_error(stmt, CR_NO_DATA, unknown_sqlstate); 04591 return 1; 04592 } 04593 if (column >= stmt->field_count) 04594 { 04595 set_stmt_error(stmt, CR_INVALID_PARAMETER_NO, unknown_sqlstate); 04596 DBUG_RETURN(1); 04597 } 04598 04599 if (!bind->error) 04600 bind->error= &bind->error_value; 04601 *bind->error= 0; 04602 if (param->row_ptr) 04603 { 04604 MYSQL_FIELD *field= stmt->fields+column; 04605 uchar *row= param->row_ptr; 04606 bind->offset= offset; 04607 if (bind->is_null) 04608 *bind->is_null= 0; 04609 if (bind->length) /* Set the length if non char/binary types */ 04610 *bind->length= *param->length; 04611 else 04612 bind->length= ¶m->length_value; /* Needed for fetch_result() */ 04613 fetch_result_with_conversion(bind, field, &row); 04614 } 04615 else 04616 { 04617 if (bind->is_null) 04618 *bind->is_null= 1; 04619 } 04620 DBUG_RETURN(0); 04621 }
Here is the call graph for this function:

Here is the caller graph for this function:

| unsigned int STDCALL mysql_stmt_field_count | ( | MYSQL_STMT * | stmt | ) |
Definition at line 2957 of file libmysql.c.
References st_mysql_stmt::field_count.
Referenced by test_bug6059(), test_field_misc(), and test_truncation().
02958 { 02959 return stmt->field_count; 02960 }
Here is the caller graph for this function:

| my_bool STDCALL mysql_stmt_free_result | ( | MYSQL_STMT * | stmt | ) |
Definition at line 4963 of file libmysql.c.
References DBUG_ENTER, DBUG_RETURN, RESET_LONG_DATA, reset_stmt_handle(), and RESET_STORE_RESULT.
Referenced by test_bug10794(), test_bug11172(), test_bug13488(), test_free_result(), test_free_store_result(), and test_rewind().
04964 { 04965 DBUG_ENTER("mysql_stmt_free_result"); 04966 04967 /* Free the client side and close the server side cursor if there is one */ 04968 DBUG_RETURN(reset_stmt_handle(stmt, RESET_LONG_DATA | RESET_STORE_RESULT)); 04969 }
Here is the call graph for this function:

Here is the caller graph for this function:

| MYSQL_STMT* STDCALL mysql_stmt_init | ( | MYSQL * | mysql | ) |
Definition at line 1960 of file libmysql.c.
References st_mysql_data::alloc, CR_OUT_OF_MEMORY, st_list::data, DBUG_ENTER, DBUG_RETURN, DEFAULT_PREFETCH_ROWS, init_alloc_root(), st_mysql_stmt::list, list_add(), st_mysql_stmt::mem_root, st_mem_root::min_malloc, my_malloc(), MY_WME, MY_ZEROFILL, MYF, mysql, st_mysql_stmt::mysql, MYSQL_STMT_INIT_DONE, not_error_sqlstate, st_mysql_stmt::prefetch_rows, st_mysql_stmt::read_row_func, st_mysql_stmt::result, set_mysql_error(), st_mysql_stmt::sqlstate, st_mysql_stmt::state, stmt_read_row_no_result_set(), st_mysql::stmts, strmov(), and unknown_sqlstate.
Referenced by mysql_simple_prepare(), open_cursor(), run_query_stmt(), stmt_fetch_init(), test_bug10729(), test_bug10736(), test_bug10760(), test_bug10794(), test_bug11037(), test_bug11111(), test_bug11172(), test_bug11183(), test_bug11656(), test_bug11904(), test_bug12243(), test_bug12744(), test_bug13488(), test_bug13524(), test_bug14169(), test_bug14210(), test_bug14845(), test_bug15510(), test_bug15613(), test_bug16143(), test_bug16144(), test_bug1664(), test_bug20152(), test_bug3035(), test_bug3796(), test_bug4026(), test_bug4030(), test_bug4079(), test_bug4172(), test_bug4231(), test_bug4236(), test_bug5126(), test_bug5194(), test_bug5315(), test_bug5399(), test_bug6046(), test_bug6049(), test_bug6058(), test_bug6059(), test_bug6096(), test_bug7990(), test_bug8330(), test_bug8722(), test_bug9159(), test_bug9643(), test_conversion(), test_left_join_view(), test_parse_error_and_bad_length(), test_ps_i18n(), test_rewind(), test_truncation(), test_truncation_option(), test_view(), test_view_2where(), test_view_insert(), test_view_insert_fields(), test_view_star(), and test_view_where().
01961 { 01962 MYSQL_STMT *stmt; 01963 DBUG_ENTER("mysql_stmt_init"); 01964 01965 if (!(stmt= (MYSQL_STMT *) my_malloc(sizeof(MYSQL_STMT), 01966 MYF(MY_WME | MY_ZEROFILL)))) 01967 { 01968 set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate); 01969 DBUG_RETURN(0); 01970 } 01971 01972 init_alloc_root(&stmt->mem_root, 2048, 2048); 01973 init_alloc_root(&stmt->result.alloc, 4096, 4096); 01974 stmt->result.alloc.min_malloc= sizeof(MYSQL_ROWS); 01975 mysql->stmts= list_add(mysql->stmts, &stmt->list); 01976 stmt->list.data= stmt; 01977 stmt->state= MYSQL_STMT_INIT_DONE; 01978 stmt->mysql= mysql; 01979 stmt->read_row_func= stmt_read_row_no_result_set; 01980 stmt->prefetch_rows= DEFAULT_PREFETCH_ROWS; 01981 strmov(stmt->sqlstate, not_error_sqlstate); 01982 /* The rest of statement members was bzeroed inside malloc */ 01983 01984 DBUG_RETURN(stmt); 01985 }
Here is the call graph for this function:

Here is the caller graph for this function:

| my_ulonglong STDCALL mysql_stmt_insert_id | ( | MYSQL_STMT * | stmt | ) |
Definition at line 2978 of file libmysql.c.
References st_mysql_stmt::insert_id.
02979 { 02980 return stmt->insert_id; 02981 }
| my_ulonglong STDCALL mysql_stmt_num_rows | ( | MYSQL_STMT * | stmt | ) |
Definition at line 4882 of file libmysql.c.
References DBUG_ENTER, DBUG_RETURN, st_mysql_stmt::result, and st_mysql_data::rows.
04883 { 04884 DBUG_ENTER("mysql_stmt_num_rows"); 04885 04886 DBUG_RETURN(stmt->result.rows); 04887 }
| unsigned long STDCALL mysql_stmt_param_count | ( | MYSQL_STMT * | stmt | ) |
Definition at line 2936 of file libmysql.c.
References DBUG_ENTER, DBUG_RETURN, and st_mysql_stmt::param_count.
Referenced by test_bug5194(), test_manual_sample(), test_sqlmode(), and verify_param_count().
02937 { 02938 DBUG_ENTER("mysql_stmt_param_count"); 02939 DBUG_RETURN(stmt->param_count); 02940 }
Here is the caller graph for this function:

| MYSQL_RES* STDCALL mysql_stmt_param_metadata | ( | MYSQL_STMT * | stmt | ) |
Definition at line 2254 of file libmysql.c.
References DBUG_ENTER, DBUG_RETURN, and st_mysql_stmt::param_count.
02255 { 02256 DBUG_ENTER("mysql_stmt_param_metadata"); 02257 02258 if (!stmt->param_count) 02259 DBUG_RETURN(0); 02260 02261 /* 02262 TODO: Fix this when server sends the information. 02263 Till then keep a dummy prototype. 02264 */ 02265 DBUG_RETURN(0); 02266 }
| int STDCALL mysql_stmt_prepare | ( | MYSQL_STMT * | stmt, | |
| const char * | query, | |||
| unsigned long | length | |||
| ) |
Definition at line 2023 of file libmysql.c.
Referenced by dispatch_command(), mysql_simple_prepare(), open_cursor(), run_query_stmt(), stmt_fetch_init(), test_bug10729(), test_bug10736(), test_bug10760(), test_bug10794(), test_bug11037(), test_bug11111(), test_bug11172(), test_bug11183(), test_bug11656(), test_bug11904(), test_bug12243(), test_bug12744(), test_bug13488(), test_bug13524(), test_bug14169(), test_bug14210(), test_bug14845(), test_bug15510(), test_bug15613(), test_bug1664(), test_bug20152(), test_bug3035(), test_bug3796(), test_bug4026(), test_bug4030(), test_bug4079(), test_bug4172(), test_bug4231(), test_bug4236(), test_bug5126(), test_bug5194(), test_bug5315(), test_bug5399(), test_bug6046(), test_bug6049(), test_bug6058(), test_bug6059(), test_bug6096(), test_bug7990(), test_bug8330(), test_bug8722(), test_bug9159(), test_bug9643(), test_conversion(), test_left_join_view(), test_parse_error_and_bad_length(), test_ps_i18n(), test_rewind(), test_truncation(), test_truncation_option(), test_view(), test_view_2where(), test_view_insert(), test_view_insert_fields(), test_view_star(), and test_view_where().
02024 { 02025 MYSQL *mysql= stmt->mysql; 02026 DBUG_ENTER("mysql_stmt_prepare"); 02027 02028 if (!mysql) 02029 { 02030 /* mysql can be reset in mysql_close called from mysql_reconnect */ 02031 set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate); 02032 DBUG_RETURN(1); 02033 } 02034 02035 if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE) 02036 { 02037 /* This is second prepare with another statement */ 02038 char buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */ 02039 02040 if (reset_stmt_handle(stmt, RESET_LONG_DATA | RESET_STORE_RESULT)) 02041 DBUG_RETURN(1); 02042 /* 02043 These members must be reset for API to 02044 function in case of error or misuse. 02045 */ 02046 stmt->bind_param_done= stmt->bind_result_done= FALSE; 02047 stmt->param_count= stmt->field_count= 0; 02048 stmt->last_errno= 0; 02049 stmt->last_error[0]= '\0'; 02050 free_root(&stmt->mem_root, MYF(MY_KEEP_PREALLOC)); 02051 02052 int4store(buff, stmt->stmt_id); 02053 /* 02054 If there was a 'use' result from another statement, or from 02055 mysql_use_result it won't be freed in mysql_stmt_free_result and 02056 we should get 'Commands out of sync' here. 02057 */ 02058 if (stmt_command(mysql, COM_STMT_CLOSE, buff, 4, stmt)) 02059 { 02060 set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno, 02061 mysql->net.sqlstate); 02062 DBUG_RETURN(1); 02063 } 02064 stmt->state= MYSQL_STMT_INIT_DONE; 02065 } 02066 02067 if (stmt_command(mysql, COM_STMT_PREPARE, query, length, stmt)) 02068 { 02069 set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno, 02070 mysql->net.sqlstate); 02071 DBUG_RETURN(1); 02072 } 02073 02074 if ((*mysql->methods->read_prepare_result)(mysql, stmt)) 02075 { 02076 set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno, 02077 mysql->net.sqlstate); 02078 DBUG_RETURN(1); 02079 } 02080 02081 /* 02082 alloc_root will return valid address even in case when param_count 02083 and field_count are zero. Thus we should never rely on stmt->bind 02084 or stmt->params when checking for existence of placeholders or 02085 result set. 02086 */ 02087 if (!(stmt->params= (MYSQL_BIND *) alloc_root(&stmt->mem_root, 02088 sizeof(MYSQL_BIND)* 02089 (stmt->param_count + 02090 stmt->field_count)))) 02091 { 02092 set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate); 02093 DBUG_RETURN(1); 02094 } 02095 stmt->bind= stmt->params + stmt->param_count; 02096 stmt->state= MYSQL_STMT_PREPARE_DONE; 02097 DBUG_PRINT("info", ("Parameter count: %ld", stmt->param_count)); 02098 DBUG_RETURN(0); 02099 }
Here is the caller graph for this function:

| my_bool STDCALL mysql_stmt_reset | ( | MYSQL_STMT * | stmt | ) |
Definition at line 5039 of file libmysql.c.
Referenced by dispatch_command(), test_bug10794(), test_bug11172(), test_bug11183(), test_bug11909(), test_bug12744(), test_bug13488(), test_bug1664(), and test_bug9478().
05040 { 05041 DBUG_ENTER("mysql_stmt_reset"); 05042 DBUG_ASSERT(stmt != 0); 05043 if (!stmt->mysql) 05044 { 05045 /* mysql can be reset in mysql_close called from mysql_reconnect */ 05046 set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate); 05047 DBUG_RETURN(1); 05048 } 05049 /* Reset the client and server sides of the prepared statement */ 05050 DBUG_RETURN(reset_stmt_handle(stmt, RESET_SERVER_SIDE | RESET_LONG_DATA)); 05051 }
Here is the caller graph for this function:

| MYSQL_RES* STDCALL mysql_stmt_result_metadata | ( | MYSQL_STMT * | stmt | ) |
Definition at line 2207 of file libmysql.c.
References CR_OUT_OF_MEMORY, DBUG_ENTER, DBUG_RETURN, st_mysql_stmt::field_count, st_mysql_stmt::fields, st_mysql::methods, my_malloc(), MY_WME, MY_ZEROFILL, MYF, st_mysql_stmt::mysql, set_stmt_error(), and unknown_sqlstate.
Referenced by my_process_stmt_result(), run_query_stmt(), stmt_fetch_init(), test_bug14169(), test_bug15613(), test_bug6096(), test_explain_bug(), test_field_misc(), test_long_data_str1(), test_mem_overun(), test_prepare_field_result(), test_prepare_resultset(), and test_ts().
02208 { 02209 MYSQL_RES *result; 02210 DBUG_ENTER("mysql_stmt_result_metadata"); 02211 02212 /* 02213 stmt->fields is only defined if stmt->field_count is not null; 02214 stmt->field_count is initialized in prepare. 02215 */ 02216 if (!stmt->field_count) 02217 DBUG_RETURN(0); 02218 02219 if (!(result=(MYSQL_RES*) my_malloc(sizeof(*result), 02220 MYF(MY_WME | MY_ZEROFILL)))) 02221 { 02222 set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate); 02223 DBUG_RETURN(0); 02224 } 02225 02226 result->methods= stmt->mysql->methods; 02227 result->eof= 1; /* Marker for buffered */ 02228 result->fields= stmt->fields; 02229 result->field_count= stmt->field_count; 02230 /* The rest of members of 'result' was bzeroed inside malloc */ 02231 DBUG_RETURN(result); 02232 }
Here is the call graph for this function:

Here is the caller graph for this function:

| MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_seek | ( | MYSQL_STMT * | stmt, | |
| MYSQL_ROW_OFFSET | offset | |||
| ) |
Definition at line 4831 of file libmysql.c.
References st_mysql_stmt::data_cursor, DBUG_ENTER, DBUG_RETURN, and offset.
Referenced by test_fetch_seek().
04832 { 04833 MYSQL_ROW_OFFSET offset= stmt->data_cursor; 04834 DBUG_ENTER("mysql_stmt_row_seek"); 04835 04836 stmt->data_cursor= row; 04837 DBUG_RETURN(offset); 04838 }
Here is the caller graph for this function:

| MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_tell | ( | MYSQL_STMT * | stmt | ) |
Definition at line 4846 of file libmysql.c.
References st_mysql_stmt::data_cursor, DBUG_ENTER, and DBUG_RETURN.
Referenced by test_fetch_seek().
04847 { 04848 DBUG_ENTER("mysql_stmt_row_tell"); 04849 04850 DBUG_RETURN(stmt->data_cursor); 04851 }
Here is the caller graph for this function:

| my_bool STDCALL mysql_stmt_send_long_data | ( | MYSQL_STMT * | stmt, | |
| unsigned int | param_number, | |||
| const char * | data, | |||
| unsigned long | length | |||
| ) |
Definition at line 3316 of file libmysql.c.
References st_mysql_methods::advanced_command, st_mysql_bind::buffer_type, COM_STMT_SEND_LONG_DATA, CR_INVALID_BUFFER_USE, CR_INVALID_PARAMETER_NO, DBUG_ASSERT, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, ER, int2store, int4store, st_mysql_stmt::last_errno, st_net::last_errno, st_mysql_stmt::last_error, st_net::last_error, st_mysql_bind::long_data_used, st_mysql::methods, mysql, st_mysql_stmt::mysql, MYSQL_LONG_DATA_HEADER, MYSQL_TYPE_STRING, MYSQL_TYPE_TINY_BLOB, st_mysql::net, NULL, st_mysql_stmt::param_count, st_mysql_bind::param_number, st_mysql_stmt::params, set_stmt_errmsg(), set_stmt_error(), st_mysql_stmt::sqlstate, st_net::sqlstate, st_mysql_stmt::stmt_id, strmov(), and unknown_sqlstate.
Referenced by test_bug1664(), test_long_data(), test_long_data_bin(), test_long_data_str(), test_long_data_str1(), and test_ps_i18n().
03318 { 03319 MYSQL_BIND *param; 03320 DBUG_ENTER("mysql_stmt_send_long_data"); 03321 DBUG_ASSERT(stmt != 0); 03322 DBUG_PRINT("enter",("param no : %d, data : %lx, length : %ld", 03323 param_number, data, length)); 03324 03325 /* 03326 We only need to check for stmt->param_count, if it's not null 03327 prepare was done. 03328 */ 03329 if (param_number >= stmt->param_count) 03330 { 03331 set_stmt_error(stmt, CR_INVALID_P

