~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/show.cc

  • Committer: Toru Maesaka
  • Date: 2008-12-02 08:02:52 UTC
  • mfrom: (636 drizzle)
  • mto: (632.1.17 devel)
  • mto: This revision was merged to the branch mainline in revision 637.
  • Revision ID: dev@torum.net-20081202080252-26spgq2s17np0b2m
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#include <drizzled/field/fdecimal.h>
37
37
 
38
38
#include <string>
 
39
#include <iostream>
 
40
#include <sstream>
 
41
 
 
42
using namespace std;
39
43
 
40
44
inline const char *
41
45
str_or_nil(const char *str)
1543
1547
      {
1544
1548
        char *value=var->value;
1545
1549
        const char *pos, *end;                  // We assign a lot of const's
1546
 
 
1547
1550
        pthread_mutex_lock(&LOCK_global_system_variables);
1548
1551
 
1549
1552
        if (show_type == SHOW_SYS)
1579
1582
        case SHOW_LONGLONG:
1580
1583
          end= int64_t10_to_str(*(int64_t*) value, buff, 10);
1581
1584
          break;
 
1585
        case SHOW_SIZE:
 
1586
          {
 
1587
            stringstream ss (stringstream::in);
 
1588
            ss << *(size_t*) value;
 
1589
 
 
1590
            string str= ss.str(); 
 
1591
            strncpy(buff, str.c_str(), str.length());
 
1592
            end= buff+ str.length();
 
1593
          }
 
1594
          break;
1582
1595
        case SHOW_HA_ROWS:
1583
1596
          end= int64_t10_to_str((int64_t) *(ha_rows*) value, buff, 10);
1584
1597
          break;