Commit d4d09768 authored by serg@serg.mylan's avatar serg@serg.mylan

cleanup

parent bd1f8a92
......@@ -1578,7 +1578,7 @@ select * from t1;
a b
1 0.123
drop table t1;
CREATE TABLE tab_01 (
CREATE TABLE t1 (
id int(11) NOT NULL auto_increment,
ts timestamp NOT NULL,
id_cns tinyint(3) unsigned NOT NULL default '0',
......@@ -1596,7 +1596,7 @@ PRIMARY KEY(id),
UNIQUE KEY idx_cns_gen_anno (anno_dep,id_cns,generale,particolare),
UNIQUE KEY idx_cns_par_anno (id_cns,anno_dep,tipo,particolare,bis)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PACK_KEYS=1;
INSERT INTO tab_01 (id, ts, id_cns, id_desc_nota, id_publ_uff, tipo, f_aggiunte,
INSERT INTO t1 (id, ts, id_cns, id_desc_nota, id_publ_uff, tipo, f_aggiunte,
anno_dep, data_dep, particolare, generale, bis) VALUES
(NULL, NULL, 16, 29, 622, 'UNO', '', 1987, 1218, 2048, 9681, 0),
(NULL, NULL, 50, 23, 1717, 'UNO', '', 1987, 1126, 1536, 13987, 0),
......@@ -1604,7 +1604,7 @@ anno_dep, data_dep, particolare, generale, bis) VALUES
(NULL, NULL, 16, 124, 124, 'UNO', '', 1987, 1201, 1792, 13422, 0),
(NULL, NULL, 16, 125, 125, 'UNO', '', 1987, 0723, 1025, 10240, 0),
(NULL, NULL, 16, 126, 126, 'UNO', '', 1987, 1204, 1026, 7089, 0);
CREATE TABLE tab_02 (
CREATE TABLE t2 (
id tinyint(3) unsigned NOT NULL auto_increment,
descr varchar(40) NOT NULL default '',
f_servizi set('UNO','DUE') NOT NULL default '',
......@@ -1614,14 +1614,14 @@ max_anno_dep smallint(6) unsigned NOT NULL default '0',
data_agg int(8) unsigned NOT NULL default '0',
PRIMARY KEY (id)
);
INSERT INTO tab_02 (id, descr, f_servizi, data_uno_min, data_due_min,
INSERT INTO t2 (id, descr, f_servizi, data_uno_min, data_due_min,
max_anno_dep, data_agg) VALUES
(16, 'C_UNO', 'UNO,DUE', 19000000, 30000000, 1987, 0),
(50, 'C_TRE', 'UNO', 19000000, 30000000, 1990, 0);
SELECT cns.max_anno_dep = (SELECT s.anno_dep FROM tab_01 AS s WHERE
SELECT cns.max_anno_dep = (SELECT s.anno_dep FROM t1 AS s WHERE
s.id_cns = cns.id ORDER BY s.anno_dep DESC LIMIT 1) AS PIPPO FROM
tab_02 AS cns;
t2 AS cns;
PIPPO
1
NULL
DROP TABLE tab_01, tab_02;
DROP TABLE t1, t2;
......@@ -1026,7 +1026,7 @@ drop table t1;
# Bug 2479
#
CREATE TABLE tab_01 (
CREATE TABLE t1 (
id int(11) NOT NULL auto_increment,
ts timestamp NOT NULL,
id_cns tinyint(3) unsigned NOT NULL default '0',
......@@ -1045,7 +1045,7 @@ UNIQUE KEY idx_cns_gen_anno (anno_dep,id_cns,generale,particolare),
UNIQUE KEY idx_cns_par_anno (id_cns,anno_dep,tipo,particolare,bis)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PACK_KEYS=1;
INSERT INTO tab_01 (id, ts, id_cns, id_desc_nota, id_publ_uff, tipo, f_aggiunte,
INSERT INTO t1 (id, ts, id_cns, id_desc_nota, id_publ_uff, tipo, f_aggiunte,
anno_dep, data_dep, particolare, generale, bis) VALUES
(NULL, NULL, 16, 29, 622, 'UNO', '', 1987, 1218, 2048, 9681, 0),
(NULL, NULL, 50, 23, 1717, 'UNO', '', 1987, 1126, 1536, 13987, 0),
......@@ -1054,7 +1054,7 @@ anno_dep, data_dep, particolare, generale, bis) VALUES
(NULL, NULL, 16, 125, 125, 'UNO', '', 1987, 0723, 1025, 10240, 0),
(NULL, NULL, 16, 126, 126, 'UNO', '', 1987, 1204, 1026, 7089, 0);
CREATE TABLE tab_02 (
CREATE TABLE t2 (
id tinyint(3) unsigned NOT NULL auto_increment,
descr varchar(40) NOT NULL default '',
f_servizi set('UNO','DUE') NOT NULL default '',
......@@ -1065,13 +1065,13 @@ data_agg int(8) unsigned NOT NULL default '0',
PRIMARY KEY (id)
);
INSERT INTO tab_02 (id, descr, f_servizi, data_uno_min, data_due_min,
INSERT INTO t2 (id, descr, f_servizi, data_uno_min, data_due_min,
max_anno_dep, data_agg) VALUES
(16, 'C_UNO', 'UNO,DUE', 19000000, 30000000, 1987, 0),
(50, 'C_TRE', 'UNO', 19000000, 30000000, 1990, 0);
SELECT cns.max_anno_dep = (SELECT s.anno_dep FROM tab_01 AS s WHERE
SELECT cns.max_anno_dep = (SELECT s.anno_dep FROM t1 AS s WHERE
s.id_cns = cns.id ORDER BY s.anno_dep DESC LIMIT 1) AS PIPPO FROM
tab_02 AS cns;
t2 AS cns;
DROP TABLE tab_01, tab_02;
DROP TABLE t1, t2;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment