summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-12-04 00:14:18 +0200
committerunknown <bell@sanja.is.com.ua>2004-12-04 00:14:18 +0200
commit56080a8d1ef21e6330e76de27eb28fc2daf5876a (patch)
tree9767b6ddd3eb5a6bd7406d85046c226bdf7dfb53 /mysql-test
parentb2f7b5bd64f49084033b6c2e72a8e7239b861416 (diff)
downloadmariadb-git-56080a8d1ef21e6330e76de27eb28fc2daf5876a.tar.gz
postreview fixes
mysql-test/r/subselect_innodb.result: fixed result of test mysql-test/t/subselect_innodb.test: fixed test layout
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/subselect_innodb.result26
-rw-r--r--mysql-test/t/subselect_innodb.test15
2 files changed, 39 insertions, 2 deletions
diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result
index e8f6426f51b..0b813a07a1d 100644
--- a/mysql-test/r/subselect_innodb.result
+++ b/mysql-test/r/subselect_innodb.result
@@ -114,3 +114,29 @@ SELECT R.unit, R.ingredient FROM t1 R WHERE R.ingredient IN (SELECT N.ingredient
unit ingredient
xx yy
drop table t1, t2;
+CREATE TABLE t1 (
+id INT NOT NULL auto_increment,
+date1 DATE, coworkerid INT,
+description VARCHAR(255),
+sum_used DOUBLE,
+sum_remaining DOUBLE,
+comments VARCHAR(255),
+PRIMARY KEY(id)
+) engine=innodb;
+insert into t1 values (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1998-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1998-01-01', 1,'test', 22, 33, 'comment'), (NULL, '2004-01-01', 1,'test', 22, 33, 'comment'), (NULL, '2004-01-01', 1,'test', 22, 33, 'comment');
+SELECT DISTINCT
+(SELECT sum(sum_used) FROM t1 WHERE sum_used > 0 AND year(date1) <= '2004') as somallontvangsten,
+(SELECT sum(sum_used) FROM t1 WHERE sum_used < 0 AND year(date1) <= '2004') as somalluitgaven
+FROM t1;
+somallontvangsten somalluitgaven
+154 NULL
+select * from t1;
+id date1 coworkerid description sum_used sum_remaining comments
+1 1999-01-01 1 test 22 33 comment
+2 1999-01-01 1 test 22 33 comment
+3 1999-01-01 1 test 22 33 comment
+4 1998-01-01 1 test 22 33 comment
+5 1998-01-01 1 test 22 33 comment
+6 2004-01-01 1 test 22 33 comment
+7 2004-01-01 1 test 22 33 comment
+drop table t1;
diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test
index 54c56e640dc..aa7fe138876 100644
--- a/mysql-test/t/subselect_innodb.test
+++ b/mysql-test/t/subselect_innodb.test
@@ -129,8 +129,19 @@ drop table t1, t2;
#
# possible early unlock
#
-CREATE TABLE t1 ( id INT NOT NULL auto_increment, date1 DATE, coworkerid INT, description VARCHAR(255), sum_used DOUBLE, sum_remaining DOUBLE, comments VARCHAR(255), PRIMARY KEY(id)) engine=innodb;
+CREATE TABLE t1 (
+ id INT NOT NULL auto_increment,
+ date1 DATE, coworkerid INT,
+ description VARCHAR(255),
+ sum_used DOUBLE,
+ sum_remaining DOUBLE,
+ comments VARCHAR(255),
+ PRIMARY KEY(id)
+) engine=innodb;
insert into t1 values (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1998-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1998-01-01', 1,'test', 22, 33, 'comment'), (NULL, '2004-01-01', 1,'test', 22, 33, 'comment'), (NULL, '2004-01-01', 1,'test', 22, 33, 'comment');
-SELECT DISTINCT (SELECT sum(sum_used) FROM t1 WHERE sum_used > 0 AND year(date1) <= '2004') as somallontvangsten, (SELECT sum(sum_used) FROM t1 WHERE sum_used < 0 AND year(date1) <= '2004') as somalluitgaven FROM t1;
+SELECT DISTINCT
+ (SELECT sum(sum_used) FROM t1 WHERE sum_used > 0 AND year(date1) <= '2004') as somallontvangsten,
+ (SELECT sum(sum_used) FROM t1 WHERE sum_used < 0 AND year(date1) <= '2004') as somalluitgaven
+ FROM t1;
select * from t1;
drop table t1;