~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/mysql_protocol/net_serv.h

  • Committer: Stewart Smith
  • Author(s): Marko Mäkelä, Stewart Smith
  • Date: 2010-11-17 05:52:09 UTC
  • mto: (2021.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1971.
  • Revision ID: stewart@flamingspork.com-20101117055209-69m035q6h7e1txrc
Merge Revision revid:marko.makela@oracle.com-20100629113248-fvl48lnzr44z94gg from MySQL InnoDB

Original revid:marko.makela@oracle.com-20100629113248-fvl48lnzr44z94gg

Original Authors: Marko Mkel <marko.makela@oracle.com>
Original commit message:
Bug#52199 utf32: mbminlen=4, mbmaxlen=4, type->mbminlen=0, type->mbmaxlen=4

Merge and adjust a forgotten change to fix this bug.
rb://393 approved by Jimmy Yang
  ------------------------------------------------------------------------
  r3794 | marko | 2009-01-07 14:14:53 +0000 (Wed, 07 Jan 2009) | 18 lines

  branches/6.0: Allow the minimum length of a multi-byte character to be
  up to 4 bytes. (Bug #35391)

  dtype_t, dict_col_t: Replace mbminlen:2, mbmaxlen:3 with mbminmaxlen:5.
  In this way, the 5 bits can hold two values of 0..4, and the storage size
  of the fields will not cross the 64-bit boundary.  Encode the values as
  DATA_MBMAX * mbmaxlen + mbminlen.  Define the auxiliary macros
  DB_MBMINLEN(mbminmaxlen), DB_MBMAXLEN(mbminmaxlen), and
  DB_MINMAXLEN(mbminlen, mbmaxlen).

  Try to trim and pad UTF-16 and UTF-32 with spaces as appropriate.

  Alexander Barkov suggested the use of cs->cset->fill(cs, buff, len, 0x20).
  ha_innobase::store_key_val_for_row() now does that, but the added function
  row_mysql_pad_col() does not, because it doesn't have the MySQL TABLE object.

  rb://49 approved by Heikki Tuuri
  ------------------------------------------------------------------------

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 */