~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/mysql_protocol/net_serv.h

  • Committer: Prafulla Tekawade
  • Date: 2010-07-18 03:36:32 UTC
  • mto: (1662.1.4 rollup)
  • mto: This revision was merged to the branch mainline in revision 1664.
  • Revision ID: prafulla_t@users.sourceforge.net-20100718033632-p7q6qtgliqbhe38p
Fix for Bug 592444

There were two problems:
o. In greedy_search optimizer method, best_extension_by_limited search
   maintains join embedding(nestedness) of tables added so far, so that 
   correct(valid)  join order is selected
   These are requirements from nested outer join executioner.
   The problem was, embedding_map was not correctly updated when a table 
   is added to optimal plan outside best_extension_by_limited search, 
   by greedy_search method. We need to update join->cur_embedding_map
   correctly here so that execution plan for other tables get
   generated.
   Invoked checked_interleaving_with_nj from greedy_search on the
   best_table selected. Fixed its prototype to take only one JoinTab
   This is same as mysql 5.1 source tree.
o. The other problem was, join->cur_embedding_map was not restored correctly
   when a table is added to the optimal plan to reflect the current embedding 
   map. 
   Taken good documented method restore_prev_nj_state which restores 
   cur_embedding_map from mysql 5.1 source tree and modified it for drizzled 
   code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#include "vio.h"
25
25
 
 
26
#include <stdint.h>
 
27
 
26
28
#define LIBDRIZZLE_ERRMSG_SIZE 512
27
29
#define LIBDRIZZLE_SQLSTATE_LENGTH 5
28
30
 
29
 
namespace drizzle_plugin
30
 
{
 
31
#ifdef __cplusplus
 
32
extern "C" {
 
33
#endif
31
34
 
32
35
typedef struct st_net {
33
36
  Vio *vio;
66
69
  void *extension;
67
70
} NET;
68
71
 
69
 
bool drizzleclient_net_init(NET *net, Vio* vio, uint32_t buffer_length);
70
 
void drizzleclient_net_end(NET *net);
71
 
void drizzleclient_net_clear(NET *net, bool clear_buffer);
72
 
bool drizzleclient_net_flush(NET *net);
73
 
bool drizzleclient_net_write(NET *net,const unsigned char *packet, size_t len);
74
 
bool drizzleclient_net_write_command(NET *net,unsigned char command,
75
 
                                     const unsigned char *header, size_t head_len,
76
 
                                     const unsigned char *packet, size_t len);
77
 
uint32_t drizzleclient_net_read(NET *net);
78
 
void drizzleclient_net_close(NET *net);
79
 
bool drizzleclient_net_init_sock(NET * net, int sock, uint32_t buffer_length);
80
 
bool drizzleclient_net_peer_addr(NET *net, char *buf, uint16_t *port, size_t buflen);
81
 
void drizzleclient_net_keepalive(NET *net, bool flag);
82
 
int drizzleclient_net_get_sd(NET *net);
83
 
bool drizzleclient_net_more_data(NET *net);
84
 
 
85
 
void drizzleclient_net_set_write_timeout(NET *net, uint32_t timeout);
86
 
void drizzleclient_net_set_read_timeout(NET *net, uint32_t timeout);
87
 
void drizzleclient_drizzleclient_net_clear_error(NET *net);
88
 
 
89
 
} /* namespace drizzle_plugin */
 
72
  bool drizzleclient_net_init(NET *net, Vio* vio, uint32_t buffer_length);
 
73
  void drizzleclient_net_end(NET *net);
 
74
  void drizzleclient_net_clear(NET *net, bool clear_buffer);
 
75
  bool drizzleclient_net_flush(NET *net);
 
76
  bool drizzleclient_net_write(NET *net,const unsigned char *packet, size_t len);
 
77
  bool drizzleclient_net_write_command(NET *net,unsigned char command,
 
78
                         const unsigned char *header, size_t head_len,
 
79
                         const unsigned char *packet, size_t len);
 
80
  uint32_t drizzleclient_net_read(NET *net);
 
81
  void drizzleclient_net_close(NET *net);
 
82
  bool drizzleclient_net_init_sock(NET * net, int sock, uint32_t buffer_length);
 
83
  bool drizzleclient_net_peer_addr(NET *net, char *buf, uint16_t *port, size_t buflen);
 
84
  void drizzleclient_net_keepalive(NET *net, bool flag);
 
85
  int drizzleclient_net_get_sd(NET *net);
 
86
  bool drizzleclient_net_more_data(NET *net);
 
87
 
 
88
  void drizzleclient_net_set_write_timeout(NET *net, uint32_t timeout);
 
89
  void drizzleclient_net_set_read_timeout(NET *net, uint32_t timeout);
 
90
  void drizzleclient_drizzleclient_net_clear_error(NET *net);
 
91
 
 
92
#ifdef __cplusplus
 
93
}
 
94
#endif
90
95
 
91
96
#endif /* PLUGIN_MYSQL_PROTOCOL_NET_SERV_H */