~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_connect.cc

enable remaining subselect tests, merge with latest from the trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
173
173
  free((char*) uc);
174
174
}
175
175
 
176
 
void session_init_client_charset(Session *session, uint32_t cs_number)
177
 
{
178
 
  /*
179
 
   Use server character set and collation if
180
 
   - opt_character_set_client_handshake is not set
181
 
   - client has not specified a character set
182
 
   - client character set is the same as the servers
183
 
   - client character set doesn't exists in server
184
 
  */
185
 
  if (!opt_character_set_client_handshake ||
186
 
      !(session->variables.character_set_client= get_charset(cs_number, MYF(0))) ||
187
 
      !my_strcasecmp(&my_charset_utf8_general_ci,
188
 
                     global_system_variables.character_set_client->name,
189
 
                     session->variables.character_set_client->name))
190
 
  {
191
 
    session->variables.character_set_client=
192
 
      global_system_variables.character_set_client;
193
 
    session->variables.collation_connection=
194
 
      global_system_variables.collation_connection;
195
 
    session->variables.character_set_results=
196
 
      global_system_variables.character_set_results;
197
 
  }
198
 
  else
199
 
  {
200
 
    session->variables.character_set_results=
201
 
      session->variables.collation_connection=
202
 
      session->variables.character_set_client;
203
 
  }
204
 
}
205
 
 
206
 
 
207
176
/*
208
177
  Initialize connection threads
209
178
*/
262
231
    server_capabilites|= CLIENT_COMPRESS;
263
232
#endif /* HAVE_COMPRESS */
264
233
 
265
 
    end= strncpy(buff, server_version, SERVER_VERSION_LENGTH);
266
 
    end+= SERVER_VERSION_LENGTH+1;
 
234
    end= buff + strlen(server_version);
 
235
    if ((end - buff) >= SERVER_VERSION_LENGTH)
 
236
      end= buff + (SERVER_VERSION_LENGTH - 1);
 
237
    memcpy(buff, server_version, end - buff);
 
238
    *end= 0;
 
239
    end++;
267
240
 
268
241
    int4store((unsigned char*) end, session->thread_id);
269
242
    end+= 4;
311
284
 
312
285
  session->client_capabilities|= ((uint32_t) uint2korr(net->read_pos+2)) << 16;
313
286
  session->max_client_packet_length= uint4korr(net->read_pos+4);
314
 
  session_init_client_charset(session, (uint) net->read_pos[8]);
315
287
  session->update_charset();
316
288
  end= (char*) net->read_pos+32;
317
289