300
300
return con->sqlstate;
303
drizzle_options_t drizzle_options(const drizzle_st *con)
307
return DRIZZLE_CON_NONE;
310
return drizzle_options_t(con->options);
313
void drizzle_set_options(drizzle_st *con,
314
drizzle_options_t options)
321
con->options= options;
324
void drizzle_add_options(drizzle_st *con,
325
drizzle_options_t options)
332
con->options = (drizzle_options_t)((int)con->options | (int)options);
335
void drizzle_remove_options(drizzle_st *con,
336
drizzle_options_t options)
343
con->options = (drizzle_options_t)((int) con->options & (int)~options);
303
drizzle_options_st *drizzle_options_create(void)
305
return new (std::nothrow) drizzle_options_st;
308
void drizzle_options_destroy(drizzle_options_st *options)
313
void drizzle_options_set_non_blocking(drizzle_options_st *options, bool state)
319
options->non_blocking= state;
322
bool drizzle_options_get_non_blocking(drizzle_options_st *options)
328
return options->non_blocking;
331
void drizzle_options_set_raw_scramble(drizzle_options_st *options, bool state)
337
options->raw_scramble= state;
340
bool drizzle_options_get_raw_scramble(drizzle_options_st *options)
346
return options->raw_scramble;
349
void drizzle_options_set_found_rows(drizzle_options_st *options, bool state)
355
options->found_rows= state;
358
bool drizzle_options_get_found_rows(drizzle_options_st *options)
364
return options->found_rows;
367
void drizzle_options_set_interactive(drizzle_options_st *options, bool state)
373
options->interactive= state;
376
bool drizzle_options_get_interactive(drizzle_options_st *options)
382
return options->interactive;
385
void drizzle_options_set_multi_statements(drizzle_options_st *options, bool state)
391
options->multi_statements= state;
394
bool drizzle_options_get_multi_statements(drizzle_options_st *options)
400
return options->multi_statements;
403
void drizzle_options_set_auth_plugin(drizzle_options_st *options, bool state)
409
options->auth_plugin= state;
412
bool drizzle_options_get_auth_plugin(drizzle_options_st *options)
418
return options->auth_plugin;
346
421
const char *drizzle_host(const drizzle_st *con)
610
685
return DRIZZLE_RETURN_INVALID_ARGUMENT;
613
if (con->options & DRIZZLE_CON_READY)
688
if (con->state.ready)
615
690
return DRIZZLE_RETURN_OK;
618
693
if (drizzle_state_none(con))
620
if (!(con->options & DRIZZLE_CON_RAW_PACKET))
695
if (con->state.raw_packet == false)
622
697
drizzle_state_push(con, drizzle_state_handshake_server_read);
623
698
drizzle_state_push(con, drizzle_state_packet_read);
722
797
drizzle_result_st *old_result;
724
if (!(con->options & DRIZZLE_CON_READY))
799
if (con->state.ready == false)
726
if (con->options & DRIZZLE_CON_RAW_PACKET)
801
if (con->state.raw_packet)
728
803
drizzle_set_error(con, "drizzle_command_write",
729
804
"connection not ready");
1135
1210
if ((con->revents & POLLIN) == 0 &&
1136
(con->options & DRIZZLE_CON_OPTIONS_NON_BLOCKING))
1211
(con->options.non_blocking))
1138
1213
/* non-blocking mode: return IO_WAIT instead of attempting to read. This
1139
1214
* avoids reading immediately after writing a command, which typically