config root man

Current Path : /home/usr.opt/mysql57/mysql-test/suite/opt_trace/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
Upload File :
Current File : //home/usr.opt/mysql57/mysql-test/suite/opt_trace/t/range_no_prot.test

#Start server with MyISAM
--source include/force_myisam_default.inc

if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL
            + $VIEW_PROTOCOL > 0`)
{
   --skip Need normal protocol
}

# The main testing script
--source suite/opt_trace/include/range.inc

--echo
--echo # BUG#18023222 OPTIMIZER TRACE ERROR ON RANGE ANALYSIS OF
--echo #              INDEX ON A BINARY COLUMN
--echo

CREATE TABLE t(i INT PRIMARY KEY, b BINARY(16), INDEX i_b(b));
INSERT INTO t VALUES (1, x'D95B94336A9946A39CF5B58CFE772D8C');
INSERT INTO t VALUES (2, NULL);

EXPLAIN SELECT * FROM t WHERE b IN (0xD95B94336A9946A39CF5B58CFE772D8C);
SELECT trace FROM information_schema.optimizer_trace;

EXPLAIN SELECT * FROM t WHERE b IS NULL;
SELECT trace FROM information_schema.optimizer_trace;

drop table t;

--source include/show_json_object.inc

--echo #
--echo # Test trace of geometry fields
--echo #

# Must be an engine that supports spatial indexes
CREATE TABLE t1(
 pk INT AUTO_INCREMENT PRIMARY KEY,
 col_geom GEOMETRY NOT NULL
) ENGINE=MyISAM;

INSERT INTO t1 VALUES (1, ST_GeomFromText('POINT(10 10)'));
INSERT INTO t1 VALUES (2, ST_GeomFromText('POINT(11 11)'));

CREATE SPATIAL INDEX idx3 on t1(col_geom DESC);

--echo # Show that geometry data is traced as "unprintable_geometry_value"
EXPLAIN
SELECT pk, ST_AsText(col_geom)
FROM t1 
WHERE MBREquals(t1.col_geom, ST_GeomFromText('POINT(12 13)'));

SELECT show_json_object('"range_scan_alternatives": [', TRACE)
FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;

DROP TABLE t1;
DROP FUNCTION show_json_object;

Man Man