~mordred/drizzle/merge-pandora-build

« back to all changes in this revision

Viewing changes to tests/r/range.result

  • Committer: Brian Aker
  • Date: 2010-12-20 19:24:24 UTC
  • mfrom: (2008.2.5 integer-refactor)
  • Revision ID: brian@tangent.org-20101220192424-iyccxsagvuw43kaz
A rather large and tasty cleanup of issues around ints, and one additional
fix for alter table.

Show diffs side-by-side

added added

removed removed

Lines of Context:
489
489
1025    Y       25      1025    Y       25
490
490
1026    Z       26      1026    Z       26
491
491
drop table t1,t2;
492
 
create table t1 (x bigint not null);
 
492
create table t1 (x bigint unsigned not null);
493
493
insert into t1(x) values (0x0ffffffffffffff0);
494
494
insert into t1(x) values (0x0ffffffffffffff1);
495
495
select * from t1;
507
507
0
508
508
select count(*) from t1 where x < -16;
509
509
count(*)
510
 
0
 
510
1
511
511
select count(*) from t1 where x = -16;
512
512
count(*)
513
 
0
 
513
1
514
514
select count(*) from t1 where x > -16;
515
515
count(*)
516
 
2
 
516
0
517
517
select count(*) from t1 where x = 18446744073709551601;
518
518
count(*)
519
519
0
544
544
1
545
545
select count(*) from t2 where x = 18446744073709551601;
546
546
count(*)
547
 
1
 
547
0
548
548
drop table t1,t2;
549
549
create table t1 (x bigint not null primary key) engine=innodb;
550
550
insert into t1(x) values (0x0ffffffffffffff0);
575
575
count(*)
576
576
0
577
577
drop table t1;
578
 
create table t1 (a bigint);
 
578
create table t1 (a bigint unsigned);
 
579
show create table t1;
 
580
Table   Create Table
 
581
t1      CREATE TABLE `t1` (
 
582
  `a` BIGINT UNSIGNED DEFAULT NULL
 
583
) ENGINE=InnoDB COLLATE = utf8_general_ci
579
584
create index t1i on t1(a);
 
585
show create table t1;
 
586
Table   Create Table
 
587
t1      CREATE TABLE `t1` (
 
588
  `a` BIGINT UNSIGNED DEFAULT NULL,
 
589
  KEY `t1i` (`a`)
 
590
) ENGINE=InnoDB COLLATE = utf8_general_ci
 
591
insert into t1 values (9223372036854775807);
 
592
truncate t1;
580
593
insert into t1 select 18446744073709551615;
581
594
insert into t1 select 18446744073709551614;
582
595
explain select * from t1 where a <> -1;
584
597
1       SIMPLE  t1      index   t1i     t1i     9       NULL    2       Using where; Using index
585
598
select * from t1 where a <> -1;
586
599
a
587
 
-2
 
600
-1
588
601
explain select * from t1 where a > -1 or a < -1;
589
602
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
590
603
1       SIMPLE  t1      index   t1i     t1i     9       NULL    2       Using where; Using index