~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzletest.cc

Merge in Monty/Andrew's boolean MySQL compatible patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4697
4697
    for (i = 0; i < num_fields; i++)
4698
4698
    {
4699
4699
      column= drizzle_column_next(res);
4700
 
      append_field(ds, i, column,
4701
 
                   (const char*)row[i], lengths[i], !row[i]);
 
4700
      if (row[i] && (drizzle_column_type(column) == DRIZZLE_COLUMN_TYPE_TINY))
 
4701
      {
 
4702
        if (boost::lexical_cast<uint32_t>(row[i]))
 
4703
        {
 
4704
          if ((drizzle_column_flags(column) & DRIZZLE_COLUMN_FLAGS_UNSIGNED))
 
4705
          {
 
4706
            append_field(ds, i, column, "YES", 3, false);
 
4707
          }
 
4708
          else
 
4709
          {
 
4710
            append_field(ds, i, column, "TRUE", 4, false);
 
4711
          }
 
4712
        }
 
4713
        else
 
4714
        {
 
4715
          if ((drizzle_column_flags(column) & DRIZZLE_COLUMN_FLAGS_UNSIGNED))
 
4716
          {
 
4717
            append_field(ds, i, column, "NO", 2, false);
 
4718
          }
 
4719
          else
 
4720
          {
 
4721
            append_field(ds, i, column, "FALSE", 5, false);
 
4722
          }
 
4723
        }
 
4724
      }
 
4725
      else
 
4726
      {
 
4727
        append_field(ds, i, column,
 
4728
                     (const char*)row[i], lengths[i], !row[i]);
 
4729
      }
4702
4730
    }
4703
4731
    if (!display_result_vertically)
4704
4732
      ds->append("\n");
4742
4770
    ds->append("\t", 1);
4743
4771
    replace_append_uint(ds, drizzle_column_size(column));
4744
4772
    ds->append("\t", 1);
4745
 
    replace_append_uint(ds, drizzle_column_max_size(column));
 
4773
    if (drizzle_column_type(column) == DRIZZLE_COLUMN_TYPE_TINY)
 
4774
    {
 
4775
      replace_append_uint(ds, 1);
 
4776
    }
 
4777
    else
 
4778
    {
 
4779
      replace_append_uint(ds, drizzle_column_max_size(column));
 
4780
    }
4746
4781
    ds->append("\t", 1);
4747
4782
    ds->append((char*) ((drizzle_column_flags(column) & DRIZZLE_COLUMN_FLAGS_NOT_NULL) ? "N" : "Y"), 1);
4748
4783
    ds->append("\t", 1);