Problem Fehler



  • Hallo,

    ich bin gerade dabei zwangsläufig mir Mysql selber zu kompilieren:
    ich bekomme folgenden Fehler:

    mi_key.c: In function `_mi_make_key':
    mi_key.c:219: parse error before `uint'
    mi_key.c:230: `k_length' undeclared (first use in this function)
    mi_key.c:230: (Each undeclared identifier is reported only once
    mi_key.c:230: for each function it appears in.)
    mi_key.c:231: `old' undeclared (first use in this function)
    mi_key.c:307: `last_used_keyseg' undeclared (first use in this function)
    mi_key.c:330: `start_key' undeclared (first use in this function)
    mi_key.c: In function `retrieve_auto_increment':
    mi_key.c:595: parse error at end of input
    

    der "parse error" ist hier bei Zeile 16 ...

    hier ist die Funktion als auszug aus der Datei:

    /*
      Make a intern key from a record
    
      SYNOPSIS
        _mi_make_key()
        info                MyiSAM handler
        keynr               key number
        key                 Store created key here
        record              Record
        filepos             Position to record in the data file
    
      RETURN
        Length of key
    */
    
    uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
                      const byte *record, my_off_t filepos)
    {
      byte *pos;
      uchar *start;
      reg1 HA_KEYSEG *keyseg;
      my_bool is_ft= info->s->keyinfo[keynr].flag & HA_FULLTEXT;
      DBUG_ENTER("_mi_make_key");
    
      if (info->s->keyinfo[keynr].flag & HA_SPATIAL)
      {
        /*
          TODO: nulls processing
        */
    #ifdef HAVE_SPATIAL
        DBUG_RETURN(sp_make_key(info,keynr,key,record,filepos));
    #else
        DBUG_ASSERT(0); /* mi_open should check that this never happens*/
    #endif
      }
    
      start=key;
      for (keyseg=info->s->keyinfo[keynr].seg ; keyseg->type ;keyseg++)
      {
        enum ha_base_keytype type=(enum ha_base_keytype) keyseg->type;
        uint length=keyseg->length;
        uint char_length;
        CHARSET_INFO *cs=keyseg->charset;
    
        if (keyseg->null_bit)
        {
          if (record[keyseg->null_pos] & keyseg->null_bit)
          {
            *key++= 0;                              /* NULL in key */
            continue;
          }
          *key++=1;                                 /* Not NULL */
        }
    
        char_length= ((!is_ft && cs && cs->mbmaxlen > 1) ? length/cs->mbmaxlen :
                      length);
    
        pos= (byte*) record+keyseg->start;
        if (type == HA_KEYTYPE_BIT)
        {
          if (keyseg->bit_length)
          {
            uchar bits= get_rec_bits((uchar*) record + keyseg->bit_pos,
                                     keyseg->bit_start, keyseg->bit_length);
            *key++= bits;
            length--;
          }
          memcpy((byte*) key, pos, length);
          key+= length;
          continue;
        }
        if (keyseg->flag & HA_SPACE_PACK)
        {
          if (type != HA_KEYTYPE_NUM)
          {
            length= cs->cset->lengthsp(cs, pos, length);
          }
          else
          {
            byte *end= pos + length;
            while (pos < end && pos[0] == ' ')
              pos++;
            length=(uint) (end-pos);
          }
    
          FIX_LENGTH(cs, pos, length, char_length);
          store_key_length_inc(key,char_length);
          memcpy((byte*) key,(byte*) pos,(size_t) char_length);
          key+=char_length;
          continue;
        }
        if (keyseg->flag & HA_VAR_LENGTH_PART)
        {
          uint pack_length= (keyseg->bit_start == 1 ? 1 : 2);
          uint tmp_length= (pack_length == 1 ? (uint) *(uchar*) pos :
                            uint2korr(pos));
          pos+= pack_length;                        /* Skip VARCHAR length */
          set_if_smaller(length,tmp_length);
          FIX_LENGTH(cs, pos, length, char_length);
          store_key_length_inc(key,char_length);
          memcpy((byte*) key,(byte*) pos,(size_t) char_length);
          key+= char_length;
          continue;
        }
        else if (keyseg->flag & HA_BLOB_PART)
        {
          uint tmp_length=_mi_calc_blob_length(keyseg->bit_start,pos);
          memcpy_fixed((byte*) &pos,pos+keyseg->bit_start,sizeof(char*));
          set_if_smaller(length,tmp_length);
          FIX_LENGTH(cs, pos, length, char_length);
          store_key_length_inc(key,char_length);
          memcpy((byte*) key,(byte*) pos,(size_t) char_length);
          key+= char_length;
          continue;
        }
        else if (keyseg->flag & HA_SWAP_KEY)
        {                                           /* Numerical column */
    #ifdef HAVE_ISNAN
          if (type == HA_KEYTYPE_FLOAT)
          {
            float nr;
            float4get(nr,pos);
            if (isnan(nr))
            {
              /* Replace NAN with zero */
              bzero(key,length);
              key+=length;
              continue;
            }
          }
          else if (type == HA_KEYTYPE_DOUBLE)
            {
            double nr;
            float8get(nr,pos);
            if (isnan(nr))
            {
              bzero(key,length);
              key+=length;
              continue;
            }
          }
    #endif
          pos+=length;
          while (length--)
          {
            *key++ = *--pos;
          }
          continue;
        }
        FIX_LENGTH(cs, pos, length, char_length);
        memcpy((byte*) key, pos, char_length);
        if (length > char_length)
          cs->cset->fill(cs, (char*) key+char_length, length-char_length, ' ');
        key+= length;
      }
      _mi_dpointer(info,key,filepos);
      DBUG_PRINT("exit",("keynr: %d",keynr));
      DBUG_DUMP("key",(byte*) start,(uint) (key-start)+keyseg->length);
      DBUG_EXECUTE("key",
                   _mi_print_key(DBUG_FILE,info->s->keyinfo[keynr].seg,start,
                                 (uint) (key-start)););
      DBUG_RETURN((uint) (key-start));              /* Return keylength */
    }/*  _mi_make_key*/
    

    Ich weiss nicht was das sein soll, ehrlich gesagt, sagt der Fehler mir auch nichts???

    Hat jemand einen Tipp?

    Gruss ALex 😕



  • facebraker schrieb:

    mi_key.c: In function `_mi_make_key':
    

    hier ist die Funktion als auszug aus der Datei:

    uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old,
                      uint k_length, HA_KEYSEG **last_used_keyseg)
    

    Nein, das ist 'ne andere Funktion.


Log in to reply