~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/utility_functions/schema.cc

  • Committer: Barry.Leslie at PrimeBase
  • Date: 2011-01-22 03:22:44 UTC
  • mfrom: (2101 staging)
  • mto: (2228.1.4 build)
  • mto: This revision was merged to the branch mainline in revision 2230.
  • Revision ID: barry.leslie@primebase.com-20110122032244-ukbe3mlj7fs8xph6
Merged with lp:drizzle.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
 
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
5
5
 *  Copyright (C) 2010 Stewart Smith
6
6
 *
7
7
 *  This program is free software; you can redistribute it and/or modify
32
32
String *Schema::val_str(String *str)
33
33
{
34
34
  assert(fixed == 1);
35
 
  Session *session= current_session;
36
 
  if (session->db.empty())
 
35
  util::string::const_shared_ptr schema= getSession().schema();
 
36
  if (not schema or schema->empty())
37
37
  {
38
38
    null_value= 1;
39
39
    return 0;
40
40
  }
41
 
  else
42
 
  {
43
 
    str->copy(session->db.c_str(), session->db.length(), system_charset_info);
44
 
  }
 
41
 
 
42
  str->copy(*schema, system_charset_info);
 
43
 
45
44
  return str;
46
45
}
47
46