~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.cc

  • Committer: Monty Taylor
  • Date: 2009-01-05 22:31:09 UTC
  • mfrom: (755.2.2 drizzle-work)
  • mto: This revision was merged to the branch mainline in revision 759.
  • Revision ID: mordred@inaugust.com-20090105223109-fhqvb830ftho6r6i
MergedĀ fromĀ Mark.

Show diffs side-by-side

added added

removed removed

Lines of Context:
499
499
    if (use_mb(default_charset_info))
500
500
    {
501
501
      /* Warn that we may be changing the size of character columns */
502
 
      sql_print_warning(_("'%s' had no or invalid character set, "
 
502
      errmsg_printf(ERRMSG_LVL_WARN, _("'%s' had no or invalid character set, "
503
503
                        "and default character set is multi-byte, "
504
504
                        "so character column sizes may have changed"),
505
505
                        share->path.str);
2656
2656
    /* previous MySQL version */
2657
2657
    if (DRIZZLE_VERSION_ID > s->mysql_version)
2658
2658
    {
2659
 
      sql_print_error(ER(ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE),
 
2659
      errmsg_printf(ERRMSG_LVL_ERROR, ER(ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE),
2660
2660
                      alias, table_f_count, s->fields,
2661
2661
                      s->mysql_version, DRIZZLE_VERSION_ID);
2662
2662
      return(true);
2663
2663
    }
2664
2664
    else if (DRIZZLE_VERSION_ID == s->mysql_version)
2665
2665
    {
2666
 
      sql_print_error(ER(ER_COL_COUNT_DOESNT_MATCH_CORRUPTED), alias,
 
2666
      errmsg_printf(ERRMSG_LVL_ERROR, ER(ER_COL_COUNT_DOESNT_MATCH_CORRUPTED), alias,
2667
2667
                      table_f_count, s->fields);
2668
2668
      return(true);
2669
2669
    }
2692
2692
          Still this can be a sign of a tampered table, output an error
2693
2693
          to the error log.
2694
2694
        */
2695
 
        sql_print_error(_("Incorrect definition of table %s.%s: "
 
2695
        errmsg_printf(ERRMSG_LVL_ERROR, _("Incorrect definition of table %s.%s: "
2696
2696
                        "expected column '%s' at position %d, found '%s'."),
2697
2697
                        s->db.str, alias, table_def->name.str, i,
2698
2698
                        field->field_name);
2718
2718
      if (strncmp(sql_type.c_ptr_safe(), table_def->type.str,
2719
2719
                  table_def->type.length - 1))
2720
2720
      {
2721
 
        sql_print_error(_("Incorrect definition of table %s.%s: "
 
2721
        errmsg_printf(ERRMSG_LVL_ERROR, _("Incorrect definition of table %s.%s: "
2722
2722
                        "expected column '%s' at position %d to have type "
2723
2723
                        "%s, found type %s."), s->db.str, alias,
2724
2724
                        table_def->name.str, i, table_def->type.str,
2727
2727
      }
2728
2728
      else if (table_def->cset.str && !field->has_charset())
2729
2729
      {
2730
 
        sql_print_error(_("Incorrect definition of table %s.%s: "
 
2730
        errmsg_printf(ERRMSG_LVL_ERROR, _("Incorrect definition of table %s.%s: "
2731
2731
                        "expected the type of column '%s' at position %d "
2732
2732
                        "to have character set '%s' but the type has no "
2733
2733
                        "character set."), s->db.str, alias,
2737
2737
      else if (table_def->cset.str &&
2738
2738
               strcmp(field->charset()->csname, table_def->cset.str))
2739
2739
      {
2740
 
        sql_print_error(_("Incorrect definition of table %s.%s: "
 
2740
        errmsg_printf(ERRMSG_LVL_ERROR, _("Incorrect definition of table %s.%s: "
2741
2741
                        "expected the type of column '%s' at position %d "
2742
2742
                        "to have character set '%s' but found "
2743
2743
                        "character set '%s'."), s->db.str, alias,
2748
2748
    }
2749
2749
    else
2750
2750
    {
2751
 
      sql_print_error(_("Incorrect definition of table %s.%s: "
 
2751
      errmsg_printf(ERRMSG_LVL_ERROR, _("Incorrect definition of table %s.%s: "
2752
2752
                      "expected column '%s' at position %d to have type %s "
2753
2753
                      " but the column is not found."),
2754
2754
                      s->db.str, alias,
4868
4868
    print them to the .err log
4869
4869
  */
4870
4870
  if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT)
4871
 
    sql_print_error(_("Got error %d when reading table '%s'"),
 
4871
    errmsg_printf(ERRMSG_LVL_ERROR, _("Got error %d when reading table '%s'"),
4872
4872
                    error, s->path.str);
4873
4873
  file->print_error(error,MYF(0));
4874
4874