~ubuntu-branches/debian/squeeze/mysql-5.1/squeeze

« back to all changes in this revision

Viewing changes to storage/myisam/mi_search.c

  • Committer: Package Import Robot
  • Author(s): Moritz Muehlenhoff
  • Date: 2014-01-14 10:40:30 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20140114104030-44alii0hx3x3g41y
Tags: 5.1.73-1
* New upstream release
  http://dev.mysql.com/doc/relnotes/mysql/5.1/en/news-5-1-73.html
* Update patches
* Disable flaky test rpl.rpl_innodb_bug28430 breaking the build. It's  marked
  as experimental by upstream and the internet is full of reports about it's
  unrelialibity

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2000-2006 MySQL AB
 
1
/*
 
2
   Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
2
3
 
3
4
   This program is free software; you can redistribute it and/or modify
4
5
   it under the terms of the GNU General Public License as published by
11
12
 
12
13
   You should have received a copy of the GNU General Public License
13
14
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 
16
*/
15
17
 
16
18
/* key handling functions */
17
19
 
296
298
    flag is the value returned by ha_key_cmp and as treated as final
297
299
  */
298
300
  int flag=0, my_flag=-1;
299
 
  uint nod_flag, length, len, matched, cmplen, kseg_len;
300
 
  uint prefix_len,suffix_len;
301
 
  int key_len_skip, seg_len_pack, key_len_left;
 
301
  uint nod_flag, UNINIT_VAR(length), len, matched, cmplen, kseg_len;
 
302
  uint UNINIT_VAR(prefix_len), suffix_len;
 
303
  int key_len_skip, UNINIT_VAR(seg_len_pack), key_len_left;
302
304
  uchar *end, *kseg, *vseg;
303
305
  uchar *sort_order=keyinfo->seg->charset->sort_order;
304
306
  uchar tt_buff[MI_MAX_KEY_BUFF+2], *t_buff=tt_buff+2;
308
310
  uint  length_pack;
309
311
  DBUG_ENTER("_mi_prefix_search");
310
312
 
311
 
  LINT_INIT(length);
312
 
  LINT_INIT(prefix_len);
313
 
  LINT_INIT(seg_len_pack);
314
 
 
315
313
  t_buff[0]=0;                                  /* Avoid bugs */
316
314
  end= page+mi_getint(page);
317
315
  nod_flag=mi_test_if_nod(page);
819
817
            DBUG_PRINT("error",
820
818
                       ("Found too long null packed key: %u of %u at 0x%lx",
821
819
                        length, keyseg->length, (long) *page_pos));
822
 
            DBUG_DUMP("key",(char*) *page_pos,16);
 
820
            DBUG_DUMP("key", *page_pos, 16);
823
821
            mi_print_error(keyinfo->share, HA_ERR_CRASHED);
824
822
            my_errno=HA_ERR_CRASHED;
825
823
            return 0;
876
874
      {
877
875
        DBUG_PRINT("error",("Found too long packed key: %u of %u at 0x%lx",
878
876
                            length, keyseg->length, (long) *page_pos));
879
 
        DBUG_DUMP("key",(char*) *page_pos,16);
 
877
        DBUG_DUMP("key", *page_pos, 16);
880
878
        mi_print_error(keyinfo->share, HA_ERR_CRASHED);
881
879
        my_errno=HA_ERR_CRASHED;
882
880
        return 0;                               /* Error */
948
946
      DBUG_PRINT("error",
949
947
                 ("Found too long binary packed key: %u of %u at 0x%lx",
950
948
                  length, keyinfo->maxlength, (long) *page_pos));
951
 
      DBUG_DUMP("key",(char*) *page_pos,16);
 
949
      DBUG_DUMP("key", *page_pos, 16);
952
950
      mi_print_error(keyinfo->share, HA_ERR_CRASHED);
953
951
      my_errno=HA_ERR_CRASHED;
954
952
      DBUG_RETURN(0);                                 /* Wrong key */