~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.cc

  • Committer: Monty Taylor
  • Date: 2008-10-04 18:42:30 UTC
  • Revision ID: monty@inaugust.com-20081004184230-j2j1uottu2d0yl0m
Removed NullS. bu-bye.

Show diffs side-by-side

added added

removed removed

Lines of Context:
304
304
  error_given= 0;
305
305
  disk_buff= NULL;
306
306
 
307
 
  strxmov(path, share->normalized_path.str, reg_ext, NullS);
 
307
  strxmov(path, share->normalized_path.str, reg_ext, NULL);
308
308
  if ((file= my_open(path, O_RDONLY | O_SHARE, MYF(0))) < 0)
309
309
  {
310
310
    /*
329
329
    uint length;
330
330
    strxnmov(path, sizeof(path)-1,
331
331
             mysql_data_home, "/", share->db.str, "/",
332
 
             share->table_name.str, reg_ext, NullS);
 
332
             share->table_name.str, reg_ext, NULL);
333
333
    length= unpack_filename(path, path) - reg_ext_length;
334
334
    /*
335
335
      The following is a safety test and should never fail
1498
1498
 
1499
1499
 
1500
1500
        /* Find where a form starts */
1501
 
        /* if formname is NullS then only formnames is read */
 
1501
        /* if formname is NULL then only formnames is read */
1502
1502
 
1503
1503
ulong get_form_pos(File file, uchar *head, TYPELIB *save_names)
1504
1504
{
1623
1623
  if (n_length == 1 )
1624
1624
  {                                             /* First name */
1625
1625
    length++;
1626
 
    strxmov((char*) buff,"/",newname,"/",NullS);
 
1626
    strxmov((char*) buff,"/",newname,"/",NULL);
1627
1627
  }
1628
1628
  else
1629
 
    strxmov((char*) buff,newname,"/",NullS); /* purecov: inspected */
 
1629
    strxmov((char*) buff,newname,"/",NULL); /* purecov: inspected */
1630
1630
  my_seek(file,63L+(ulong) n_length,MY_SEEK_SET,MYF(0));
1631
1631
  if (my_write(file, buff, (size_t) length+1,MYF(MY_NABP+MY_WME)) ||
1632
1632
      (names && my_write(file,(uchar*) (*formnames->type_names+n_length-1),
1656
1656
      my_error(ER_NO_SUCH_TABLE, MYF(0), share->db.str, share->table_name.str);
1657
1657
    else
1658
1658
    {
1659
 
      strxmov(buff, share->normalized_path.str, reg_ext, NullS);
 
1659
      strxmov(buff, share->normalized_path.str, reg_ext, NULL);
1660
1660
      my_error((db_errno == EMFILE) ? ER_CANT_OPEN_FILE : ER_FILE_NOT_FOUND,
1661
1661
               errortype, buff, db_errno);
1662
1662
    }
1677
1677
    }
1678
1678
    err_no= (db_errno == ENOENT) ? ER_FILE_NOT_FOUND : (db_errno == EAGAIN) ?
1679
1679
      ER_FILE_USED : ER_CANT_OPEN_FILE;
1680
 
    strxmov(buff, share->normalized_path.str, datext, NullS);
 
1680
    strxmov(buff, share->normalized_path.str, datext, NULL);
1681
1681
    my_error(err_no,errortype, buff, db_errno);
1682
1682
    delete file;
1683
1683
    break;
1697
1697
    break;
1698
1698
  }
1699
1699
  case 6:
1700
 
    strxmov(buff, share->normalized_path.str, reg_ext, NullS);
 
1700
    strxmov(buff, share->normalized_path.str, reg_ext, NULL);
1701
1701
    my_printf_error(ER_NOT_FORM_FILE,
1702
1702
                    _("Table '%-.64s' was created with a different version "
1703
1703
                    "of MySQL and cannot be read"), 
1707
1707
    break;
1708
1708
  default:                              /* Better wrong error than none */
1709
1709
  case 4:
1710
 
    strxmov(buff, share->normalized_path.str, reg_ext, NullS);
 
1710
    strxmov(buff, share->normalized_path.str, reg_ext, NULL);
1711
1711
    my_error(ER_NOT_FORM_FILE, errortype, buff, 0);
1712
1712
    break;
1713
1713
  }
1736
1736
 
1737
1737
    if ((chr= *ptr))                    /* Test if empty type */
1738
1738
    {
1739
 
      while ((type_name=strchr(ptr+1,chr)) != NullS)
 
1739
      while ((type_name=strchr(ptr+1,chr)) != NULL)
1740
1740
      {
1741
1741
        *((*array)++) = ptr+1;
1742
1742
        *type_name= '\0';               /* End string */
1748
1748
      ptr++;
1749
1749
    point_to_type->count= (uint) (*array - point_to_type->type_names);
1750
1750
    point_to_type++;
1751
 
    *((*array)++)= NullS;               /* End of type */
 
1751
    *((*array)++)= NULL;                /* End of type */
1752
1752
  }
1753
1753
  *names=ptr;                           /* Update end */
1754
1754
  return;
2056
2056
rename_file_ext(const char * from,const char * to,const char * ext)
2057
2057
{
2058
2058
  char from_b[FN_REFLEN],to_b[FN_REFLEN];
2059
 
  strxmov(from_b,from,ext,NullS);
2060
 
  strxmov(to_b,to,ext,NullS);
 
2059
  strxmov(from_b,from,ext,NULL);
 
2060
  strxmov(to_b,to,ext,NULL);
2061
2061
  return (my_rename(from_b,to_b,MYF(MY_WME)));
2062
2062
}
2063
2063
 
2104
2104
    field       Field for retrieving of string
2105
2105
 
2106
2106
  RETURN VALUES
2107
 
    NullS  string is empty
 
2107
    NULL  string is empty
2108
2108
    #      pointer to NULL-terminated string value of field
2109
2109
*/
2110
2110
 
2117
2117
  field->val_str(&str);
2118
2118
  length= str.length();
2119
2119
  if (!length || !(to= (char*) alloc_root(mem,length+1)))
2120
 
    return NullS;
 
2120
    return NULL;
2121
2121
  memcpy(to,str.ptr(),(uint) length);
2122
2122
  to[length]=0;
2123
2123
  return to;
3662
3662
                        &group_buff, (group && ! using_unique_constraint ?
3663
3663
                                      param->group_length : 0),
3664
3664
                        &bitmaps, bitmap_buffer_size(field_count)*2,
3665
 
                        NullS))
 
3665
                        NULL))
3666
3666
  {
3667
3667
    if (temp_pool_slot != MY_BIT_NONE)
3668
3668
      bitmap_lock_clear_bit(&temp_pool, temp_pool_slot);
4160
4160
                                                (uchar*) 0,
4161
4161
                                                (uint) 0,
4162
4162
                                                Field::NONE,
4163
 
                                                NullS, 
 
4163
                                                NULL, 
4164
4164
                                                table->s,
4165
4165
                                                &my_charset_bin);
4166
4166
      if (!key_part_info->field)
4269
4269
                        &field, (field_count + 1) * sizeof(Field*),
4270
4270
                        &blob_field, (field_count+1) *sizeof(uint),
4271
4271
                        &bitmaps, bitmap_buffer_size(field_count)*2,
4272
 
                        NullS))
 
4272
                        NULL))
4273
4273
    return 0;
4274
4274
 
4275
4275
  memset(table, 0, sizeof(*table));