~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Mark Atwood
  • Date: 2011-10-19 00:10:47 UTC
  • mfrom: (2440.2.13 rf)
  • Revision ID: me@mark.atwood.name-20111019001047-atj0u8gedphon1tb
mergeĀ lp:~olafvdspek/drizzle/refactor5

Show diffs side-by-side

added added

removed removed

Lines of Context:
796
796
bool add_field_to_list(Session *session, lex_string_t *field_name, enum_field_types type,
797
797
                       const char *length, const char *decimals,
798
798
                       uint32_t type_modifier, column_format_type column_format,
799
 
                       Item *default_value, Item *on_update_value, lex_string_t *comment,
 
799
                       Item *default_value, Item *on_update_value, str_ref comment,
800
800
                       const char *change, List<String> *interval_list, const charset_info_st* cs)
801
801
{
802
802
  LEX  *lex= &session->lex();
857
857
  }
858
858
 
859
859
  CreateField* new_field= new CreateField;
860
 
  if (new_field->init(session, field_name->data(), type, length, decimals, type_modifier, *comment, change, interval_list, cs, 0, column_format)
 
860
  if (new_field->init(session, field_name->data(), type, length, decimals, type_modifier, comment, change, interval_list, cs, 0, column_format)
861
861
      || new_field->setDefaultValue(default_value, on_update_value))
862
862
    return true;
863
863
 
911
911
  if (not table->is_derived_table() && table->db.data())
912
912
  {
913
913
    my_casedn_str(files_charset_info, table->db.str_);
914
 
    if (not schema::check(*session, identifier::Schema(table->db.data())))
 
914
    if (not schema::check(*session, identifier::Schema(table->db)))
915
915
    {
916
916
      my_error(ER_WRONG_DB_NAME, MYF(0), table->db.data());
917
917
      return NULL;
1549
1549
*/
1550
1550
 
1551
1551
 
1552
 
bool check_string_char_length(lex_string_t *str, const char *err_msg,
 
1552
bool check_string_char_length(str_ref str, const char *err_msg,
1553
1553
                              uint32_t max_char_length, const charset_info_st * const cs,
1554
1554
                              bool no_error)
1555
1555
{
1556
1556
  int well_formed_error;
1557
 
  uint32_t res= cs->cset->well_formed_len(cs, str->begin(), str->end(), max_char_length, &well_formed_error);
 
1557
  uint32_t res= cs->cset->well_formed_len(cs, str.begin(), str.end(), max_char_length, &well_formed_error);
1558
1558
 
1559
 
  if (!well_formed_error &&  str->size() == res)
 
1559
  if (!well_formed_error &&  str.size() == res)
1560
1560
    return false;
1561
1561
 
1562
1562
  if (!no_error)
1563
 
    my_error(ER_WRONG_STRING_LENGTH, MYF(0), str->data(), err_msg, max_char_length);
 
1563
    my_error(ER_WRONG_STRING_LENGTH, MYF(0), str.data(), err_msg, max_char_length);
1564
1564
  return true;
1565
1565
}
1566
1566
 
1567
1567
 
1568
 
bool check_identifier_name(lex_string_t str, error_t err_code)
 
1568
bool check_identifier_name(str_ref str, error_t err_code)
1569
1569
{
1570
1570
  uint32_t max_char_length= NAME_CHAR_LEN;
1571
1571
  /*