Current Path : /home/usr.opt/mysql57/mysql-test/suite/engines/funcs/t/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //home/usr.opt/mysql57/mysql-test/suite/engines/funcs/t/general_null.test |
--disable_warnings DROP TABLE IF EXISTS t3; --enable_warnings CREATE TABLE t3(c1 TINYINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT MAX(c1) AS value FROM t3; SELECT MAX(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT MAX(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT MAX(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 SMALLINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT MAX(c1) AS value FROM t3; SELECT MAX(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT MAX(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT MAX(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 MEDIUMINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT MAX(c1) AS value FROM t3; SELECT MAX(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT MAX(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT MAX(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 INT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT MAX(c1) AS value FROM t3; SELECT MAX(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT MAX(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT MAX(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 INTEGER NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT MAX(c1) AS value FROM t3; SELECT MAX(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT MAX(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT MAX(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 BIGINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT MAX(c1) AS value FROM t3; SELECT MAX(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT MAX(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT MAX(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 TINYINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT MIN(c1) AS value FROM t3; SELECT MIN(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT MIN(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT MIN(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 SMALLINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT MIN(c1) AS value FROM t3; SELECT MIN(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT MIN(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT MIN(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 MEDIUMINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT MIN(c1) AS value FROM t3; SELECT MIN(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT MIN(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT MIN(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 INT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT MIN(c1) AS value FROM t3; SELECT MIN(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT MIN(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT MIN(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 INTEGER NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT MIN(c1) AS value FROM t3; SELECT MIN(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT MIN(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT MIN(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 BIGINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT MIN(c1) AS value FROM t3; SELECT MIN(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT MIN(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT MIN(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 TINYINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT AVG(c1) AS value FROM t3; SELECT AVG(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT AVG(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT AVG(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 SMALLINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT AVG(c1) AS value FROM t3; SELECT AVG(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT AVG(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT AVG(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 MEDIUMINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT AVG(c1) AS value FROM t3; SELECT AVG(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT AVG(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT AVG(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 INT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT AVG(c1) AS value FROM t3; SELECT AVG(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT AVG(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT AVG(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 INTEGER NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT AVG(c1) AS value FROM t3; SELECT AVG(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT AVG(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT AVG(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 BIGINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT AVG(c1) AS value FROM t3; SELECT AVG(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT AVG(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT AVG(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 TINYINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT SUM(c1) AS value FROM t3; SELECT SUM(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT SUM(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT SUM(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 SMALLINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT SUM(c1) AS value FROM t3; SELECT SUM(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT SUM(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT SUM(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 MEDIUMINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT SUM(c1) AS value FROM t3; SELECT SUM(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT SUM(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT SUM(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 INT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT SUM(c1) AS value FROM t3; SELECT SUM(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT SUM(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT SUM(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 INTEGER NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT SUM(c1) AS value FROM t3; SELECT SUM(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT SUM(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT SUM(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 BIGINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT SUM(c1) AS value FROM t3; SELECT SUM(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT SUM(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT SUM(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 TINYINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT COUNT(c1) AS value FROM t3; SELECT COUNT(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT COUNT(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT COUNT(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 SMALLINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT COUNT(c1) AS value FROM t3; SELECT COUNT(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT COUNT(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT COUNT(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 MEDIUMINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT COUNT(c1) AS value FROM t3; SELECT COUNT(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT COUNT(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT COUNT(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 INT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT COUNT(c1) AS value FROM t3; SELECT COUNT(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT COUNT(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT COUNT(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 INTEGER NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT COUNT(c1) AS value FROM t3; SELECT COUNT(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT COUNT(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT COUNT(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3; CREATE TABLE t3(c1 BIGINT NULL); INSERT INTO t3 (c1) VALUES(0); INSERT INTO t3 (c1) VALUES(1); INSERT INTO t3 (c1) VALUES(16); INSERT INTO t3 (c1) VALUES(-4); INSERT INTO t3 (c1) VALUES(-9); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); INSERT INTO t3 (c1) VALUES(NULL); SELECT COUNT(c1) AS value FROM t3; SELECT COUNT(c1) AS postive_value FROM t3 WHERE c1 > 0; SELECT COUNT(c1) AS negative_value FROM t3 WHERE c1 < 0; SELECT COUNT(c1) AS negative_value FROM t3 WHERE c1 = 2; DROP TABLE t3;