recDate datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
67
67
URID int DEFAULT '0' NOT NULL,
68
68
CRID int DEFAULT '0' NOT NULL,
69
69
amount int DEFAULT '0' NOT NULL,
70
70
operator int,
71
71
method enum('unknown','cash','dealer','check','card','lazy','delayed','test') DEFAULT 'unknown' NOT NULL,
72
72
DIID int,
73
reason char(1) DEFAULT '' NOT NULL,
73
reason char(1) binary DEFAULT '' NOT NULL,
74
74
code_id int,
75
75
qty int DEFAULT '0' NOT NULL,
76
76
PRIMARY KEY (PID),
90
90
#
91
91
# Problem with GROUP BY + ORDER BY when no match
92
92
# Tested with locking
93
# NOTE: LOCK TABLE was removed, so now just testing normal syntax.
94
93
#
95
94
96
95
CREATE TABLE t1 (
109
108
KEY contact_id (contact_id)
110
109
);
111
110
111
lock tables t1 read,t2 write;
112
112
113
INSERT INTO t2 VALUES (10,2);
113
114
INSERT INTO t2 VALUES (18,2);
114
115
INSERT INTO t2 VALUES (62,2);
117
118
118
119
SELECT cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid;
119
120
SELECT cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid ORDER BY NULL;
120
SELECT cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid ORDER BY surname, firstname;
121
SELECT HIGH_PRIORITY cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid ORDER BY surname, firstname;
121
122
122
123
drop table t2;
124
unlock tables;
123
125
drop table t1;
124
126
125
127
# Test needs to be rewritten
283
285
INSERT INTO t1 VALUES ('A'),('B'),('A'),('B'),('A'),('B'),(NULL),('a'),('b'),(NULL),('A'),('B'),(NULL);