~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/suite/ndb/r/ndb_limit.result

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
DROP TABLE IF EXISTS t2;
 
2
CREATE TABLE t2 (
 
3
a bigint unsigned NOT NULL PRIMARY KEY,
 
4
b int unsigned not null,
 
5
c int unsigned
 
6
) engine=ndbcluster;
 
7
select count(*) from t2;
 
8
count(*)
 
9
10000
 
10
delete from t2 limit 1;
 
11
select count(*) from t2;
 
12
count(*)
 
13
9999
 
14
delete from t2 limit 100;
 
15
select count(*) from t2;
 
16
count(*)
 
17
9899
 
18
delete from t2 limit 1000;
 
19
select count(*) from t2;
 
20
count(*)
 
21
8899
 
22
update t2 set c=12345678 limit 100;
 
23
select count(*) from t2 where c=12345678;
 
24
count(*)
 
25
100
 
26
select count(*) from t2 where c=12345678 limit 1000;
 
27
count(*)
 
28
100
 
29
select * from t2 limit 0;
 
30
a       b       c
 
31
drop table t2;
 
32
CREATE TABLE `t2` (
 
33
`views` int(11) NOT NULL default '0',
 
34
`clicks` int(11) NOT NULL default '0',
 
35
`day` date NOT NULL default '0000-00-00',
 
36
`hour` tinyint(4) NOT NULL default '0',
 
37
`bannerid` smallint(6) NOT NULL default '0',
 
38
`zoneid` smallint(6) NOT NULL default '0',
 
39
`source` varchar(50) NOT NULL default '',
 
40
PRIMARY KEY  (`day`,`hour`,`bannerid`,`zoneid`,`source`),
 
41
KEY `bannerid_day` (`bannerid`,`day`),
 
42
KEY `zoneid` (`zoneid`)
 
43
) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
 
44
INSERT INTO `t2` VALUES
 
45
(  1,0,'2004-09-17', 5,100,100,''),
 
46
(  1,0,'2004-09-18', 7,100,100,''),
 
47
( 17,0,'2004-09-27',20,132,100,''),
 
48
(  4,0,'2004-09-16',23,132,100,''),
 
49
( 86,0,'2004-09-18', 7,196,196,''),
 
50
( 11,0,'2004-09-16',16,132,100,''),
 
51
(140,0,'2004-09-18', 0,100,164,''),
 
52
(  2,0,'2004-09-17', 7,132,100,''),
 
53
(846,0,'2004-09-27',11,132,164,''),
 
54
(  1,0,'2004-09-18', 8,132,100,''),
 
55
( 22,0,'2004-09-27', 9,164,132,''),
 
56
(711,0,'2004-09-27', 9,100,164,''),
 
57
( 11,0,'2004-09-18', 0,196,132,''),
 
58
( 41,0,'2004-09-27',15,196,132,''),
 
59
( 57,0,'2004-09-18', 2,164,196,'');
 
60
SELECT DATE_FORMAT(day, '%Y%m%d') as date, DATE_FORMAT(day, '%d-%m-%Y')
 
61
as date_formatted FROM t2 GROUP BY day ORDER BY day DESC;
 
62
date    date_formatted
 
63
20040927        27-09-2004
 
64
20040918        18-09-2004
 
65
20040917        17-09-2004
 
66
20040916        16-09-2004
 
67
SELECT DATE_FORMAT(day, '%Y%m%d') as date, DATE_FORMAT(day, '%d-%m-%Y')
 
68
as date_formatted FROM t2 GROUP BY day ORDER BY day DESC LIMIT 2;
 
69
date    date_formatted
 
70
20040927        27-09-2004
 
71
20040918        18-09-2004
 
72
drop table t2;