~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/set_user_var.cc

  • Committer: Jay Pipes
  • Date: 2009-09-21 14:33:44 UTC
  • mfrom: (1126.10.26 dtrace-probes)
  • mto: This revision was merged to the branch mainline in revision 1133.
  • Revision ID: jpipes@serialcoder-20090921143344-jnarp7gcn6zmg19c
Merge fixes from Trond and Padraig on dtrace probes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include "config.h"
21
 
 
 
20
#include <drizzled/server_includes.h>
 
21
#include CSTDINT_H
22
22
#include <drizzled/function/set_user_var.h>
23
23
#include <drizzled/field/num.h>
24
24
#include <drizzled/session.h>
25
 
#include <drizzled/plugin/client.h>
26
25
 
27
 
namespace drizzled
28
 
{
 
26
using namespace drizzled;
29
27
 
30
28
/*
31
29
  When a user variable is updated (in a SET command or a query like
44
42
     if this variable is a constant item in the query (it is if update_query_id
45
43
     is different from query_id).
46
44
  */
47
 
  entry->update_query_id= session->getQueryId();
 
45
  entry->update_query_id= session->query_id;
48
46
  /*
49
47
    As it is wrong and confusing to associate any
50
48
    character set with NULL, @a should be latin2
316
314
  str->append(')');
317
315
}
318
316
 
319
 
bool Item_func_set_user_var::send(plugin::Client *client, String *str_arg)
 
317
 
 
318
void Item_func_set_user_var::print_as_stmt(String *str,
 
319
                                           enum_query_type query_type)
 
320
{
 
321
  str->append(STRING_WITH_LEN("set @"));
 
322
  str->append(name.str, name.length);
 
323
  str->append(STRING_WITH_LEN(":="));
 
324
  args[0]->print(str, query_type);
 
325
  str->append(')');
 
326
}
 
327
 
 
328
bool Item_func_set_user_var::send(plugin::Protocol *protocol, String *str_arg)
320
329
{
321
330
  if (result_field)
322
331
  {
323
332
    check(1);
324
333
    update();
325
 
    return client->store(result_field);
 
334
    return protocol->store(result_field);
326
335
  }
327
 
  return Item::send(client, str_arg);
 
336
  return Item::send(protocol, str_arg);
328
337
}
329
338
 
330
339
void Item_func_set_user_var::make_field(SendField *tmp_field)
439
448
}
440
449
 
441
450
 
442
 
} /* namespace drizzled */