~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzleclient/local_infile.c

  • Committer: Monty Taylor
  • Date: 2009-02-08 11:11:30 UTC
  • mto: This revision was merged to the branch mainline in revision 852.
  • Revision ID: mordred@inaugust.com-20090208111130-futpwptxv5he3boe
Renamed non-prefixed things from libdrizzleclient to drizzleclient.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
 
59
59
#define MY_ALIGN(A,L)   (((A) + (L) - 1) & ~((L) - 1))
60
60
 
61
 
bool handle_local_infile(DRIZZLE *drizzle, const char *net_filename)
 
61
bool drizzleclient_handle_local_infile(DRIZZLE *drizzle, const char *net_filename)
62
62
{
63
63
  bool result= true;
64
64
  uint32_t packet_length=MY_ALIGN(drizzle->net.max_packet-16,IO_SIZE);
81
81
  /* copy filename into local memory and allocate read buffer */
82
82
  if (!(buf=malloc(packet_length)))
83
83
  {
84
 
    drizzle_set_error(drizzle, CR_OUT_OF_MEMORY, sqlstate_get_unknown());
 
84
    drizzle_set_error(drizzle, CR_OUT_OF_MEMORY, drizzleclient_sqlstate_get_unknown());
85
85
    return(1);
86
86
  }
87
87
 
90
90
    options->local_infile_userdata))
91
91
  {
92
92
    (void)drizzleclient_net_write(net,(const unsigned char*) "",0); /* Server needs one packet */
93
 
    net_flush(net);
94
 
    strcpy(net->sqlstate, sqlstate_get_unknown());
 
93
    drizzleclient_net_flush(net);
 
94
    strcpy(net->sqlstate, drizzleclient_sqlstate_get_unknown());
95
95
    net->last_errno=
96
96
      (*options->local_infile_error)(li_ptr,
97
97
                                     net->last_error,
111
111
  }
112
112
 
113
113
  /* Send empty packet to mark end of file */
114
 
  if (drizzleclient_net_write(net, (const unsigned char*) "", 0) || net_flush(net))
 
114
  if (drizzleclient_net_write(net, (const unsigned char*) "", 0) || drizzleclient_net_flush(net))
115
115
  {
116
 
    drizzle_set_error(drizzle, CR_SERVER_LOST, sqlstate_get_unknown());
 
116
    drizzle_set_error(drizzle, CR_SERVER_LOST, drizzleclient_sqlstate_get_unknown());
117
117
    goto err;
118
118
  }
119
119