~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle-1.0/query.c

  • Committer: Brian Aker
  • Date: 2011-11-04 21:06:16 UTC
  • mto: This revision was merged to the branch mainline in revision 2450.
  • Revision ID: brian@tangent.org-20111104210616-2at42agch94dkwb0
Additional fixes for libdrizzle.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 * @brief Query definitions
40
40
 */
41
41
 
42
 
#include <libdrizzle-1.0/common.h>
 
42
#include "common.h"
43
43
 
44
44
drizzle_result_st *drizzle_query(drizzle_con_st *con, drizzle_result_st *result,
45
45
                                 const char *query, size_t size,
97
97
{
98
98
  if (query == NULL)
99
99
  {
100
 
    query= new (std::nothrow) drizzle_query_st;
 
100
    query= malloc(sizeof(drizzle_query_st));
101
101
    if (query == NULL)
102
102
    {
103
103
      drizzle_set_error(drizzle, "drizzle_query_create", "malloc");
181
181
 
182
182
drizzle_query_options_t drizzle_query_options(drizzle_query_st *query)
183
183
{
184
 
  return drizzle_query_options_t(query->options);
 
184
  return query->options;
185
185
}
186
186
 
187
187
void drizzle_query_set_options(drizzle_query_st *query,
259
259
drizzle_query_st *drizzle_query_run(drizzle_st *drizzle,
260
260
                                    drizzle_return_t *ret_ptr)
261
261
{
262
 
  int options;
 
262
  drizzle_options_t options;
263
263
  drizzle_query_st *query;
264
264
  drizzle_con_st *con;
265
265
 
269
269
    return NULL;
270
270
  }
271
271
 
272
 
  options= int(drizzle->options);
273
 
  drizzle->options|= int(DRIZZLE_NON_BLOCKING);
 
272
  options= drizzle->options;
 
273
  drizzle->options|= DRIZZLE_NON_BLOCKING;
274
274
 
275
275
  /* Check to see if any queries need to be started. */
276
276
  if (drizzle->query_new > 0)
290
290
      {
291
291
        assert(query->state == DRIZZLE_QUERY_STATE_DONE);
292
292
        drizzle->query_running--;
293
 
        drizzle->options= int(options);
 
293
        drizzle->options= options;
294
294
        query->con->query= NULL;
295
295
        if (*ret_ptr == DRIZZLE_RETURN_ERROR_CODE || *ret_ptr == DRIZZLE_RETURN_OK)
296
296
        {