Loading mysql-test/t/log.sh +1 −1 Original line number Diff line number Diff line #!/bin/bash #!/bin/sh ########################################################################### Loading server-tools/instance-manager/listener.cc +5 −5 Original line number Diff line number Diff line Loading @@ -188,7 +188,7 @@ void Listener_thread::run() else { shutdown(client_fd, SHUT_RDWR); close(client_fd); closesocket(client_fd); } } } Loading @@ -200,7 +200,7 @@ void Listener_thread::run() log_info("Listener_thread::run(): shutdown requested, exiting..."); for (i= 0; i < num_sockets; i++) close(sockets[i]); closesocket(sockets[i]); #ifndef __WIN__ unlink(unix_socket_address.sun_path); Loading @@ -213,7 +213,7 @@ void Listener_thread::run() err: // we have to close the ip sockets in case of error for (i= 0; i < num_sockets; i++) close(sockets[i]); closesocket(sockets[i]); thread_registry.unregister_thread(&thread_info); thread_registry.request_shutdown(); Loading Loading @@ -260,7 +260,7 @@ int Listener_thread::create_tcp_socket() { log_error("Listener_thread::run(): bind(ip socket) failed, '%s'", strerror(errno)); close(ip_socket); closesocket(ip_socket); return -1; } Loading @@ -268,7 +268,7 @@ int Listener_thread::create_tcp_socket() { log_error("Listener_thread::run(): listen(ip socket) failed, %s", strerror(errno)); close(ip_socket); closesocket(ip_socket); return -1; } Loading sql/sql_class.cc +14 −0 Original line number Diff line number Diff line Loading @@ -885,6 +885,13 @@ void select_result::cleanup() /* do nothing */ } bool select_result::check_simple_select() const { my_error(ER_SP_BAD_CURSOR_QUERY, MYF(0)); return TRUE; } static String default_line_term("\n",default_charset_info); static String default_escaped("\\",default_charset_info); static String default_field_term("\t",default_charset_info); Loading Loading @@ -1553,6 +1560,13 @@ int select_dumpvar::prepare(List<Item> &list, SELECT_LEX_UNIT *u) } bool select_dumpvar::check_simple_select() const { my_error(ER_SP_BAD_CURSOR_SELECT, MYF(0)); return TRUE; } void select_dumpvar::cleanup() { vars.empty(); Loading sql/sql_class.h +10 −2 Original line number Diff line number Diff line Loading @@ -1724,7 +1724,14 @@ class select_result :public Sql_alloc { virtual bool initialize_tables (JOIN *join=0) { return 0; } virtual void send_error(uint errcode,const char *err); virtual bool send_eof()=0; virtual bool simple_select() { return 0; } /** Check if this query returns a result set and therefore is allowed in cursors and set an error message if it is not the case. @retval FALSE success @retval TRUE error, an error message is set */ virtual bool check_simple_select() const; virtual void abort() {} /* Cleanup instance of this class for next execution of a prepared Loading Loading @@ -1762,7 +1769,7 @@ class select_send :public select_result { bool send_fields(List<Item> &list, uint flags); bool send_data(List<Item> &items); bool send_eof(); bool simple_select() { return 1; } virtual bool check_simple_select() const { return FALSE; } void abort(); }; Loading Loading @@ -2202,6 +2209,7 @@ class select_dumpvar :public select_result_interceptor { int prepare(List<Item> &list, SELECT_LEX_UNIT *u); bool send_data(List<Item> &items); bool send_eof(); virtual bool check_simple_select() const; void cleanup(); }; Loading sql/sql_prepare.cc +1 −2 Original line number Diff line number Diff line Loading @@ -2906,10 +2906,9 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) in INSERT ... SELECT and similar commands. */ if (open_cursor && lex->result && !lex->result->simple_select()) if (open_cursor && lex->result && lex->result->check_simple_select()) { DBUG_PRINT("info",("Cursor asked for not SELECT stmt")); my_error(ER_SP_BAD_CURSOR_QUERY, MYF(0)); return TRUE; } Loading Loading
mysql-test/t/log.sh +1 −1 Original line number Diff line number Diff line #!/bin/bash #!/bin/sh ########################################################################### Loading
server-tools/instance-manager/listener.cc +5 −5 Original line number Diff line number Diff line Loading @@ -188,7 +188,7 @@ void Listener_thread::run() else { shutdown(client_fd, SHUT_RDWR); close(client_fd); closesocket(client_fd); } } } Loading @@ -200,7 +200,7 @@ void Listener_thread::run() log_info("Listener_thread::run(): shutdown requested, exiting..."); for (i= 0; i < num_sockets; i++) close(sockets[i]); closesocket(sockets[i]); #ifndef __WIN__ unlink(unix_socket_address.sun_path); Loading @@ -213,7 +213,7 @@ void Listener_thread::run() err: // we have to close the ip sockets in case of error for (i= 0; i < num_sockets; i++) close(sockets[i]); closesocket(sockets[i]); thread_registry.unregister_thread(&thread_info); thread_registry.request_shutdown(); Loading Loading @@ -260,7 +260,7 @@ int Listener_thread::create_tcp_socket() { log_error("Listener_thread::run(): bind(ip socket) failed, '%s'", strerror(errno)); close(ip_socket); closesocket(ip_socket); return -1; } Loading @@ -268,7 +268,7 @@ int Listener_thread::create_tcp_socket() { log_error("Listener_thread::run(): listen(ip socket) failed, %s", strerror(errno)); close(ip_socket); closesocket(ip_socket); return -1; } Loading
sql/sql_class.cc +14 −0 Original line number Diff line number Diff line Loading @@ -885,6 +885,13 @@ void select_result::cleanup() /* do nothing */ } bool select_result::check_simple_select() const { my_error(ER_SP_BAD_CURSOR_QUERY, MYF(0)); return TRUE; } static String default_line_term("\n",default_charset_info); static String default_escaped("\\",default_charset_info); static String default_field_term("\t",default_charset_info); Loading Loading @@ -1553,6 +1560,13 @@ int select_dumpvar::prepare(List<Item> &list, SELECT_LEX_UNIT *u) } bool select_dumpvar::check_simple_select() const { my_error(ER_SP_BAD_CURSOR_SELECT, MYF(0)); return TRUE; } void select_dumpvar::cleanup() { vars.empty(); Loading
sql/sql_class.h +10 −2 Original line number Diff line number Diff line Loading @@ -1724,7 +1724,14 @@ class select_result :public Sql_alloc { virtual bool initialize_tables (JOIN *join=0) { return 0; } virtual void send_error(uint errcode,const char *err); virtual bool send_eof()=0; virtual bool simple_select() { return 0; } /** Check if this query returns a result set and therefore is allowed in cursors and set an error message if it is not the case. @retval FALSE success @retval TRUE error, an error message is set */ virtual bool check_simple_select() const; virtual void abort() {} /* Cleanup instance of this class for next execution of a prepared Loading Loading @@ -1762,7 +1769,7 @@ class select_send :public select_result { bool send_fields(List<Item> &list, uint flags); bool send_data(List<Item> &items); bool send_eof(); bool simple_select() { return 1; } virtual bool check_simple_select() const { return FALSE; } void abort(); }; Loading Loading @@ -2202,6 +2209,7 @@ class select_dumpvar :public select_result_interceptor { int prepare(List<Item> &list, SELECT_LEX_UNIT *u); bool send_data(List<Item> &items); bool send_eof(); virtual bool check_simple_select() const; void cleanup(); }; Loading
sql/sql_prepare.cc +1 −2 Original line number Diff line number Diff line Loading @@ -2906,10 +2906,9 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) in INSERT ... SELECT and similar commands. */ if (open_cursor && lex->result && !lex->result->simple_select()) if (open_cursor && lex->result && lex->result->check_simple_select()) { DBUG_PRINT("info",("Cursor asked for not SELECT stmt")); my_error(ER_SP_BAD_CURSOR_QUERY, MYF(0)); return TRUE; } Loading