~drizzle-trunk/libdrizzle/jenkins-Libdrizzle-106

« back to all changes in this revision

Viewing changes to libdrizzle/result.h

  • Committer: Continuous Integration
  • Date: 2013-01-27 14:14:15 UTC
  • mfrom: (99.1.9 update-copyright-headers)
  • Revision ID: ci@drizzle.org-20130127141415-y4ywdlbqlvme08y5
Merge lp:~linuxjedi/libdrizzle/update-copyright-headers Build: jenkins-Libdrizzle-66

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
 
2
 *
 
3
 * Drizzle Client & Protocol Library
 
4
 *
 
5
 * Copyright (C) 2013 Drizzle Developer Group
 
6
 * All rights reserved.
 
7
 *
 
8
 * Redistribution and use in source and binary forms, with or without
 
9
 * modification, are permitted provided that the following conditions are
 
10
 * met:
 
11
 *
 
12
 *     * Redistributions of source code must retain the above copyright
 
13
 * notice, this list of conditions and the following disclaimer.
 
14
 *
 
15
 *     * Redistributions in binary form must reproduce the above
 
16
 * copyright notice, this list of conditions and the following disclaimer
 
17
 * in the documentation and/or other materials provided with the
 
18
 * distribution.
 
19
 *
 
20
 *     * The names of its contributors may not be used to endorse or
 
21
 * promote products derived from this software without specific prior
 
22
 * written permission.
 
23
 *
 
24
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
25
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 
26
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 
27
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 
28
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
29
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 
30
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 
31
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 
32
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
33
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
34
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
35
 *
 
36
 */
 
37
 
 
38
 
 
39
#pragma once
 
40
 
 
41
/**
 
42
 * @ingroup drizzle_result
 
43
 */
 
44
struct drizzle_result_st
 
45
{
 
46
  drizzle_st *con;
 
47
  drizzle_result_st *next;
 
48
  drizzle_result_st *prev;
 
49
  drizzle_result_options_t options;
 
50
 
 
51
  char info[DRIZZLE_MAX_INFO_SIZE];
 
52
  uint16_t error_code;
 
53
  char sqlstate[DRIZZLE_MAX_SQLSTATE_SIZE + 1];
 
54
  uint64_t insert_id;
 
55
  uint16_t warning_count;
 
56
  uint64_t affected_rows;
 
57
 
 
58
  uint16_t column_count;
 
59
  uint16_t column_current;
 
60
  drizzle_column_st *column_list;
 
61
  drizzle_column_st *column;
 
62
  drizzle_column_st *column_buffer;
 
63
 
 
64
  uint64_t row_count;
 
65
  uint64_t row_current;
 
66
 
 
67
  uint16_t field_current;
 
68
  size_t field_total;
 
69
  size_t field_offset;
 
70
  size_t field_size;
 
71
  drizzle_field_t field;
 
72
  drizzle_field_t field_buffer;
 
73
 
 
74
  uint64_t row_list_size;
 
75
  drizzle_row_t row;
 
76
  drizzle_row_t *row_list;
 
77
  size_t *field_sizes;
 
78
  size_t **field_sizes_list;
 
79
  drizzle_binlog_st *binlog_event;
 
80
  bool binlog_checksums;
 
81
  uint8_t **null_bitmap_list;
 
82
  uint8_t *null_bitmap;
 
83
  uint8_t null_bitmap_length;
 
84
  bool binary_rows;
 
85
 
 
86
  drizzle_result_st() :
 
87
    con(NULL),
 
88
    next(NULL),
 
89
    prev(NULL),
 
90
    options(DRIZZLE_RESULT_NONE),
 
91
    error_code(0),
 
92
    insert_id(0),
 
93
    warning_count(0),
 
94
    affected_rows(0),
 
95
    column_count(0),
 
96
    column_current(0),
 
97
    column_list(NULL),
 
98
    column(NULL),
 
99
    column_buffer(NULL),
 
100
    row_count(0),
 
101
    row_current(0),
 
102
    field_current(0),
 
103
    field_total(0),
 
104
    field_offset(0),
 
105
    field_size(0),
 
106
    field(NULL),
 
107
    field_buffer(NULL),
 
108
    row_list_size(0),
 
109
    row(NULL),
 
110
    row_list(NULL),
 
111
    field_sizes(NULL),
 
112
    field_sizes_list(NULL),
 
113
    binlog_event(NULL),
 
114
    binlog_checksums(false),
 
115
    null_bitmap_list(NULL),
 
116
    null_bitmap(NULL),
 
117
    null_bitmap_length(0),
 
118
    binary_rows(false)
 
119
  {
 
120
    info[0]= '\0';
 
121
    sqlstate[0]= '\0';
 
122
  }
 
123
 
 
124
  bool push_state(drizzle_state_fn* func_)
 
125
  {
 
126
    if (con)
 
127
    {
 
128
      return con->push_state(func_);
 
129
    }
 
130
 
 
131
    return false;
 
132
  }
 
133
 
 
134
  bool has_state() const
 
135
  {
 
136
    if (con)
 
137
    {
 
138
      return con->has_state();
 
139
    }
 
140
 
 
141
    return false;
 
142
  }
 
143
};