~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/get_user_var.cc

  • Committer: Monty Taylor
  • Date: 2010-06-02 22:35:45 UTC
  • mto: This revision was merged to the branch mainline in revision 1586.
  • Revision ID: mordred@inaugust.com-20100602223545-q8ekf9b40a85nwuf
Rearragned unittests into a single exe because of how we need to link it
(thanks lifeless)
Link with server symbols without needing to build a library.
Added an additional atomics test which tests whatever version of the atomics
lib the running platform would actually use.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
 
66
66
void Item_func_get_user_var::fix_length_and_dec()
67
67
{
 
68
  Session *session=current_session;
68
69
  maybe_null=1;
69
70
  decimals=NOT_FIXED_DEC;
70
71
  max_length=MAX_BLOB_WIDTH;
71
72
 
72
 
  var_entry= session.getVariable(name, false);
 
73
  var_entry= session->getVariable(name, false);
73
74
 
74
75
  /*
75
76
    If the variable didn't exist it has been created as a STRING-type.
88
89
    case REAL_RESULT:
89
90
      max_length= DBL_DIG + 8;
90
91
      break;
91
 
 
92
92
    case INT_RESULT:
93
93
      max_length= MAX_BIGINT_WIDTH;
94
94
      decimals=0;
96
96
    case STRING_RESULT:
97
97
      max_length= MAX_BLOB_WIDTH;
98
98
      break;
99
 
 
100
99
    case DECIMAL_RESULT:
101
100
      max_length= DECIMAL_MAX_STR_LENGTH;
102
101
      decimals= DECIMAL_MAX_SCALE;
103
102
      break;
104
 
 
105
103
    case ROW_RESULT:                            // Keep compiler happy
 
104
    default:
106
105
      assert(0);
107
106
      break;
108
107
    }
119
118
 
120
119
bool Item_func_get_user_var::const_item() const
121
120
{
122
 
  return (!var_entry || session.getQueryId() != var_entry->update_query_id);
 
121
  return (!var_entry || current_session->getQueryId() != var_entry->update_query_id);
123
122
}
124
123
 
125
124