1303
1355
select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null;
1358
explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
1359
id select_type table type possible_keys key key_len ref rows Extra
1360
1 SIMPLE t2 ALL NULL NULL NULL NULL 1200
1361
1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where; Not exists
1362
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null;
1363
id select_type table type possible_keys key key_len ref rows Extra
1364
1 SIMPLE t4 ALL NULL NULL NULL NULL 12
1365
1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 Using where; Not exists
1306
1366
select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
1307
1367
companynr companyname
1308
1368
select count(*) from t2 left join t4 using (companynr) where companynr is not null;
1371
explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
1372
id select_type table type possible_keys key key_len ref rows Extra
1373
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
1374
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null;
1375
id select_type table type possible_keys key key_len ref rows Extra
1376
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
1311
1377
delete from t2 where fld1=999999;
1378
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
1379
id select_type table type possible_keys key key_len ref rows Extra
1380
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
1381
1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
1382
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
1383
id select_type table type possible_keys key key_len ref rows Extra
1384
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
1385
1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
1386
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;
1387
id select_type table type possible_keys key key_len ref rows Extra
1388
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
1389
1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
1390
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
1391
id select_type table type possible_keys key key_len ref rows Extra
1392
1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
1393
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
1394
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0;
1395
id select_type table type possible_keys key key_len ref rows Extra
1396
1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
1397
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
1398
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0;
1399
id select_type table type possible_keys key key_len ref rows Extra
1400
1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
1401
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
1402
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null;
1403
id select_type table type possible_keys key key_len ref rows Extra
1404
1 SIMPLE t4 ALL NULL NULL NULL NULL 12
1405
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
1406
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0;
1407
id select_type table type possible_keys key key_len ref rows Extra
1408
1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12
1409
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
1410
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0;
1411
id select_type table type possible_keys key key_len ref rows Extra
1412
1 SIMPLE t4 ALL NULL NULL NULL NULL 12
1413
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
1414
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null;
1415
id select_type table type possible_keys key key_len ref rows Extra
1416
1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
1417
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
1418
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0;
1419
id select_type table type possible_keys key key_len ref rows Extra
1420
1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
1421
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
1422
explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0;
1423
id select_type table type possible_keys key key_len ref rows Extra
1424
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
1425
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
1312
1426
select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
1313
1427
companynr companynr
1430
explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
1431
id select_type table type possible_keys key key_len ref rows Extra
1432
1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
1433
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where; Using join buffer
1316
1434
select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
1317
1435
fld1 companynr fld3 period
1318
38008 37 reporters 1008
1319
38208 37 Selfridge 1008
1436
038008 37 reporters 1008
1437
038208 37 Selfridge 1008
1320
1438
select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
1321
1439
fld1 companynr fld3 period
1322
38008 37 reporters 1008
1323
38208 37 Selfridge 1008
1440
038008 37 reporters 1008
1441
038208 37 Selfridge 1008
1324
1442
select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
1325
1443
fld1 companynr fld3 period
1326
38008 37 reporters 1008
1327
38208 37 Selfridge 1008
1444
038008 37 reporters 1008
1445
038208 37 Selfridge 1008
1328
1446
select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909);
1621
1744
select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4;
1622
1745
fld4 fld1 count(price) sum(price) min(price) max(price) avg(price)
1623
teethe 1 1 5987435 5987435 5987435 5987435.0000
1624
dreaded 11401 1 5987435 5987435 5987435 5987435.0000
1625
scholastics 11402 1 28357832 28357832 28357832 28357832.0000
1626
audiology 11403 1 39654943 39654943 39654943 39654943.0000
1627
wallet 11501 1 5987435 5987435 5987435 5987435.0000
1628
parters 11701 1 5987435 5987435 5987435 5987435.0000
1629
eschew 11702 1 28357832 28357832 28357832 28357832.0000
1630
quitter 11703 1 39654943 39654943 39654943 39654943.0000
1631
neat 12001 1 5987435 5987435 5987435 5987435.0000
1632
Steinberg 12003 1 39654943 39654943 39654943 39654943.0000
1633
balled 12301 1 5987435 5987435 5987435 5987435.0000
1634
persist 12302 1 28357832 28357832 28357832 28357832.0000
1635
attainments 12303 1 39654943 39654943 39654943 39654943.0000
1636
capably 12501 1 5987435 5987435 5987435 5987435.0000
1637
impulsive 12602 1 28357832 28357832 28357832 28357832.0000
1638
starlet 12603 1 39654943 39654943 39654943 39654943.0000
1639
featherweight 12701 1 5987435 5987435 5987435 5987435.0000
1640
pessimist 12702 1 28357832 28357832 28357832 28357832.0000
1641
daughter 12703 1 39654943 39654943 39654943 39654943.0000
1642
lawgiver 13601 1 5987435 5987435 5987435 5987435.0000
1643
stated 13602 1 28357832 28357832 28357832 28357832.0000
1644
readable 13603 1 39654943 39654943 39654943 39654943.0000
1645
testicle 13801 1 5987435 5987435 5987435 5987435.0000
1646
Parsifal 13802 1 28357832 28357832 28357832 28357832.0000
1647
leavings 13803 1 39654943 39654943 39654943 39654943.0000
1648
squeaking 13901 1 5987435 5987435 5987435 5987435.0000
1649
contrasted 16001 1 5987435 5987435 5987435 5987435.0000
1650
leftover 16201 1 5987435 5987435 5987435 5987435.0000
1651
whiteners 16202 1 28357832 28357832 28357832 28357832.0000
1652
erases 16301 1 5987435 5987435 5987435 5987435.0000
1653
Punjab 16302 1 28357832 28357832 28357832 28357832.0000
1654
Merritt 16303 1 39654943 39654943 39654943 39654943.0000
1655
sweetish 18001 1 5987435 5987435 5987435 5987435.0000
1656
dogging 18002 1 28357832 28357832 28357832 28357832.0000
1657
scornfully 18003 1 39654943 39654943 39654943 39654943.0000
1658
fetters 18012 1 28357832 28357832 28357832 28357832.0000
1659
bivalves 18013 1 39654943 39654943 39654943 39654943.0000
1660
skulking 18021 1 5987435 5987435 5987435 5987435.0000
1661
flint 18022 1 28357832 28357832 28357832 28357832.0000
1662
flopping 18023 1 39654943 39654943 39654943 39654943.0000
1663
Judas 18032 1 28357832 28357832 28357832 28357832.0000
1664
vacuuming 18033 1 39654943 39654943 39654943 39654943.0000
1665
medical 18041 1 5987435 5987435 5987435 5987435.0000
1666
bloodbath 18042 1 28357832 28357832 28357832 28357832.0000
1667
subschema 18043 1 39654943 39654943 39654943 39654943.0000
1668
interdependent 18051 1 5987435 5987435 5987435 5987435.0000
1669
Graves 18052 1 28357832 28357832 28357832 28357832.0000
1670
neonatal 18053 1 39654943 39654943 39654943 39654943.0000
1671
sorters 18061 1 5987435 5987435 5987435 5987435.0000
1672
epistle 18062 1 28357832 28357832 28357832 28357832.0000
1673
Conley 18101 1 5987435 5987435 5987435 5987435.0000
1674
lectured 18102 1 28357832 28357832 28357832 28357832.0000
1675
Abraham 18103 1 39654943 39654943 39654943 39654943.0000
1676
cage 18201 1 5987435 5987435 5987435 5987435.0000
1677
hushes 18202 1 28357832 28357832 28357832 28357832.0000
1678
Simla 18402 1 28357832 28357832 28357832 28357832.0000
1679
reporters 18403 1 39654943 39654943 39654943 39654943.0000
1680
coexist 18601 1 5987435 5987435 5987435 5987435.0000
1681
Beebe 18602 1 28357832 28357832 28357832 28357832.0000
1682
Taoism 18603 1 39654943 39654943 39654943 39654943.0000
1683
Connally 18801 1 5987435 5987435 5987435 5987435.0000
1684
fetched 18802 1 28357832 28357832 28357832 28357832.0000
1685
checkpoints 18803 1 39654943 39654943 39654943 39654943.0000
1686
gritty 18811 1 5987435 5987435 5987435 5987435.0000
1687
firearm 18812 1 28357832 28357832 28357832 28357832.0000
1688
minima 19101 1 5987435 5987435 5987435 5987435.0000
1689
Selfridge 19102 1 28357832 28357832 28357832 28357832.0000
1690
disable 19103 1 39654943 39654943 39654943 39654943.0000
1691
witchcraft 19201 1 5987435 5987435 5987435 5987435.0000
1692
betroth 30501 1 5987435 5987435 5987435 5987435.0000
1693
Manhattanize 30502 1 28357832 28357832 28357832 28357832.0000
1694
imprint 30503 1 39654943 39654943 39654943 39654943.0000
1695
swelling 31901 1 5987435 5987435 5987435 5987435.0000
1696
interrelationships 36001 1 5987435 5987435 5987435 5987435.0000
1697
riser 36002 1 28357832 28357832 28357832 28357832.0000
1698
bee 38001 1 5987435 5987435 5987435 5987435.0000
1699
kanji 38002 1 28357832 28357832 28357832 28357832.0000
1700
dental 38003 1 39654943 39654943 39654943 39654943.0000
1701
railway 38011 1 5987435 5987435 5987435 5987435.0000
1702
validate 38012 1 28357832 28357832 28357832 28357832.0000
1703
normalizes 38013 1 39654943 39654943 39654943 39654943.0000
1704
Kline 38101 1 5987435 5987435 5987435 5987435.0000
1705
Anatole 38102 1 28357832 28357832 28357832 28357832.0000
1706
partridges 38103 1 39654943 39654943 39654943 39654943.0000
1707
recruited 38201 1 5987435 5987435 5987435 5987435.0000
1708
dimensions 38202 1 28357832 28357832 28357832 28357832.0000
1709
Chicana 38203 1 39654943 39654943 39654943 39654943.0000
1746
teethe 000001 1 5987435 5987435 5987435 5987435.0000
1747
dreaded 011401 1 5987435 5987435 5987435 5987435.0000
1748
scholastics 011402 1 28357832 28357832 28357832 28357832.0000
1749
audiology 011403 1 39654943 39654943 39654943 39654943.0000
1750
wallet 011501 1 5987435 5987435 5987435 5987435.0000
1751
parters 011701 1 5987435 5987435 5987435 5987435.0000
1752
eschew 011702 1 28357832 28357832 28357832 28357832.0000
1753
quitter 011703 1 39654943 39654943 39654943 39654943.0000
1754
neat 012001 1 5987435 5987435 5987435 5987435.0000
1755
Steinberg 012003 1 39654943 39654943 39654943 39654943.0000
1756
balled 012301 1 5987435 5987435 5987435 5987435.0000
1757
persist 012302 1 28357832 28357832 28357832 28357832.0000
1758
attainments 012303 1 39654943 39654943 39654943 39654943.0000
1759
capably 012501 1 5987435 5987435 5987435 5987435.0000
1760
impulsive 012602 1 28357832 28357832 28357832 28357832.0000
1761
starlet 012603 1 39654943 39654943 39654943 39654943.0000
1762
featherweight 012701 1 5987435 5987435 5987435 5987435.0000
1763
pessimist 012702 1 28357832 28357832 28357832 28357832.0000
1764
daughter 012703 1 39654943 39654943 39654943 39654943.0000
1765
lawgiver 013601 1 5987435 5987435 5987435 5987435.0000
1766
stated 013602 1 28357832 28357832 28357832 28357832.0000
1767
readable 013603 1 39654943 39654943 39654943 39654943.0000
1768
testicle 013801 1 5987435 5987435 5987435 5987435.0000
1769
Parsifal 013802 1 28357832 28357832 28357832 28357832.0000
1770
leavings 013803 1 39654943 39654943 39654943 39654943.0000
1771
squeaking 013901 1 5987435 5987435 5987435 5987435.0000
1772
contrasted 016001 1 5987435 5987435 5987435 5987435.0000
1773
leftover 016201 1 5987435 5987435 5987435 5987435.0000
1774
whiteners 016202 1 28357832 28357832 28357832 28357832.0000
1775
erases 016301 1 5987435 5987435 5987435 5987435.0000
1776
Punjab 016302 1 28357832 28357832 28357832 28357832.0000
1777
Merritt 016303 1 39654943 39654943 39654943 39654943.0000
1778
sweetish 018001 1 5987435 5987435 5987435 5987435.0000
1779
dogging 018002 1 28357832 28357832 28357832 28357832.0000
1780
scornfully 018003 1 39654943 39654943 39654943 39654943.0000
1781
fetters 018012 1 28357832 28357832 28357832 28357832.0000
1782
bivalves 018013 1 39654943 39654943 39654943 39654943.0000
1783
skulking 018021 1 5987435 5987435 5987435 5987435.0000
1784
flint 018022 1 28357832 28357832 28357832 28357832.0000
1785
flopping 018023 1 39654943 39654943 39654943 39654943.0000
1786
Judas 018032 1 28357832 28357832 28357832 28357832.0000
1787
vacuuming 018033 1 39654943 39654943 39654943 39654943.0000
1788
medical 018041 1 5987435 5987435 5987435 5987435.0000
1789
bloodbath 018042 1 28357832 28357832 28357832 28357832.0000
1790
subschema 018043 1 39654943 39654943 39654943 39654943.0000
1791
interdependent 018051 1 5987435 5987435 5987435 5987435.0000
1792
Graves 018052 1 28357832 28357832 28357832 28357832.0000
1793
neonatal 018053 1 39654943 39654943 39654943 39654943.0000
1794
sorters 018061 1 5987435 5987435 5987435 5987435.0000
1795
epistle 018062 1 28357832 28357832 28357832 28357832.0000
1796
Conley 018101 1 5987435 5987435 5987435 5987435.0000
1797
lectured 018102 1 28357832 28357832 28357832 28357832.0000
1798
Abraham 018103 1 39654943 39654943 39654943 39654943.0000
1799
cage 018201 1 5987435 5987435 5987435 5987435.0000
1800
hushes 018202 1 28357832 28357832 28357832 28357832.0000
1801
Simla 018402 1 28357832 28357832 28357832 28357832.0000
1802
reporters 018403 1 39654943 39654943 39654943 39654943.0000
1803
coexist 018601 1 5987435 5987435 5987435 5987435.0000
1804
Beebe 018602 1 28357832 28357832 28357832 28357832.0000
1805
Taoism 018603 1 39654943 39654943 39654943 39654943.0000
1806
Connally 018801 1 5987435 5987435 5987435 5987435.0000
1807
fetched 018802 1 28357832 28357832 28357832 28357832.0000
1808
checkpoints 018803 1 39654943 39654943 39654943 39654943.0000
1809
gritty 018811 1 5987435 5987435 5987435 5987435.0000
1810
firearm 018812 1 28357832 28357832 28357832 28357832.0000
1811
minima 019101 1 5987435 5987435 5987435 5987435.0000
1812
Selfridge 019102 1 28357832 28357832 28357832 28357832.0000
1813
disable 019103 1 39654943 39654943 39654943 39654943.0000
1814
witchcraft 019201 1 5987435 5987435 5987435 5987435.0000
1815
betroth 030501 1 5987435 5987435 5987435 5987435.0000
1816
Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000
1817
imprint 030503 1 39654943 39654943 39654943 39654943.0000
1818
swelling 031901 1 5987435 5987435 5987435 5987435.0000
1819
interrelationships 036001 1 5987435 5987435 5987435 5987435.0000
1820
riser 036002 1 28357832 28357832 28357832 28357832.0000
1821
bee 038001 1 5987435 5987435 5987435 5987435.0000
1822
kanji 038002 1 28357832 28357832 28357832 28357832.0000
1823
dental 038003 1 39654943 39654943 39654943 39654943.0000
1824
railway 038011 1 5987435 5987435 5987435 5987435.0000
1825
validate 038012 1 28357832 28357832 28357832 28357832.0000
1826
normalizes 038013 1 39654943 39654943 39654943 39654943.0000
1827
Kline 038101 1 5987435 5987435 5987435 5987435.0000
1828
Anatole 038102 1 28357832 28357832 28357832 28357832.0000
1829
partridges 038103 1 39654943 39654943 39654943 39654943.0000
1830
recruited 038201 1 5987435 5987435 5987435 5987435.0000
1831
dimensions 038202 1 28357832 28357832 28357832 28357832.0000
1832
Chicana 038203 1 39654943 39654943 39654943 39654943.0000
1710
1833
select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3;
1711
1834
companynr fld3 sum(price)
1712
1835
512 boat 786542
1934
2066
Tables_in_test (s%)
1935
2067
show tables from test like "t?";
1936
2068
Tables_in_test (t?)
1937
show columns from t2;
1938
Field Type Null Default Default_is_NULL On_Update
1940
fld1 INTEGER NO 0 NO
1941
companynr INTEGER NO 0 NO
1946
show columns from t2 from test like 'f%';
1947
Field Type Null Default Default_is_NULL On_Update
1949
fld1 INTEGER NO 0 NO
1950
companynr INTEGER NO 0 NO
1955
show columns from t2 from test like 's%';
1956
Field Type Null Default Default_is_NULL On_Update
1958
fld1 INTEGER NO 0 NO
1959
companynr INTEGER NO 0 NO
2069
show full columns from t2;
2070
Field Type Collation Null Key Default Extra Privileges Comment
2071
auto int(11) NULL NO PRI NULL auto_increment #
2072
fld1 int(6) unsigned zerofill NULL NO UNI NULL #
2073
companynr tinyint(2) unsigned zerofill NULL NO NULL #
2074
fld3 char(30) latin1_swedish_ci NO MUL NULL #
2075
fld4 char(35) latin1_swedish_ci NO NULL #
2076
fld5 char(35) latin1_swedish_ci NO NULL #
2077
fld6 char(4) latin1_swedish_ci NO NULL #
2078
show full columns from t2 from test like 'f%';
2079
Field Type Collation Null Key Default Extra Privileges Comment
2080
fld1 int(6) unsigned zerofill NULL NO UNI NULL #
2081
fld3 char(30) latin1_swedish_ci NO MUL NULL #
2082
fld4 char(35) latin1_swedish_ci NO NULL #
2083
fld5 char(35) latin1_swedish_ci NO NULL #
2084
fld6 char(4) latin1_swedish_ci NO NULL #
2085
show full columns from t2 from test like 's%';
2086
Field Type Collation Null Key Default Extra Privileges Comment
2088
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
2089
t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE
2090
t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE
2091
t2 1 fld3 1 fld3 A NULL NULL NULL BTREE
1964
2092
drop table t4, t3, t2, t1;
1965
2093
CREATE TABLE t1 (
1966
id bigint NOT NULL auto_increment,
2094
id mediumint(8) unsigned NOT NULL auto_increment,
1967
2095
pseudo varchar(35) NOT NULL default '',
1968
2096
PRIMARY KEY (id),
1969
2097
UNIQUE KEY pseudo (pseudo)
1973
2101
SELECT 1 as rnd1 from t1 where rand() > 2;
1976
CREATE TEMPORARY TABLE t1 (gvid int default NULL, hmid int default NULL, volid int default NULL, mmid int default NULL, hdid int default NULL, fsid int default NULL, ctid int default NULL, dtid int default NULL, cost int default NULL, performance int default NULL, serialnumber bigint default NULL, monitored int default '1', removed int default '0', target int default '0', dt_modified timestamp NOT NULL, name varchar(255) default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM;
2104
CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM;
1977
2105
INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL);
1978
CREATE TEMPORARY TABLE t2 ( hmid int default NULL, volid int default NULL, sampletid int default NULL, sampletime datetime default NULL, samplevalue bigint default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM;
2106
CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM;
1979
2107
INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35);
1980
2108
SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid;
1981
ERROR HY000: Received an invalid datetime value 'wrong-date-value'.
2109
gvid the_success the_fail the_size the_time
2111
Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1
2112
Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1
1982
2113
SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid;
1983
2114
gvid the_success the_fail the_size the_time
1984
2115
DROP TABLE t1,t2;
1985
create table t1 ( A_Id bigint NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint NOT NULL default '0', A_UpdateSerial int NOT NULL default '0', other_types bigint NOT NULL default '0', wss_type bigint NOT NULL default '0');
2116
create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0');
1986
2117
INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093);
1987
2118
select wss_type from t1 where wss_type ='102935229216544106';
2361
CREATE TABLE t1 (b BIGINT NOT NULL, PRIMARY KEY (b));
2362
INSERT INTO t1 VALUES (0x4000000000000000);
2363
SELECT b FROM t1 WHERE b=0x4000000000000000;
2508
CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b));
2509
INSERT INTO t1 VALUES (0x8000000000000000);
2510
SELECT b FROM t1 WHERE b=0x8000000000000000;
2367
CREATE TABLE `t1` ( `gid` int default NULL, `uid` int default NULL);
2368
CREATE TABLE `t2` ( `ident` int default NULL, `level` char(16) default NULL);
2514
CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL);
2515
CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL);
2369
2516
INSERT INTO `t2` VALUES (0,'READ');
2370
CREATE TABLE `t3` ( `id` int default NULL, `name` char(16) default NULL);
2517
CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL);
2371
2518
INSERT INTO `t3` VALUES (1,'fs');
2372
2519
select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0);
2373
2520
id name gid uid ident level
2374
2521
1 fs NULL NULL 0 READ
2375
2522
drop table t1,t2,t3;
2376
2523
CREATE TABLE t1 (
2377
acct_id int NOT NULL default '0',
2378
profile_id int default NULL,
2524
acct_id int(11) NOT NULL default '0',
2525
profile_id smallint(6) default NULL,
2379
2526
UNIQUE KEY t1$acct_id (acct_id),
2380
2527
KEY t1$profile_id (profile_id)
2382
2529
INSERT INTO t1 VALUES (132,17),(133,18);
2383
2530
CREATE TABLE t2 (
2384
profile_id int default NULL,
2385
queue_id int default NULL,
2386
seq int default NULL,
2531
profile_id smallint(6) default NULL,
2532
queue_id int(11) default NULL,
2533
seq int(11) default NULL,
2387
2534
KEY t2$queue_id (queue_id)
2389
2536
INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1);
2390
2537
CREATE TABLE t3 (
2391
id int NOT NULL default '0',
2392
qtype int default NULL,
2393
seq int default NULL,
2394
warn_lvl int default NULL,
2395
crit_lvl int default NULL,
2396
rr1 int NOT NULL default '0',
2397
rr2 int default NULL,
2398
default_queue int NOT NULL default '0',
2538
id int(11) NOT NULL default '0',
2539
qtype int(11) default NULL,
2540
seq int(11) default NULL,
2541
warn_lvl int(11) default NULL,
2542
crit_lvl int(11) default NULL,
2543
rr1 tinyint(4) NOT NULL default '0',
2544
rr2 int(11) default NULL,
2545
default_queue tinyint(4) NOT NULL default '0',
2399
2546
KEY t3$qtype (qtype),
2562
2718
CREATE TABLE t2 (key2 float default NULL, UNIQUE KEY key2 (key2));
2563
2719
INSERT INTO t1 VALUES (0.3762),(0.3845),(0.6158),(0.7941);
2564
2720
INSERT INTO t2 VALUES (1.3762),(1.3845),(1.6158),(1.7941);
2721
explain select max(key1) from t1 where key1 <= 0.6158;
2722
id select_type table type possible_keys key key_len ref rows Extra
2723
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
2724
explain select max(key2) from t2 where key2 <= 1.6158;
2725
id select_type table type possible_keys key key_len ref rows Extra
2726
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
2727
explain select min(key1) from t1 where key1 >= 0.3762;
2728
id select_type table type possible_keys key key_len ref rows Extra
2729
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
2730
explain select min(key2) from t2 where key2 >= 1.3762;
2731
id select_type table type possible_keys key key_len ref rows Extra
2732
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
2733
explain select max(key1), min(key2) from t1, t2
2734
where key1 <= 0.6158 and key2 >= 1.3762;
2735
id select_type table type possible_keys key key_len ref rows Extra
2736
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
2737
explain select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
2738
id select_type table type possible_keys key key_len ref rows Extra
2739
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
2740
explain select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
2741
id select_type table type possible_keys key key_len ref rows Extra
2742
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
2565
2743
select max(key1) from t1 where key1 <= 0.6158;
2568
2746
select max(key2) from t2 where key2 <= 1.6158;
2571
2749
select min(key1) from t1 where key1 >= 0.3762;
2574
2752
select min(key2) from t2 where key2 >= 1.3762;
2577
2755
select max(key1), min(key2) from t1, t2
2578
2756
where key1 <= 0.6158 and key2 >= 1.3762;
2579
2757
max(key1) min(key2)
2758
0.6158000230789185 1.3761999607086182
2581
2759
select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
2584
2762
select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
2587
2765
DROP TABLE t1,t2;
2588
CREATE TABLE t1 (i BIGINT NOT NULL);
2766
CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL);
2589
2767
INSERT INTO t1 VALUES (10);
2590
2768
SELECT i='1e+01',i=1e+01, i in (1e+01,1e+01), i in ('1e+01','1e+01') FROM t1;
2591
2769
i='1e+01' i=1e+01 i in (1e+01,1e+01) i in ('1e+01','1e+01')
3179
3407
EXPLAIN SELECT * FROM t1
3180
3408
WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ;
3181
3409
id select_type table type possible_keys key key_len ref rows Extra
3182
1 SIMPLE t1 index_merge idx1,idx2 idx2,idx1 4,10 NULL # Using intersect(idx2,idx1); Using where; Using index
3410
1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where
3183
3411
EXPLAIN SELECT * FROM t1
3184
3412
WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ;
3185
3413
id select_type table type possible_keys key key_len ref rows Extra
3186
1 SIMPLE t1 ref idx1,idx2 idx2 4 const # Using where
3414
1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where
3187
3415
EXPLAIN SELECT * FROM t1
3188
3416
WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL;
3189
3417
id select_type table type possible_keys key key_len ref rows Extra
3190
1 SIMPLE t1 ref idx1,idx2 idx2 4 const # Using where
3418
1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where
3191
3419
DROP INDEX idx1 ON t1;
3192
3420
CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null);
3193
3421
EXPLAIN SELECT * FROM t1
3194
3422
WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ;
3195
3423
id select_type table type possible_keys key key_len ref rows Extra
3196
1 SIMPLE t1 index_merge idx1,idx2 idx2,idx1 4,10 NULL 1 Using intersect(idx2,idx1); Using where; Using index
3424
1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where
3197
3425
EXPLAIN SELECT * FROM t1
3198
3426
WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null IS NULL ;
3199
3427
id select_type table type possible_keys key key_len ref rows Extra
3200
1 SIMPLE t1 index_merge idx1,idx2 idx2,idx1 4,10 NULL 1 Using intersect(idx2,idx1); Using where; Using index
3428
1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where
3201
3429
EXPLAIN SELECT * FROM t1
3202
3430
WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL;
3203
3431
id select_type table type possible_keys key key_len ref rows Extra
3204
1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where
3432
1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where
3205
3433
EXPLAIN SELECT * FROM t1
3206
3434
WHERE ID_better=1 AND ID1_with_null IS NULL AND
3207
3435
(ID2_with_null=1 OR ID2_with_null=2);
3208
3436
id select_type table type possible_keys key key_len ref rows Extra
3209
1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where
3437
1 SIMPLE t1 ref idx1,idx2 idx2 4 const 1 Using where
3211
3439
CREATE TABLE t1 (a INT, ts TIMESTAMP, KEY ts(ts));
3212
3440
INSERT INTO t1 VALUES (30,"2006-01-03 23:00:00"), (31,"2006-01-03 23:00:00");
3586
3811
DROP TABLE t1, t2, t3;
3812
select str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT'
3813
and '2007/10/20 00:00:00 GMT';
3814
str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT'
3815
and '2007/10/20 00:00:00 GMT'
3818
Warning 1292 Truncated incorrect datetime value: '2007/10/01 00:00:00 GMT'
3819
Warning 1292 Truncated incorrect datetime value: '2007/10/20 00:00:00 GMT'
3820
select str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6';
3821
str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6'
3824
Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT-6'
3825
select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6';
3826
str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6'
3829
Warning 1292 Truncated incorrect date value: '2007/10/2000:00:00 GMT-6'
3830
select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6';
3831
str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6'
3834
Warning 1292 Truncated incorrect date value: '2007-10-1 00:00:00 GMT-6'
3835
select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6';
3836
str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6'
3839
Warning 1292 Truncated incorrect date value: '2007-10-01 x00:00:00 GMT-6'
3840
select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6';
3841
str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6'
3844
Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:00:00 GMT-6'
3845
select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6';
3846
str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6'
3849
Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:x00:00 GMT-6'
3850
select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6';
3851
str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6'
3854
Warning 1292 Truncated incorrect datetime value: '2007-10-01 x12:34:56 GMT-6'
3855
select str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6';
3856
str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'
3859
Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6'
3860
select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6';
3861
str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'
3864
Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6'
3865
select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56';
3866
str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56'
3868
select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00';
3869
str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00'
3871
select str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00';
3872
str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00'
3874
select str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00';
3875
str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00'
3878
Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34'
3879
select str_to_date('2007-02-30 12:34','%Y-%m-%d %H:%i') = '2007-02-30 12:34';
3880
str_to_date('2007-02-30 12:34','%Y-%m-%d %H:%i') = '2007-02-30 12:34'
3882
select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
3883
str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'
3885
select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00'
3886
and '2007/10/20 00:00:00';
3887
str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00'
3888
and '2007/10/20 00:00:00'
3890
select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20';
3891
str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'
3894
Warning 1292 Truncated incorrect datetime value: ''
3895
select str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20';
3896
str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20'
3898
select str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34';
3899
str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34'
3901
select str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34';
3902
str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34'
3904
select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '';
3905
str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = ''
3908
Warning 1292 Truncated incorrect datetime value: ''
3909
select str_to_date('1','%Y-%m-%d') = '1';
3910
str_to_date('1','%Y-%m-%d') = '1'
3913
Warning 1292 Truncated incorrect date value: '1'
3914
select str_to_date('1','%Y-%m-%d') = '1';
3915
str_to_date('1','%Y-%m-%d') = '1'
3918
Warning 1292 Truncated incorrect date value: '1'
3919
select str_to_date('','%Y-%m-%d') = '';
3920
str_to_date('','%Y-%m-%d') = ''
3923
Warning 1292 Truncated incorrect date value: ''
3924
select str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL;
3925
str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL
3927
select str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00';
3928
str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00'
3930
select str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL;
3931
str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL
3589
3935
# Bug#30736: Row Size Too Large Error Creating a Table and
3673
CREATE TABLE t1 (a INT);
3674
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
3675
CREATE TABLE t2 (b INT);
3676
INSERT INTO t2 VALUES (2);
3677
SELECT * FROM t1 WHERE a = 1 + 1;
3680
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = 1 + 1;
3681
id select_type table type possible_keys key key_len ref rows filtered Extra
3682
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
3684
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = <cache>((1 + 1)))
3685
SELECT * FROM t1 HAVING a = 1 + 1;
3688
EXPLAIN EXTENDED SELECT * FROM t1 HAVING a = 1 + 1;
3689
id select_type table type possible_keys key key_len ref rows filtered Extra
3690
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00
3692
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` having (`test`.`t1`.`a` = <cache>((1 + 1)))
3693
SELECT * FROM t1, t2 WHERE a = b + (1 + 1);
3696
EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE a = b + (1 + 1);
3697
id select_type table type possible_keys key key_len ref rows filtered Extra
3698
1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00
3699
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer
3701
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = (`test`.`t2`.`b` + <cache>((1 + 1))))
3702
SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1;
3705
EXPLAIN EXTENDED SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1;
3706
id select_type table type possible_keys key key_len ref rows filtered Extra
3707
1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00
3708
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00
3710
Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t2` left join `test`.`t1` on((`test`.`t1`.`a` = (`test`.`t2`.`b` + 1))) where 1
3711
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00');
3712
id select_type table type possible_keys key key_len ref rows filtered Extra
3713
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
3715
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > <cache>(unix_timestamp('2009-03-10 00:00:00')))