#
$$
# comment
select 1$$
--
$$
-- 
$$
--	
$$
-- comment
select 1$$
select 1--$$
select 1--2$$
select 1 -- 2
$$
select 1 +--------------------+ 2$$
SELECT * FROM tags$$
SELECT @@version_comment LIMIT ?$$
SELECT @@version_comment LIMIT 1 , 2$$
SELECT @@version_comment LIMIT 2 OFFSET 1$$
SHOW TABLES$$
SHOW TABLES FROM mem$$
SHOW TABLES FROM mem WHERE foo = ?$$
SHOW DATABASES$$
SHOW DATABASES LIKE 'blah'$$
SHOW DATABASES where b'111000111000'$$
SHOW DATABASES WHERE 0x123456789abcdef$$
show tables$$
show binary logs$$
SELECT ?$$
select * from sakila.order$$
select * from sakila.`order`$$
select a.* from sakila.order$$
select a.select.* from sakila.order$$
select a. value.  * from sakila.order$$
ALTER TABLE auth_user_user_permissions ADD CONSTRAINT user_id_refs_id_166738bf2045483 FOREIGN KEY ( user_id ) REFERENCES auth_user ( id ) ;$$
TRUNCATE auth_group ;$$
ALTER TABLE app_userprofile AUTO_INCREMENT = 123 ;$$
ALTER TABLE app_style ADD CONSTRAINT parent_id_refs_id_207218969d75db37 FOREIGN KEY ( parent_id ) REFERENCES app_style ( id ) ;$$
ALTER TABLE app_userprofile ADD CONSTRAINT user_id_refs_id_21d2d3dcdbfeeb97 FOREIGN KEY ( user_id ) REFERENCES auth_user ( id ) ;$$
TRUNCATE django_content_type ;$$
CREATE TABLE auth_group_permissions ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , group_id INTEGER NOT NULL , permission_id INTEGER NOT NULL , UNIQUE ( group_id , permission_id ) ) ;$$
SHOW INDEX FROM hilo_sequence_rule_eval_results FROM mem$$
SHOW FULL COLUMNS FROM inventory_types FROM mem LIKE 'abc'$$
CREATE TABLE app_recipe ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , author_id INTEGER NOT NULL , name VARCHAR( 1 ) NOT NULL , insert_date datetime NOT NULL , batch_size NUMERIC( 1 , 1 ) NOT NULL , batch_size_units VARCHAR( 1 ) NOT NULL , style_id INTEGER NULL , derived_from_recipe_id INTEGER NULL , type VARCHAR( 1 ) NOT NULL , source_url VARCHAR( 1 ) NULL , notes LONGTEXT NULL ) ;$$
SHOW INDEX FROM inventory_types FROM mem$$
SELECT foo, bar FROM table1 t1 INNER JOIN table3 t3 ON (t1.col = t3.col) LEFT OUTER JOIN table2 t2 ON ( t3.col = t2.col ) WHERE t1.foo = ?$$
SELECT foo, bar FROM table1 t1 INNER JOIN table3 t3 ON (t1.t1 = t3.t3) LEFT OUTER JOIN table2 t2 ON ( t3.t3_2 = t2.t2_2 )$$
SELECT hibinvento0_ . instance_id AS instance1_5_2_ , hibinvento0_ . instance_name AS instance2_5_2_ , hibinvento0_ . type_id AS type3_5_2_ , hibinvento0_ . parent_id AS parent4_5_2_ , hibinvento0_ . insert_count AS insert5_5_2_ , ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = hibinvento0_ . type_id ) AS clazz_2_ , hibtype1_ . type_id AS type1_3_0_ , hibtype1_ . type_name AS type2_3_0_ , hibtype1_ . namespace_id AS namespace3_3_0_ , hibtype1_ . insert_count AS insert4_3_0_ , ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = hibtype1_ . type_id ) AS clazz_0_ , hibnamespa2_ . namespace_id AS namespace1_2_1_ , hibnamespa2_ . namespace AS namespace2_1_ FROM inventory_instances hibinvento0_ INNER JOIN inventory_types hibtype1_ ON hibinvento0_ . type_id = hibtype1_ . type_id LEFT OUTER JOIN inventory_namespaces hibnamespa2_ ON hibtype1_ . namespace_id = hibnamespa2_ . namespace_id WHERE hibinvento0_ . instance_id = ?$$
CREATE TABLE auth_permission ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , name VARCHAR( 12 ) NOT NULL , content_type_id INTEGER NOT NULL , codename VARCHAR( 12 ) NOT NULL , UNIQUE ( content_type_id , codename ) ) ;$$
SHOW INDEX FROM hilo_sequence_inventory_attributes FROM mem$$
SHOW INDEX FROM migration_migration_state FROM mem$$
SELECT thresholds0_ . rule_id AS rule5_1_ , thresholds0_ . threshold_id AS threshold1_1_ , thresholds0_ . threshold_id AS threshold1_22_0_ , thresholds0_ . level AS level22_0_ , thresholds0_ . value AS value22_0_ , thresholds0_ . variable AS variable22_0_ FROM rule_thresholds thresholds0_ WHERE thresholds0_ . rule_id = ?$$
SELECT this_ . instance_id AS instance1_5_2_ , this_ . instance_name AS instance2_5_2_ , this_ . type_id AS type3_5_2_ , this_ . parent_id AS parent4_5_2_ , this_ . insert_count AS insert5_5_2_ , ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = this_ . type_id ) AS clazz_2_ , hibtype2_ . type_id AS type1_3_0_ , hibtype2_ . type_name AS type2_3_0_ , hibtype2_ . namespace_id AS namespace3_3_0_ , hibtype2_ . insert_count AS insert4_3_0_ , ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = hibtype2_ . type_id ) AS clazz_0_ , hibnamespa3_ . namespace_id AS namespace1_2_1_ , hibnamespa3_ . namespace AS namespace2_1_ FROM inventory_instances this_ INNER JOIN inventory_types hibtype2_ ON this_ . type_id = hibtype2_ . type_id LEFT OUTER JOIN inventory_namespaces hibnamespa3_ ON hibtype2_ . namespace_id = hibnamespa3_ . namespace_id WHERE ( this_ . type_id = ? AND this_ . instance_name = ? )$$
SHOW TABLE STATUS LIKE 'status'$$
SHOW INDEX FROM inventory_instances FROM mem$$
ALTER TABLE django_admin_log ADD CONSTRAINT content_type_id_refs_id_5c269194288599e6 FOREIGN KEY ( content_type_id ) REFERENCES django_content_type ( id ) ;$$
CREATE INDEX app_starredrecipe_recipe_id ON app_starredrecipe ( recipe_id ) ;$$
SELECT hibnamedgr0_ . group_id AS group1_7_0_ , hibinvento2_ . instance_id AS instance1_5_1_ , hibnamedgr0_ . group_name AS group2_7_0_ , hibinvento2_ . instance_name AS instance2_5_1_ , hibinvento2_ . type_id AS type3_5_1_ , hibinvento2_ . parent_id AS parent4_5_1_ , hibinvento2_ . insert_count AS insert5_5_1_ , ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = hibinvento2_ . type_id ) AS clazz_1_ , members0x1_ . group_id AS group1_0__ , members0x1_ . instance_id AS instance2_0__ FROM group_names hibnamedgr0_ LEFT OUTER JOIN group_members_v2 members0x1_ ON hibnamedgr0_ . group_id = members0x1_ . group_id LEFT OUTER JOIN inventory_instances hibinvento2_ ON members0x1_ . instance_id = hibinvento2_ . instance_id$$
SELECT this_ . attribute_id AS attribute1_4_2_ , this_ . type_id AS type2_4_2_ , this_ . attribute_name AS attribute3_4_2_ , this_ . attribute_type AS attribute4_4_2_ , this_ . insert_count AS insert5_4_2_ , hibtype2_ . type_id AS type1_3_0_ , hibtype2_ . type_name AS type2_3_0_ , hibtype2_ . namespace_id AS namespace3_3_0_ , hibtype2_ . insert_count AS insert4_3_0_ , ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = hibtype2_ . type_id ) AS clazz_0_ , hibnamespa3_ . namespace_id AS namespace1_2_1_ , hibnamespa3_ . namespace AS namespace2_1_ FROM inventory_attributes this_ INNER JOIN inventory_types hibtype2_ ON this_ . type_id = hibtype2_ . type_id LEFT OUTER JOIN inventory_namespaces hibnamespa3_ ON hibtype2_ . namespace_id = hibnamespa3_ . namespace_id WHERE ( this_ . type_id = ? AND this_ . attribute_name = ? )$$
ALTER TABLE app_recipeadjunct ADD CONSTRAINT adjunct_id_refs_id_c02b7279da6293f FOREIGN KEY ( adjunct_id ) REFERENCES app_adjunct ( id ) ;$$
CREATE INDEX app_recipegrain_grain_id ON app_recipegrain ( grain_id ) ;$$
SHOW INDEX FROM rule_variables FROM mem$$
SELECT MAX( end_time ) FROM dc_ng_double_age2$$
SHOW INDEX FROM resource_bundle FROM mem$$
SHOW INDEX FROM graph_series_v2 FROM mem$$
ALTER TABLE app_starredrecipe ADD CONSTRAINT recipe_id_refs_id_777ab9cdc3324649 FOREIGN KEY ( recipe_id ) REFERENCES app_recipe ( id ) ;$$
SHOW INDEX FROM inventory_instance_tags FROM mem$$
ALTER TABLE app_recipeyeast ADD CONSTRAINT recipe_id_refs_id_49e05ee7bf3c77f8 FOREIGN KEY ( recipe_id ) REFERENCES app_recipe ( id ) ;$$
UPDATE inventory_instance_attributes SET supported = ? , frequency = NULL , insert_count = ? , latest_save_time = ? , latest_string_value = NULL , latest_double_value = NULL , latest_long_value = ? WHERE instance_attribute_id = ?$$
SHOW INDEX FROM migration_status_servers_migration_status_data_collection FROM mem$$
SELECT MAX( end_time ) FROM dc_ng_double_age0$$
[<80000]CREATE TABLE app_grain ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , name VARCHAR( 1 ) NOT NULL , extract_min SMALLINT NULL , extract_max SMALLINT NULL , volume_potential_min SMALLINT NULL , volume_potential_max SMALLINT NULL , lovibond_min SMALLINT NULL , lovibond_max SMALLINT NULL , description VARCHAR( 1 ) NOT NULL , nodegroup VARCHAR( 1 ) NOT NULL ) ;$$
[>=80000]CREATE TABLE app_grain ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , name VARCHAR( 1 ) NOT NULL , extract_min SMALLINT NULL , extract_max SMALLINT NULL , volume_potential_min SMALLINT NULL , volume_potential_max SMALLINT NULL , lovibond_min SMALLINT NULL , lovibond_max SMALLINT NULL , `description` VARCHAR( 1 ) NOT NULL , nodegroup VARCHAR( 1 ) NOT NULL ) ;$$
TRUNCATE auth_message ;$$
SHOW FULL COLUMNS FROM migration_status_servers_migration_status_data_collection FROM mem LIKE 'blah'$$
SHOW INDEX FROM rule_alarms FROM mem$$
SELECT auth_permission . id , auth_permission . name , auth_permission . content_type_id , auth_permission . codename FROM auth_permission INNER JOIN django_content_type ON ( auth_permission . content_type_id = django_content_type . id ) WHERE ( auth_permission . codename = ? AND auth_permission . content_type_id = ? ) ORDER BY django_content_type . app_label ASC , auth_permission . codename ASC$$
TRUNCATE app_recipehop ;$$
SHOW INDEX FROM hilo_sequence_iia FROM mem$$
SHOW INDEX FROM system_maps FROM mem$$
CREATE TABLE auth_user ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , username VARCHAR( 1 ) NOT NULL UNIQUE , first_name VARCHAR( 1 ) NOT NULL , last_name VARCHAR( 1 ) NOT NULL , email VARCHAR( 1 ) NOT NULL , password VARCHAR( 1 ) NOT NULL , is_staff bool NOT NULL , is_active bool NOT NULL , is_superuser bool NOT NULL , last_login datetime NOT NULL , date_joined datetime NOT NULL ) ;$$
CREATE INDEX app_recipe_style_id ON app_recipe ( style_id ) ;$$
SELECT this_ . target_id AS target1_25_0_ , this_ . customSubject AS customSu2_25_0_ , this_ . memAdmin AS memAdmin25_0_ , this_ . name AS name25_0_ , this_ . recipients AS recipients25_0_ , this_ . smsFormat AS smsFormat25_0_ FROM target_email this_$$
SHOW INDEX FROM user_form_defaults FROM mem$$
CREATE TABLE app_brew ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , brew_date datetime NULL , brewer_id INTEGER NOT NULL , notes LONGTEXT NULL , recipe_id INTEGER NULL , last_update_date datetime NULL , last_state VARCHAR( 1 ) NULL , is_done bool NOT NULL ) ;$$
CREATE TABLE app_userprofile ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , user_id INTEGER NOT NULL UNIQUE , pref_brew_type VARCHAR( 1 ) NOT NULL , pref_make_starter bool NOT NULL , pref_secondary_ferm bool NOT NULL , pref_dispensing_style VARCHAR( 1 ) NOT NULL , timezone VARCHAR( 1 ) NOT NULL ) ;$$
CALL DC_STRING_INSERT( ? , ? , ? )$$
CREATE TABLE auth_user_groups ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , user_id INTEGER NOT NULL , group_id INTEGER NOT NULL , UNIQUE ( user_id , group_id ) ) ;$$
TRUNCATE app_recipeyeast ;$$
CREATE TABLE app_adjunct ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , name VARCHAR( 1 ) NOT NULL , nodegroup VARCHAR( 1 ) NOT NULL ) ;$$
DELETE FROM auth_user_groups WHERE user_id = ?$$
SELECT @@version$$
SHOW INDEX FROM rule_eval_result_vars FROM mem$$
TRUNCATE app_recipe ;$$
SELECT hibinstanc1_ . instance_attribute_id AS instance1_6_ , hibinstanc1_ . instance_id AS instance2_6_ , hibinstanc1_ . attribute_id AS attribute3_6_ , hibinstanc1_ . supported AS supported6_ , hibinstanc1_ . frequency AS frequency6_ , hibinstanc1_ . insert_count AS insert6_6_ , hibinstanc1_ . latest_save_time AS latest7_6_ , hibinstanc1_ . latest_string_value AS latest8_6_ , hibinstanc1_ . latest_double_value AS latest9_6_ , hibinstanc1_ . latest_long_value AS latest10_6_ FROM rule_dc_schedules rulevariab0_ INNER JOIN inventory_instance_attributes hibinstanc1_ ON rulevariab0_ . instance_attribute_id = hibinstanc1_ . instance_attribute_id$$
CREATE INDEX app_brew_recipe_id ON app_brew ( recipe_id ) ;$$
CREATE TABLE django_site ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , domain VARCHAR( 1 ) NOT NULL , name VARCHAR( 1 ) NOT NULL ) ;$$
SHOW TABLES$$
TRUNCATE app_recipegrain ;$$
SELECT MAX( end_time ) FROM dc_ng_long_age2$$
SHOW INDEX FROM graph_dc_schedules FROM mem$$
SHOW INDEX FROM loghistogram_data FROM mem$$
CREATE INDEX app_brew_brewer_id ON app_brew ( brewer_id ) ;$$
ALTER TABLE app_yeast ADD CONSTRAINT manufacturer_id_refs_id_590412a78c5bb44c FOREIGN KEY ( manufacturer_id ) REFERENCES app_yeastmanufacturer ( id ) ;$$
ALTER TABLE app_mockstep ADD CONSTRAINT step_ptr_id_refs_id_12ffba2120134a27 FOREIGN KEY ( step_ptr_id ) REFERENCES app_step ( id ) ;$$
SELECT MAX( end_time ) FROM dc_ng_double_age1$$
SELECT DISTINCT hibinvento2_ . instance_id AS instance1_5_ , hibinvento2_ . instance_name AS instance2_5_ , hibinvento2_ . type_id AS type3_5_ , hibinvento2_ . parent_id AS parent4_5_ , hibinvento2_ . insert_count AS insert5_5_ , ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = hibinvento2_ . type_id ) AS clazz_ FROM rule_dc_schedules rulevariab0_ , inventory_instance_attributes hibinstanc1_ INNER JOIN inventory_instances hibinvento2_ ON hibinstanc1_ . instance_id = hibinvento2_ . instance_id WHERE rulevariab0_ . instance_attribute_id = hibinstanc1_ . instance_attribute_id$$
SELECT hibevalres0_ . result_id AS result1_9_ , hibevalres0_ . alarm_id AS alarm2_9_ , hibevalres0_ . TIME AS time9_ , hibevalres0_ . level AS level9_ , variables1_ . result_id AS result1_0__ , variables1_ . value AS value0__ , variables1_ . variable AS variable0__ FROM rule_eval_results hibevalres0_ LEFT OUTER JOIN rule_eval_result_vars variables1_ ON hibevalres0_ . result_id = variables1_ . result_id WHERE hibevalres0_ . alarm_id = ? AND hibevalres0_ . TIME = ( SELECT MAX( hibevalres2_ . TIME ) FROM rule_eval_results hibevalres2_ WHERE hibevalres2_ . alarm_id = ? )$$
SELECT this_ . graph_id AS graph1_27_1_ , this_ . frequency AS frequency27_1_ , this_ . range_label AS range3_27_1_ , this_ . title AS title27_1_ , this_ . uuid AS uuid27_1_ , this_ . version AS version27_1_ , variables2_ . graph_id AS graph5_3_ , variables2_ . variable_id AS variable1_3_ , variables2_ . variable_id AS variable1_29_0_ , variables2_ . attribute_id AS attribute4_29_0_ , variables2_ . instance_name AS instance2_29_0_ , variables2_ . name AS name29_0_ FROM graphs this_ LEFT OUTER JOIN graph_variables_v2 variables2_ ON this_ . graph_id = variables2_ . graph_id$$
CREATE TABLE app_step ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , brew_id INTEGER NOT NULL , type VARCHAR( 1 ) NOT NULL , date datetime NOT NULL , entry_date datetime NOT NULL , volume NUMERIC( 987654321 , 123456789 ) NULL , volume_units VARCHAR( 1 ) NULL , temp INTEGER NULL , temp_units VARCHAR( 1 ) NULL , gravity_read NUMERIC( 987654321 , 123456789 ) NULL , gravity_read_temp INTEGER NULL , gravity_read_temp_units VARCHAR( 1 ) NULL , notes VARCHAR( 1 ) NOT NULL ) ;$$
CREATE INDEX django_admin_log_content_type_id ON django_admin_log ( content_type_id ) ;$$
ALTER TABLE auth_permission ADD CONSTRAINT content_type_id_refs_id_6bc81a32728de91f FOREIGN KEY ( content_type_id ) REFERENCES django_content_type ( id ) ;$$
SHOW INDEX FROM rule_eval_results FROM mem$$
SELECT containedm0_ . map_id AS map1_0_ , containedm0_ . entry_value AS entry2_0_ , containedm0_ . entry_key AS entry3_0_ FROM map_entries containedm0_ WHERE containedm0_ . map_id = ?$$
ALTER TABLE auth_message ADD CONSTRAINT user_id_refs_id_7837edc69af0b65a FOREIGN KEY ( user_id ) REFERENCES auth_user ( id ) ;$$
ALTER TABLE app_recipe ADD CONSTRAINT derived_from_recipe_id_refs_id_16a9d181f9f06875 FOREIGN KEY ( derived_from_recipe_id ) REFERENCES app_recipe ( id ) ;$$
SELECT ? AS DUMMY , VARIABLE_VALUE FROM INFORMATION_SCHEMA . GLOBAL_VARIABLES WHERE VARIABLE_NAME = ?$$
SHOW INDEX FROM graph_schedules FROM mem$$
SHOW INDEX FROM graph_variables_v2 FROM mem$$
SHOW INDEX FROM graph_tags FROM mem$$
CREATE INDEX app_recipegrain_recipe_id ON app_recipegrain ( recipe_id ) ;$$
ALTER TABLE app_brew ADD CONSTRAINT recipe_id_refs_id_4bebbbef5cc61b01 FOREIGN KEY ( recipe_id ) REFERENCES app_recipe ( id ) ;$$
SHOW INDEX FROM user_tags FROM mem$$
SELECT django_site . id , django_site . domain , django_site . name FROM django_site WHERE django_site . id = ? ORDER BY django_site . domain ASC$$
SELECT auth_user . id , auth_user . username , auth_user . first_name , auth_user . last_name , auth_user . email , auth_user . password , auth_user . is_staff , auth_user . is_active , auth_user . is_superuser , auth_user . last_login , auth_user . date_joined FROM auth_user WHERE auth_user . username = ?$$
CREATE TABLE app_hop ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , name VARCHAR( 1 ) NOT NULL , aau_low NUMERIC( 987654321 , 123456789 ) NOT NULL , aau_high NUMERIC( 987654321 , 123456789 ) NOT NULL ) ;$$
ALTER TABLE auth_user_groups ADD CONSTRAINT user_id_refs_id_1993cb70831107f1 FOREIGN KEY ( user_id ) REFERENCES auth_user ( id ) ;$$
ALTER TABLE app_recipe ADD CONSTRAINT author_id_refs_id_bef297bfea42c44 FOREIGN KEY ( author_id ) REFERENCES auth_user ( id ) ;$$
SELECT loghistogr0_ . type_id AS type1_3_ , loghistogr0_ . type_name AS type2_3_ , loghistogr0_ . namespace_id AS namespace3_3_ , loghistogr0_ . insert_count AS insert4_3_ FROM inventory_types loghistogr0_ , inventory_namespaces hibnamespa1_ WHERE ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = loghistogr0_ . type_id ) = ? AND loghistogr0_ . namespace_id = hibnamespa1_ . namespace_id AND hibnamespa1_ . namespace = ? AND loghistogr0_ . type_name = ?$$
SELECT hibrule0_ . rule_id AS rule1_20_ , hibrule0_ . advice AS advice20_ , hibrule0_ . certified AS certified20_ , hibrule0_ . command AS command20_ , hibrule0_ . default_frequency AS default5_20_ , hibrule0_ .description AS descript6_20_ , hibrule0_ . dirty AS dirty20_ , hibrule0_ . expression AS expression20_ , hibrule0_ . info AS info20_ , hibrule0_ . name AS name20_ , hibrule0_ . uuid AS uuid20_ , hibrule0_ . version AS version20_ FROM rules hibrule0_$$
ALTER TABLE app_recipehop ADD CONSTRAINT recipe_id_refs_id_2876974350134f61 FOREIGN KEY ( recipe_id ) REFERENCES app_recipe ( id ) ;$$
CREATE INDEX app_recipehop_hop_id ON app_recipehop ( hop_id ) ;$$
TRUNCATE django_admin_log ;$$
ALTER TABLE app_brew ADD CONSTRAINT brewer_id_refs_id_2bbc482ee2cc54d0 FOREIGN KEY ( brewer_id ) REFERENCES auth_user ( id ) ;$$
SELECT hibrulesch0_ . schedule_id AS schedule1_24_0_ , hibalarm1_ . alarm_id AS alarm1_11_1_ , hibevalres4_ . result_id AS result1_9_2_ , variables2_ . instance_attribute_id AS instance2_26_3_ , variables2_ . rule_schedule_id AS rule3_26_3_ , variables2_ . variable_id AS variable1_26_3_ , hibrulesch0_ . alarm_id AS alarm7_24_0_ , hibrulesch0_ . autoCloseEnabled AS autoClos2_24_0_ , hibrulesch0_ . autoCloseNote AS autoClos3_24_0_ , hibrulesch0_ . enabled AS enabled24_0_ , hibrulesch0_ . frequency AS frequency24_0_ , hibrulesch0_ . instance_id AS instance8_24_0_ , hibrulesch0_ . rule_id AS rule9_24_0_ , hibrulesch0_ . snmpEnabled AS snmpEnab6_24_0_ , hibalarm1_ . schedule_id AS schedule2_11_1_ , hibalarm1_ . severe_result_id AS severe3_11_1_ , hibalarm1_ . fixed_time AS fixed4_11_1_ , hibalarm1_ . email_targets AS email5_11_1_ , hibalarm1_ . notes AS notes11_1_ , hibalarm1_ . fixed_by_user_id AS fixed7_11_1_ , hibevalres4_ . alarm_id AS alarm2_9_2_ , hibevalres4_ . TIME AS time9_2_ , hibevalres4_ . level AS level9_2_ , variables2_ . rule_schedule_id AS rule3_0__ , variables2_ . instance_attribute_id AS instance2_0__ , variables2_ . variable_id AS variable1_0__ FROM rule_schedules hibrulesch0_ INNER JOIN rule_alarms hibalarm1_ ON hibrulesch0_ . alarm_id = hibalarm1_ . alarm_id INNER JOIN rule_eval_results hibevalres4_ ON hibalarm1_ . severe_result_id = hibevalres4_ . result_id INNER JOIN rule_dc_schedules variables2_ ON hibrulesch0_ . schedule_id = variables2_ . rule_schedule_id$$
SELECT MAX( end_time ) FROM dc_ng_string_now$$
SHOW FULL TABLES FROM mem where 0xDEADFEED > 0$$
SELECT hibinvento0_ . instance_id AS instance1_5_ , hibinvento0_ . instance_name AS instance2_5_ , hibinvento0_ . type_id AS type3_5_ , hibinvento0_ . parent_id AS parent4_5_ , hibinvento0_ . insert_count AS insert5_5_ , ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = hibinvento0_ . type_id ) AS clazz_ FROM inventory_instances hibinvento0_ WHERE hibinvento0_ . type_id = ?$$
SELECT hibtype0_ . type_id AS type1_3_ , hibtype0_ . type_name AS type2_3_ , hibtype0_ . namespace_id AS namespace3_3_ , hibtype0_ . insert_count AS insert4_3_ , ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = hibtype0_ . type_id ) AS clazz_ FROM inventory_types hibtype0_ , inventory_namespaces hibnamespa1_ WHERE hibtype0_ . namespace_id = hibnamespa1_ . namespace_id AND hibnamespa1_ . namespace = ? AND hibtype0_ . type_name = ?$$
UPDATE inventory_instance_attributes SET supported = ? , frequency = ? , insert_count = ? , latest_save_time = ? , latest_string_value = ? , latest_double_value = NULL , latest_long_value = NULL WHERE instance_attribute_id = ?$$
SHOW COLLATION$$
SHOW INDEX FROM hilo_sequence_inventory_namespaces FROM mem$$
DELETE FROM auth_user_user_permissions WHERE user_id = ?$$
CREATE TABLE app_recipehop ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , recipe_id INTEGER NOT NULL , hop_id INTEGER NOT NULL , amount_value NUMERIC( 987654321 , 123456789 ) NOT NULL , amount_units VARCHAR( 1 ) NOT NULL , boil_time SMALLINT NOT NULL ) ;$$
SET autocommit = ?$$
TRUNCATE app_starredrecipe ;$$
SELECT MAX( end_time ) FROM dc_ng_long_age1$$
rollback$$
SHOW INDEX FROM migration_status_data_collection FROM mem$$
ALTER TABLE app_recipeadjunct ADD CONSTRAINT recipe_id_refs_id_365f426a6fd3398d FOREIGN KEY ( recipe_id ) REFERENCES app_recipe ( id ) ;$$
TRUNCATE django_site ;$$
TRUNCATE django_session ;$$
CREATE INDEX app_style_parent_id ON app_style ( parent_id ) ;$$
SHOW INDEX FROM resource_bundle_map FROM mem$$
UPDATE inventory_instance_attributes SET supported = ? , frequency = NULL , insert_count = ? , latest_save_time = ? , latest_string_value = ? , latest_double_value = NULL , latest_long_value = NULL WHERE instance_attribute_id = ?$$
SELECT hibinstanc0_ . instance_attribute_id AS instance1_6_ , hibinstanc0_ . instance_id AS instance2_6_ , hibinstanc0_ . attribute_id AS attribute3_6_ , hibinstanc0_ . supported AS supported6_ , hibinstanc0_ . frequency AS frequency6_ , hibinstanc0_ . insert_count AS insert6_6_ , hibinstanc0_ . latest_save_time AS latest7_6_ , hibinstanc0_ . latest_string_value AS latest8_6_ , hibinstanc0_ . latest_double_value AS latest9_6_ , hibinstanc0_ . latest_long_value AS latest10_6_ FROM inventory_instance_attributes hibinstanc0_ WHERE hibinstanc0_ . instance_id = ? AND ( hibinstanc0_ . frequency IS NOT NULL )$$
SELECT hibinstanc0_ . instance_attribute_id AS instance1_6_ , hibinstanc0_ . instance_id AS instance2_6_ , hibinstanc0_ . attribute_id AS attribute3_6_ , hibinstanc0_ . supported AS supported6_ , hibinstanc0_ . frequency AS frequency6_ , hibinstanc0_ . insert_count AS insert6_6_ , hibinstanc0_ . latest_save_time AS latest7_6_ , hibinstanc0_ . latest_string_value AS latest8_6_ , hibinstanc0_ . latest_double_value AS latest9_6_ , hibinstanc0_ . latest_long_value AS latest10_6_ FROM inventory_instance_attributes hibinstanc0_ WHERE hibinstanc0_ . instance_id = ?$$
SHOW INDEX FROM map_entries FROM mem$$
ALTER TABLE auth_user_groups ADD CONSTRAINT group_id_refs_id_321a8efef0ee9890 FOREIGN KEY ( group_id ) REFERENCES auth_group ( id ) ;$$
commit$$
SET FOREIGN_KEY_CHECKS = ? ;$$
TRUNCATE auth_group_permissions ;$$
SELECT ( ABS( ? ) > ( ? * ? * ? ) )$$
SHOW INDEX FROM statement_summary_data FROM mem$$
SHOW INDEX FROM rule_thresholds FROM mem$$
SELECT hibattribu0_ . attribute_id AS attribute1_4_ , hibattribu0_ . type_id AS type2_4_ , hibattribu0_ . attribute_name AS attribute3_4_ , hibattribu0_ . attribute_type AS attribute4_4_ , hibattribu0_ . insert_count AS insert5_4_ FROM inventory_attributes hibattribu0_ WHERE hibattribu0_ . type_id = ?$$
ALTER TABLE app_recipegrain ADD CONSTRAINT grain_id_refs_id_161cf9f5a127807f FOREIGN KEY ( grain_id ) REFERENCES app_grain ( id ) ;$$
CREATE INDEX app_recipeadjunct_recipe_id ON app_recipeadjunct ( recipe_id ) ;$$
SELECT MAX( end_time ) FROM dc_ng_long_now$$
UPDATE inventory_instance_attributes SET supported = ? , frequency = NULL , insert_count = ? , latest_save_time = ? , latest_string_value = NULL , latest_double_value = ? , latest_long_value = NULL WHERE instance_attribute_id = ?$$
SELECT hibuser0_ . user_id AS user1_33_0_ , hibuser0_ . delete_time AS delete2_33_0_ , hibuser0_ . ext_authenticated AS ext3_33_0_ , hibuser0_ . ext_authoritative AS ext4_33_0_ , hibuser0_ . ext_role_mapped AS ext5_33_0_ , hibuser0_ . password AS password33_0_ , hibuser0_ . name AS name33_0_ , hibuser0_ . role AS role33_0_ , prefs1_ . user_id AS user1_2_ , prefs1_ . value AS value2_ , prefs1_ . property AS property2_ FROM users hibuser0_ LEFT OUTER JOIN user_preferences prefs1_ ON hibuser0_ . user_id = prefs1_ . user_id WHERE hibuser0_ . user_id = ?$$
TRUNCATE south_migrationhistory ;$$
CREATE INDEX app_recipehop_recipe_id ON app_recipehop ( recipe_id ) ;$$
SELECT explainrow0_ . type_id AS type1_3_ , explainrow0_ . type_name AS type2_3_ , explainrow0_ . namespace_id AS namespace3_3_ , explainrow0_ . insert_count AS insert4_3_ FROM inventory_types explainrow0_ , inventory_namespaces hibnamespa1_ WHERE ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = explainrow0_ . type_id ) = ? AND explainrow0_ . namespace_id = hibnamespa1_ . namespace_id AND hibnamespa1_ . namespace = ? AND explainrow0_ . type_name = ?$$
UPDATE inventory_instance_attributes SET supported = ? , frequency = ? , insert_count = ? , latest_save_time = ? , latest_string_value = NULL , latest_double_value = NULL , latest_long_value = ? WHERE instance_attribute_id = ?$$
ALTER TABLE django_admin_log ADD CONSTRAINT user_id_refs_id_6bfddbd40c8665aa FOREIGN KEY ( user_id ) REFERENCES auth_user ( id ) ;$$
SELECT MAX( end_time ) FROM dc_ng_long_age0$$
SHOW INDEX FROM group_members_v2 FROM mem$$
CREATE INDEX app_recipeyeast_yeast_id ON app_recipeyeast ( yeast_id ) ;$$
TRUNCATE app_grain ;$$
TRUNCATE app_userprofile ;$$
CREATE INDEX auth_message_user_id ON auth_message ( user_id ) ;$$
SELECT ( ? ) AS `a` FROM auth_user WHERE auth_user . id = ?$$
CREATE INDEX app_starredrecipe_user_id ON app_starredrecipe ( user_id ) ;$$
SHOW INDEX FROM tags FROM mem$$
SELECT this_ . id AS id41_4_ , serverstat2_ . migration_id AS migration1_6_ , hibmigrate3_ . id AS serverSt2_6_ , serverstat2_ . agent_uuid AS agent3_6_ , hibmigrate3_ . id AS id43_0_ , hibmigrate3_ . agent_uuid AS agent2_43_0_ , dcstatusma4_ . migration_status_servers_id AS migration1_7_ , hibmigrate5_ . id AS dcStatus2_7_ , dcstatusma4_ . collect_id AS collect3_7_ , hibmigrate5_ . id AS id44_1_ , hibmigrate5_ . attrib AS attrib44_1_ , hibmigrate5_ . blocks_migrated AS blocks3_44_1_ , hibmigrate5_ . cancel_time AS cancel4_44_1_ , hibmigrate5_ . finish_time AS finish5_44_1_ , hibmigrate5_ . instance AS instance44_1_ , hibmigrate5_ . instance_id AS instance14_44_1_ , hibmigrate5_ . last_begin_date AS last7_44_1_ , hibmigrate5_ . collect_id AS collect8_44_1_ , hibmigrate5_ . namespace AS namespace44_1_ , hibmigrate5_ . server_id AS server10_44_1_ , hibmigrate5_ . start_time AS start11_44_1_ , hibmigrate5_ . type AS type44_1_ , hibmigrate5_ . value_type AS value13_44_1_ , statestatu6_ . migration_status_servers_id AS migration1_8_ , hibmigrati7_ . id AS stateSta2_8_ , statestatu6_ . state AS state8_ , hibmigrati7_ . id AS id42_2_ , hibmigrati7_ . lastError AS lastError42_2_ , hibmigrati7_ . name AS name42_2_ , hibmigrati7_ . status AS status42_2_ , statestatu8_ . migration_id AS migration1_9_ , hibmigrati9_ . id AS stateSta2_9_ , statestatu8_ . state AS state9_ , hibmigrati9_ . id AS id42_3_ , hibmigrati9_ . lastError AS lastError42_3_ , hibmigrati9_ . name AS name42_3_ , hibmigrati9_ . status AS status42_3_ FROM migration this_ LEFT OUTER JOIN migration_migration_status_servers serverstat2_ ON this_ . id = serverstat2_ . migration_id LEFT OUTER JOIN migration_status_servers hibmigrate3_ ON serverstat2_ . serverStatusMap_id = hibmigrate3_ . id LEFT OUTER JOIN migration_status_servers_migration_status_data_collection dcstatusma4_ ON hibmigrate3_ . id = dcstatusma4_ . migration_status_servers_id LEFT OUTER JOIN migration_status_data_collection hibmigrate5_ ON dcstatusma4_ . dcStatusMap_id = hibmigrate5_ . id LEFT OUTER JOIN migration_status_servers_migration_state statestatu6_ ON hibmigrate3_ . id = statestatu6_ . migration_status_servers_id LEFT OUTER JOIN migration_state hibmigrati7_ ON statestatu6_ . stateStatusMap_id = hibmigrati7_ . id LEFT OUTER JOIN migration_migration_state statestatu8_ ON this_ . id = statestatu8_ . migration_id LEFT OUTER JOIN migration_state hibmigrati9_ ON statestatu8_ . stateStatusMap_id = hibmigrati9_ . id$$
SELECT variables0_ . rule_id AS rule5_1_ , variables0_ . variable_id AS variable1_1_ , variables0_ . variable_id AS variable1_23_0_ , variables0_ . attribute_id AS attribute4_23_0_ , variables0_ . instance_name AS instance2_23_0_ , variables0_ . name AS name23_0_ FROM rule_variables variables0_ WHERE variables0_ . rule_id = ?$$
CREATE TABLE django_session ( session_key VARCHAR( 1 ) NOT NULL PRIMARY KEY , session_data LONGTEXT NOT NULL , expire_date datetime NOT NULL ) ;$$
SELECT django_session . session_key , django_session . session_data , django_session . expire_date FROM django_session WHERE ( django_session . session_key = ? AND django_session . expire_date > ? )$$
TRUNCATE app_recipeadjunct ;$$
ALTER TABLE app_recipehop ADD CONSTRAINT hop_id_refs_id_85303d06ad1e481 FOREIGN KEY ( hop_id ) REFERENCES app_hop ( id ) ;$$
SHOW INDEX FROM migration_migration_status_servers FROM mem$$
CREATE TABLE app_recipeyeast ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , recipe_id INTEGER NOT NULL , yeast_id INTEGER NOT NULL , ideal bool NOT NULL ) ;$$
SELECT ( ? ) AS `a` FROM django_session WHERE django_session . session_key = ?$$
TRUNCATE auth_user ;$$
SELECT hibnamespa0_ . namespace_id AS namespace1_2_0_ , hibnamespa0_ . namespace AS namespace2_0_ FROM inventory_namespaces hibnamespa0_ WHERE hibnamespa0_ . namespace_id = ?$$
INSERT IGNORE INTO dc_p_long ( instance_attribute_id , end_time , value ) VALUES ( ? , ? , ? ) /* , ... */$$
SELECT this_ . user_id AS user1_33_0_ , this_ . delete_time AS delete2_33_0_ , this_ . ext_authenticated AS ext3_33_0_ , this_ . ext_authoritative AS ext4_33_0_ , this_ . ext_role_mapped AS ext5_33_0_ , this_ . password AS password33_0_ , this_ . name AS name33_0_ , this_ . role AS role33_0_ , prefs2_ . user_id AS user1_2_ , prefs2_ . value AS value2_ , prefs2_ . property AS property2_ FROM users this_ LEFT OUTER JOIN user_preferences prefs2_ ON this_ . user_id = prefs2_ . user_id WHERE this_ . name = ? AND this_ . delete_time = ?$$
SELECT hibattribu0_ . attribute_id AS attribute1_4_2_ , hibattribu0_ . type_id AS type2_4_2_ , hibattribu0_ . attribute_name AS attribute3_4_2_ , hibattribu0_ . attribute_type AS attribute4_4_2_ , hibattribu0_ . insert_count AS insert5_4_2_ , hibtype1_ . type_id AS type1_3_0_ , hibtype1_ . type_name AS type2_3_0_ , hibtype1_ . namespace_id AS namespace3_3_0_ , hibtype1_ . insert_count AS insert4_3_0_ , ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = hibtype1_ . type_id ) AS clazz_0_ , hibnamespa2_ . namespace_id AS namespace1_2_1_ , hibnamespa2_ . namespace AS namespace2_1_ FROM inventory_attributes hibattribu0_ INNER JOIN inventory_types hibtype1_ ON hibattribu0_ . type_id = hibtype1_ . type_id LEFT OUTER JOIN inventory_namespaces hibnamespa2_ ON hibtype1_ . namespace_id = hibnamespa2_ . namespace_id WHERE hibattribu0_ . attribute_id = ?$$
SHOW INDEX FROM migration_state FROM mem$$
CREATE TABLE app_yeastmanufacturer ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , name VARCHAR( 1 ) NOT NULL ) ;$$
TRUNCATE app_mockstep ;$$
SELECT hibinstanc0_ . supported AS col_0_0_ FROM inventory_instance_attributes hibinstanc0_ WHERE hibinstanc0_ . instance_id = ? AND hibinstanc0_ . attribute_id = ?$$
CREATE INDEX app_recipeadjunct_adjunct_id ON app_recipeadjunct ( adjunct_id ) ;$$
ALTER TABLE auth_group_permissions ADD CONSTRAINT group_id_refs_id_2ccea4c93cea63fe FOREIGN KEY ( group_id ) REFERENCES auth_group ( id ) ;$$
CREATE INDEX app_yeast_manufacturer_id ON app_yeast ( manufacturer_id ) ;$$
SELECT hibtag1_ . tag_id AS tag1_19_ , hibtag1_ . tag AS tag19_ FROM rule_tags ruletag0_ INNER JOIN tags hibtag1_ ON ruletag0_ . tag_id = hibtag1_ . tag_id WHERE ruletag0_ . object_id = ?$$
CREATE TABLE app_recipeadjunct ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , recipe_id INTEGER NOT NULL , adjunct_id INTEGER NOT NULL , amount_value NUMERIC( 987654321 , 123456789 ) NOT NULL , amount_units VARCHAR( 1 ) NOT NULL , boil_time SMALLINT NOT NULL , notes VARCHAR( 1 ) NULL ) ;$$
SELECT django_content_type . id , django_content_type . name , django_content_type . app_label , django_content_type . model FROM django_content_type WHERE ( django_content_type . model = ? AND django_content_type . app_label = ? ) ORDER BY django_content_type . name ASC$$
SET autocommit = ?$$
SELECT hibinvento0_ . instance_id AS instance1_5_ , hibinvento0_ . instance_name AS instance2_5_ , hibinvento0_ . type_id AS type3_5_ , hibinvento0_ . parent_id AS parent4_5_ , hibinvento0_ . insert_count AS insert5_5_ , ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = hibinvento0_ . type_id ) AS clazz_ FROM inventory_instances hibinvento0_ WHERE hibinvento0_ . parent_id = ? AND hibinvento0_ . type_id = ?$$
SELECT django_content_type . id , django_content_type . name , django_content_type . app_label , django_content_type . model FROM django_content_type WHERE django_content_type . app_label = ? ORDER BY django_content_type . name ASC$$
CREATE INDEX auth_permission_content_type_id ON auth_permission ( content_type_id ) ;$$
UPDATE auth_user SET username = ? , first_name = ? , last_name = ? , email = ? , password = ? , is_staff = ? , is_active = ? , is_superuser = ? , last_login = ? , date_joined = ? WHERE auth_user . id = ?$$
CREATE TABLE auth_user_user_permissions ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , user_id INTEGER NOT NULL , permission_id INTEGER NOT NULL , UNIQUE ( user_id , permission_id ) ) ;$$
SHOW INDEX FROM rule_schedules FROM mem$$
SET SESSION sql_mode = ?$$
CREATE INDEX app_recipe_derived_from_recipe_id ON app_recipe ( derived_from_recipe_id ) ;$$
ALTER TABLE app_recipe ADD CONSTRAINT style_id_refs_id_2654bba58db8f439 FOREIGN KEY ( style_id ) REFERENCES app_style ( id ) ;$$
CREATE TABLE app_mockstep ( step_ptr_id INTEGER NOT NULL PRIMARY KEY ) ;$$
UPDATE django_session SET session_data = ? , expire_date = ? WHERE django_session . session_key = ?$$
SHOW INDEX FROM statement_examples FROM mem$$
SELECT this_ . map_id AS map1_12_0_ , this_ . map_name AS map2_12_0_ FROM system_maps this_ WHERE this_ . map_name = ?$$
SELECT this_ . id AS id0_0_ , this_ . version AS version0_0_ FROM schema_version_v2 this_$$
SHOW VARIABLES WHERE Variable_name = ? OR Variable_name = ? OR Variable_name = ? OR Variable_name = ? OR Variable_name = ? OR Variable_name = ? OR Variable_name = ? OR Variable_name = ? OR Variable_name = ? OR Variable_name = ? OR Variable_name = ? OR Variable_name = ? OR Variable_name = ? OR Variable_name = ? OR Variable_name = ? OR Variable_name = ? OR Variable_name = ? OR Variable_name = ? OR Variable_name = ? OR Variable_name = ? OR Variable_name = ?$$
CREATE TABLE app_recipegrain ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , recipe_id INTEGER NOT NULL , grain_id INTEGER NOT NULL , amount_value NUMERIC( 987654321 , 123456789 ) NOT NULL , amount_units VARCHAR( 1 ) NOT NULL , by_weight_extract_override SMALLINT NULL , by_volume_extract_override SMALLINT NULL ) ;$$
SELECT statements0_ . type_id AS type1_3_ , statements0_ . type_name AS type2_3_ , statements0_ . namespace_id AS namespace3_3_ , statements0_ . insert_count AS insert4_3_ FROM inventory_types statements0_ , inventory_namespaces hibnamespa1_ WHERE ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = statements0_ . type_id ) = ? AND statements0_ . namespace_id = hibnamespa1_ . namespace_id AND hibnamespa1_ . namespace = ? AND statements0_ . type_name = ?$$
SELECT this_ . instance_attribute_id AS instance1_6_0_ , this_ . instance_id AS instance2_6_0_ , this_ . attribute_id AS attribute3_6_0_ , this_ . supported AS supported6_0_ , this_ . frequency AS frequency6_0_ , this_ . insert_count AS insert6_6_0_ , this_ . latest_save_time AS latest7_6_0_ , this_ . latest_string_value AS latest8_6_0_ , this_ . latest_double_value AS latest9_6_0_ , this_ . latest_long_value AS latest10_6_0_ FROM inventory_instance_attributes this_ WHERE ( this_ . instance_id = ? AND this_ . attribute_id = ? )$$
SHOW INDEX FROM users FROM mem$$
TRUNCATE app_yeastmanufacturer ;$$
SHOW INDEX FROM group_names FROM mem$$
SET autocommit = ?$$
SELECT MAX( end_time ) FROM dc_ng_double_now$$
commit$$
ALTER TABLE app_starredrecipe ADD CONSTRAINT user_id_refs_id_55aa723d777afb66 FOREIGN KEY ( user_id ) REFERENCES auth_user ( id ) ;$$
SHOW INDEX FROM graphs FROM mem$$
SELECT auth_user . id , auth_user . username , auth_user . first_name , auth_user . last_name , auth_user . email , auth_user . password , auth_user . is_staff , auth_user . is_active , auth_user . is_superuser , auth_user . last_login , auth_user . date_joined FROM auth_user WHERE auth_user . id = ?$$
CREATE TABLE app_style ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , name VARCHAR( 1 ) NOT NULL , bjcp_code VARCHAR( 1 ) NOT NULL , parent_id INTEGER NULL ) ;$$
ALTER TABLE app_step ADD CONSTRAINT brew_id_refs_id_25ceb2635e474d19 FOREIGN KEY ( brew_id ) REFERENCES app_brew ( id ) ;$$
TRUNCATE app_adjunct ;$$
TRUNCATE app_style ;$$
SHOW INDEX FROM schema_version_v2 FROM mem$$
CREATE INDEX django_admin_log_user_id ON django_admin_log ( user_id ) ;$$
CREATE TABLE auth_message ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , user_id INTEGER NOT NULL , message LONGTEXT NOT NULL ) ;$$
SHOW INDEX FROM support_portal_issues FROM mem$$
SHOW INDEX FROM target_email FROM mem$$
SELECT @@session . auto_increment_increment$$
CREATE TABLE app_starredrecipe ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , recipe_id INTEGER NOT NULL , user_id INTEGER NOT NULL , when_date datetime NOT NULL , notes VARCHAR( 1 ) NOT NULL ) ;$$
SELECT auth_message . id , auth_message . user_id , auth_message . message FROM auth_message WHERE auth_message . user_id = ?$$
TRUNCATE app_brew ;$$
CREATE DATABASE test_brew_journal$$
TRUNCATE auth_user_groups ;$$
SELECT django_session . session_key , django_session . session_data , django_session . expire_date FROM django_session WHERE django_session . session_key = ?$$
SET net_write_timeout = ?$$
TRUNCATE app_step ;$$
CREATE INDEX app_step_brew_id ON app_step ( brew_id ) ;$$
ALTER TABLE auth_group_permissions ADD CONSTRAINT permission_id_refs_id_4de83ca7792de1 FOREIGN KEY ( permission_id ) REFERENCES auth_permission ( id ) ;$$
CREATE TABLE django_content_type ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , name VARCHAR( 1 ) NOT NULL , app_label VARCHAR( 1 ) NOT NULL , model VARCHAR( 1 ) NOT NULL , UNIQUE ( app_label , model ) ) ;$$
SELECT series0_ . graph_id AS graph4_1_ , series0_ . series_id AS series1_1_ , series0_ . series_id AS series1_28_0_ , series0_ . expression AS expression28_0_ , series0_ . label AS label28_0_ FROM graph_series_v2 series0_ WHERE series0_ . graph_id = ?$$
SET character_set_results = NULL$$
SHOW INDEX FROM migration_status_servers_migration_state FROM mem$$
SELECT value FROM mysql . inventory WHERE name = ?$$
ALTER TABLE auth_user_user_permissions ADD CONSTRAINT permission_id_refs_id_6d7fb3c2067e79cb FOREIGN KEY ( permission_id ) REFERENCES auth_permission ( id ) ;$$
CREATE INDEX app_recipeyeast_recipe_id ON app_recipeyeast ( recipe_id ) ;$$
SELECT hibtag0_ . tag_id AS tag1_19_ , hibtag0_ . tag AS tag19_ FROM tags hibtag0_ WHERE hibtag0_ . tag = ?$$
SELECT statementt0_ . type_id AS type1_3_ , statementt0_ . type_name AS type2_3_ , statementt0_ . namespace_id AS namespace3_3_ , statementt0_ . insert_count AS insert4_3_ FROM inventory_types statementt0_ , inventory_namespaces hibnamespa1_ WHERE ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = statementt0_ . type_id ) = ? AND statementt0_ . namespace_id = hibnamespa1_ . namespace_id AND hibnamespa1_ . namespace = ? AND statementt0_ . type_name = ?$$
SELECT hibinvento0_ . instance_id AS instance1_5_ , hibinvento0_ . instance_name AS instance2_5_ , hibinvento0_ . type_id AS type3_5_ , hibinvento0_ . parent_id AS parent4_5_ , hibinvento0_ . insert_count AS insert5_5_ , ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = hibinvento0_ . type_id ) AS clazz_ FROM inventory_instances hibinvento0_ WHERE hibinvento0_ . parent_id = ? AND hibinvento0_ . type_id = ? AND hibinvento0_ . instance_name = ?$$
SHOW INDEX FROM rules FROM mem$$
CREATE TABLE south_migrationhistory ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , app_name VARCHAR( 1 ) NOT NULL , migration VARCHAR( 1 ) NOT NULL , applied datetime NULL ) ;$$
ALTER TABLE app_recipegrain ADD CONSTRAINT recipe_id_refs_id_4de65a03053ff3d1 FOREIGN KEY ( recipe_id ) REFERENCES app_recipe ( id ) ;$$
TRUNCATE auth_permission ;$$
TRUNCATE app_hop ;$$
CREATE TABLE django_admin_log ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , action_time datetime NOT NULL , user_id INTEGER NOT NULL , content_type_id INTEGER NULL , object_id LONGTEXT NULL , object_repr VARCHAR( 1 ) NOT NULL , action_flag SMALLINT UNSIGNED NOT NULL , change_message LONGTEXT NOT NULL ) ;$$
ALTER TABLE app_recipeyeast ADD CONSTRAINT yeast_id_refs_id_199b9bf059db7255 FOREIGN KEY ( yeast_id ) REFERENCES app_yeast ( id ) ;$$
CREATE TABLE auth_group ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , name VARCHAR( 1 ) NOT NULL UNIQUE ) ;$$
TRUNCATE auth_user_user_permissions ;$$
CREATE INDEX app_recipe_author_id ON app_recipe ( author_id ) ;$$
DELETE FROM django_site WHERE id IN ( ? /* , ... */ )$$
UPDATE inventory_instance_attributes SET supported = ? , frequency = ? , insert_count = ? , latest_save_time = ? , latest_string_value = NULL , latest_double_value = ? , latest_long_value = NULL WHERE instance_attribute_id = ?$$
rollback$$
INSERT INTO inventory_instances ( instance_name , type_id , parent_id , insert_count , instance_id ) VALUES ( ? , ? , ? , ? , ? ) ON DUPLICATE KEY UPDATE insert_count = insert_count + ?$$
SELECT ( ? ) AS `a` FROM auth_user WHERE auth_user . username = ?$$
UPDATE django_site SET domain = ? , name = ? WHERE django_site . id = ?$$
SELECT app_brew . id , app_brew . brew_date , app_brew . brewer_id , app_brew . notes , app_brew . recipe_id , app_brew . last_update_date , app_brew . last_state , app_brew . is_done FROM app_brew WHERE ( app_brew . is_done = ? AND app_brew . brewer_id = ? ) ORDER BY app_brew . brew_date DESC$$
SELECT app_grain . id , app_grain . name , app_grain . extract_min , app_grain . extract_max , app_grain . volume_potential_min , app_grain . volume_potential_max , app_grain . lovibond_min , app_grain . lovibond_max , app_grain .description , app_grain . nodegroup FROM app_grain$$
SELECT app_userprofile . id , app_userprofile . user_id , app_userprofile . pref_brew_type , app_userprofile . pref_make_starter , app_userprofile . pref_secondary_ferm , app_userprofile . pref_dispensing_style , app_userprofile . timezone FROM app_userprofile WHERE app_userprofile . user_id = ?$$
DELETE FROM django_session WHERE session_key IN ( ? /* , ... */ )$$
SELECT ( ( ? = ? ) && ( ( ? * ? ) <= LEAST( ? , ( ? / ? ) ) ) )$$
SELECT app_recipe . id , app_recipe . author_id , app_recipe . name , app_recipe . insert_date , app_recipe . batch_size , app_recipe . batch_size_units , app_recipe . style_id , app_recipe . derived_from_recipe_id , app_recipe . type , app_recipe . source_url , app_recipe . notes FROM app_recipe WHERE app_recipe . author_id = ? ORDER BY app_recipe . insert_date DESC LIMIT ?$$
UPDATE inventory_instances SET parent_id = ? , insert_count = ? WHERE instance_id = ?$$
UPDATE inventory_instance_attributes SET supported = ? , frequency = ? , insert_count = ? , latest_save_time = ? , latest_string_value = NULL , latest_double_value = NULL , latest_long_value = NULL WHERE instance_attribute_id = ?$$
SELECT ( ? ) AS `a` FROM django_site WHERE django_site . id = ?$$
SELECT app_starredrecipe . id , app_starredrecipe . recipe_id , app_starredrecipe . user_id , app_starredrecipe . when_date , app_starredrecipe . notes FROM app_starredrecipe WHERE app_starredrecipe . user_id = ?$$
UPDATE hilo_sequence_inventory_instances SET next_value = ? WHERE next_value = ?$$
SELECT ( ( ( ? = ? ) && ( LOCATE( ? , ? ) <= ? ) ) )$$
SELECT app_brew . id , app_brew . brew_date , app_brew . brewer_id , app_brew . notes , app_brew . recipe_id , app_brew . last_update_date , app_brew . last_state , app_brew . is_done FROM app_brew ORDER BY app_brew . brew_date DESC LIMIT ?$$
SELECT app_brew . id , app_brew . brew_date , app_brew . brewer_id , app_brew . notes , app_brew . recipe_id , app_brew . last_update_date , app_brew . last_state , app_brew . is_done FROM app_brew WHERE app_brew . brewer_id = ? ORDER BY app_brew . brew_date DESC LIMIT ?$$
SELECT app_recipe . id , app_recipe . author_id , app_recipe . name , app_recipe . insert_date , app_recipe . batch_size , app_recipe . batch_size_units , app_recipe . style_id , app_recipe . derived_from_recipe_id , app_recipe . type , app_recipe . source_url , app_recipe . notes FROM app_recipe ORDER BY app_recipe . insert_date DESC LIMIT ?$$
SELECT auth_user . id , auth_user . username , auth_user . first_name , auth_user . last_name , auth_user . email , auth_user . password , auth_user . is_staff , auth_user . is_active , auth_user . is_superuser , auth_user . last_login , auth_user . date_joined FROM auth_user WHERE auth_user . email LIKE ?$$
SELECT auth_group . id , auth_group . name FROM auth_group INNER JOIN auth_user_groups ON ( auth_group . id = auth_user_groups . group_id ) WHERE auth_user_groups . user_id = ?$$
CALL DC_STRING_INSERT( ? , ? , NULL )$$
SELECT app_step . id , app_step . brew_id , app_step . type , app_step . date , app_step . entry_date , app_step . volume , app_step . volume_units , app_step . temp , app_step . temp_units , app_step . gravity_read , app_step . gravity_read_temp , app_step . gravity_read_temp_units , app_step . notes FROM app_step ORDER BY app_step . date DESC LIMIT ?$$
SELECT app_brew . id , app_brew . brew_date , app_brew . brewer_id , app_brew . notes , app_brew . recipe_id , app_brew . last_update_date , app_brew . last_state , app_brew . is_done FROM app_brew WHERE ( app_brew . is_done = ? AND app_brew . brewer_id = ? ) ORDER BY app_brew . brew_date ASC , app_brew . last_update_date ASC$$
SELECT next_value FROM hilo_sequence_inventory_instances FOR UPDATE$$
SELECT hibinstanc0_ . instance_attribute_id AS instance1_6_4_ , hibinstanc0_ . instance_id AS instance2_6_4_ , hibinstanc0_ . attribute_id AS attribute3_6_4_ , hibinstanc0_ . supported AS supported6_4_ , hibinstanc0_ . frequency AS frequency6_4_ , hibinstanc0_ . insert_count AS insert6_6_4_ , hibinstanc0_ . latest_save_time AS latest7_6_4_ , hibinstanc0_ . latest_string_value AS latest8_6_4_ , hibinstanc0_ . latest_double_value AS latest9_6_4_ , hibinstanc0_ . latest_long_value AS latest10_6_4_ , hibinvento1_ . instance_id AS instance1_5_0_ , hibinvento1_ . instance_name AS instance2_5_0_ , hibinvento1_ . type_id AS type3_5_0_ , hibinvento1_ . parent_id AS parent4_5_0_ , hibinvento1_ . insert_count AS insert5_5_0_ , ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = hibinvento1_ . type_id ) AS clazz_0_ , hibtype2_ . type_id AS type1_3_1_ , hibtype2_ . type_name AS type2_3_1_ , hibtype2_ . namespace_id AS namespace3_3_1_ , hibtype2_ . insert_count AS insert4_3_1_ , ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = hibtype2_ . type_id ) AS clazz_1_ , hibattribu3_ . attribute_id AS attribute1_4_2_ , hibattribu3_ . type_id AS type2_4_2_ , hibattribu3_ . attribute_name AS attribute3_4_2_ , hibattribu3_ . attribute_type AS attribute4_4_2_ , hibattribu3_ . insert_count AS insert5_4_2_ , hibtype4_ . type_id AS type1_3_3_ , hibtype4_ . type_name AS type2_3_3_ , hibtype4_ . namespace_id AS namespace3_3_3_ , hibtype4_ . insert_count AS insert4_3_3_ , ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = hibtype4_ . type_id ) AS clazz_3_ FROM inventory_instance_attributes hibinstanc0_ INNER JOIN inventory_instances hibinvento1_ ON hibinstanc0_ . instance_id = hibinvento1_ . instance_id LEFT OUTER JOIN inventory_types hibtype2_ ON hibinvento1_ . type_id = hibtype2_ . type_id INNER JOIN inventory_attributes hibattribu3_ ON hibinstanc0_ . attribute_id = hibattribu3_ . attribute_id LEFT OUTER JOIN inventory_types hibtype4_ ON hibattribu3_ . type_id = hibtype4_ . type_id WHERE hibinstanc0_ . instance_attribute_id = ?$$
DELETE FROM log_db_actions WHERE id IN ( ? /* , ... */ )$$
SELECT ( ? IN ( ? /* , ... */ ) )$$
SELECT app_yeast . id , app_yeast . manufacturer_id , app_yeast . ident , app_yeast . name , app_yeast .description , app_yeast . type FROM app_yeast$$
SELECT django_session . session_key , django_session . session_data , django_session . expire_date FROM django_session WHERE django_session . session_key = ? LIMIT ?$$
SELECT app_adjunct . id , app_adjunct . name , app_adjunct . nodegroup FROM app_adjunct$$
SELECT ( ? ) AS `a` FROM app_userprofile WHERE app_userprofile . id = ?$$
SELECT id , millis_stamp , function_name , table_name , log_msg FROM log_db_actions ORDER BY id ASC LIMIT ?$$
SELECT auth_permission . id , auth_permission . name , auth_permission . content_type_id , auth_permission . codename FROM auth_permission INNER JOIN auth_user_user_permissions ON ( auth_permission . id = auth_user_user_permissions . permission_id ) INNER JOIN django_content_type ON ( auth_permission . content_type_id = django_content_type . id ) WHERE auth_user_user_permissions . user_id = ? ORDER BY django_content_type . app_label ASC , auth_permission . codename ASC$$
SELECT auth_user . id , auth_user . username , auth_user . first_name , auth_user . last_name , auth_user . email , auth_user . password , auth_user . is_staff , auth_user . is_active , auth_user . is_superuser , auth_user . last_login , auth_user . date_joined FROM auth_user WHERE auth_user . email = ?$$
UPDATE inventory_instance_attributes SET supported = ? , frequency = NULL , insert_count = ? , latest_save_time = ? , latest_string_value = NULL , latest_double_value = NULL , latest_long_value = NULL WHERE instance_attribute_id = ?$$
SELECT this_ . id AS id36_0_ , this_ . alias AS alias36_0_ , this_ . database_name AS database3_36_0_ , this_ . query_type AS query4_36_0_ , this_ . TEXT AS text36_0_ , this_ . text_hash AS text6_36_0_ FROM statement_data this_ WHERE ( this_ . database_name = ? AND this_ . text_hash = ? )$$
SELECT app_grain . id , app_grain . name , app_grain . extract_min , app_grain . extract_max , app_grain . volume_potential_min , app_grain . volume_potential_max , app_grain . lovibond_min , app_grain . lovibond_max , app_grain .description , app_grain . nodegroup FROM app_grain WHERE app_grain . name LIKE BINARY ?$$
SELECT app_style . id , app_style . name , app_style . bjcp_code , app_style . parent_id FROM app_style WHERE app_style . id = ?$$
SELECT COUNT( * ) FROM app_brew WHERE app_brew . id IN ( ? /* , ... */ )$$
SELECT next_value FROM hilo_sequence_iia FOR UPDATE$$
SELECT next_value FROM hilo_sequence_rule_eval_results FOR UPDATE$$
SELECT ( ? != ? )$$
SELECT ( ? / ( ? * ? * ? ) > ? && ( ( ? < ? ) || ( LOCATE( ? , ? ) > ? ) ) )$$
SELECT ( ( ? = ? ) && ( ? = ? && ? = ? && ? = ? && ? = ? && ? = ? && ? = ? ) && ( ? = ? ) && ( ? = ? ) )$$
SELECT ( ( ( ? < ? ) && ( LOCATE( ? , ? ) = ? ) ) || ( ( ? >= ? ) && ( LOCATE( ? , ? ) = ? ) && ( LOCATE( ? , ? ) = ? ) && ( LOCATE( ? , ? ) = ? ) ) )$$
SELECT app_recipegrain . id , app_recipegrain . recipe_id , app_recipegrain . grain_id , app_recipegrain . amount_value , app_recipegrain . amount_units , app_recipegrain . by_weight_extract_override , app_recipegrain . by_volume_extract_override FROM app_recipegrain WHERE app_recipegrain . recipe_id IS NULL$$
UPDATE hilo_sequence_iia SET next_value = ? WHERE next_value = ?$$
INSERT IGNORE INTO statement_summary_data ( bytes , `count` , errors , exec_time , max_bytes , max_exec_time , max_rows , min_bytes , min_exec_time , min_rows , no_good_index_used , no_index_used , `rows` , warnings , statement_summary_id , TIMESTAMP ) VALUES ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )$$
SELECT hibstateme0_ . id AS id37_0_ , hibstateme0_ . discovery_time AS discovery2_37_0_ , hibstateme0_ . instance_id AS instance3_37_0_ , hibstateme0_ . statement_data_id AS statement4_37_0_ FROM statement_summaries hibstateme0_ WHERE hibstateme0_ . id = ?$$
SELECT app_grain . id , app_grain . name , app_grain . extract_min , app_grain . extract_max , app_grain . volume_potential_min , app_grain . volume_potential_max , app_grain . lovibond_min , app_grain . lovibond_max , app_grain .description , app_grain . "group" FROM app_grain WHERE ( app_grain . name = ? AND app_grain . "group" = ? )$$
SELECT COUNT( * ) FROM app_step INNER JOIN app_brew ON ( app_step . brew_id = app_brew . id ) WHERE ( app_step . date > ? AND app_brew . brewer_id = ? )$$
INSERT INTO inventory_instance_attributes ( instance_id , attribute_id , supported , frequency , insert_count , latest_save_time , latest_string_value , latest_double_value , latest_long_value , instance_attribute_id ) VALUES ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ) ON DUPLICATE KEY UPDATE insert_count = insert_count + ?$$
INSERT INTO rule_eval_results ( alarm_id , TIME , level , result_id ) VALUES ( ? , ? , ? , ? )$$
UPDATE hilo_sequence_rule_eval_results SET next_value = ? WHERE next_value = ?$$
SELECT app_style . id , app_style . name , app_style . bjcp_code , app_style . parent_id FROM app_style WHERE app_style . parent_id IS NULL$$
SELECT app_grain . id , app_grain . name , app_grain . extract_min , app_grain . extract_max , app_grain . volume_potential_min , app_grain . volume_potential_max , app_grain . lovibond_min , app_grain . lovibond_max , app_grain .description , app_grain . `group` FROM app_grain WHERE app_grain . name = ?$$
UPDATE app_userprofile SET user_id = ? , pref_brew_type = ? , pref_make_starter = ? , pref_secondary_ferm = ? , pref_dispensing_style = ? , timezone = ? WHERE app_userprofile . id = ?$$
SELECT app_recipe . id , app_recipe . author_id , app_recipe . name , app_recipe . insert_date , app_recipe . batch_size , app_recipe . batch_size_units , app_recipe . style_id , app_recipe . derived_from_recipe_id , app_recipe . type , app_recipe . source_url , app_recipe . notes FROM app_recipe WHERE app_recipe . id = ?$$
SELECT app_hop . id , app_hop . name , app_hop . aau_low , app_hop . aau_high FROM app_hop WHERE app_hop . name = ?$$
SELECT app_hop . id , app_hop . name , app_hop . aau_low , app_hop . aau_high FROM app_hop WHERE app_hop . id = ?$$
SELECT app_brew . id , app_brew . brew_date , app_brew . brewer_id , app_brew . notes , app_brew . recipe_id , app_brew . last_update_date , app_brew . last_state , app_brew . is_done FROM app_brew WHERE app_brew . id = ? ORDER BY app_brew . brew_date ASC , app_brew . last_update_date ASC$$
SELECT app_userprofile . id , app_userprofile . user_id , app_userprofile . pref_brew_type , app_userprofile . pref_make_starter , app_userprofile . pref_secondary_ferm , app_userprofile . pref_dispensing_style , app_userprofile . timezone FROM app_userprofile INNER JOIN auth_user ON ( app_userprofile . user_id = auth_user . id ) WHERE auth_user . username = ?$$
DROP DATABASE test_brew_journal$$
UPDATE rule_alarms SET schedule_id = ? , severe_result_id = ? , fixed_time = NULL , email_targets = NULL , notes = NULL , fixed_by_user_id = NULL WHERE alarm_id = ?$$
INSERT INTO loghistogram_data ( base , nul , bin_0 , bin_1 , bin_2 , bin_3 , bin_4 , bin_5 , bin_6 , bin_7 , bin_8 , bin_9 , bin_10 , bin_11 , bin_12 , bin_13 , bin_14 , bin_15 , bin_16 , bin_17 , bin_18 , bin_19 , bin_20 , bin_21 , bin_22 , bin_23 , bin_24 , bin_25 , bin_26 , bin_27 , bin_28 , bin_29 , bin_30 , bin_31 , bin_32 , bin_33 , bin_34 , bin_35 , bin_36 , bin_37 , bin_38 , bin_39 , bin_40 , bin_41 , bin_42 , bin_43 , bin_44 , bin_45 , bin_46 , bin_47 , bin_48 , bin_49 , bin_50 , bin_51 , bin_52 , bin_53 , bin_54 , bin_55 , bin_56 , bin_57 , bin_58 , bin_59 , bin_60 , bin_61 , bin_62 , instance_id , TIMESTAMP ) VALUES ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )$$
SELECT hibemailta0_ . target_id AS target1_25_ , hibemailta0_ . customSubject AS customSu2_25_ , hibemailta0_ . memAdmin AS memAdmin25_ , hibemailta0_ . name AS name25_ , hibemailta0_ . recipients AS recipients25_ , hibemailta0_ . smsFormat AS smsFormat25_ FROM target_email hibemailta0_ WHERE ? IN ( SELECT schedules1_ . rule_schedule_id FROM rule_schedule_email_targets schedules1_ WHERE hibemailta0_ . target_id = schedules1_ . target_id )$$
INSERT INTO statement_examples ( bytes , comment , connection_id , data_base , errors , exec_time , explain_plan , host_from , host_to , no_good_index_used , no_index_used , query_type , `rows` , source_location , TEXT , user , warnings , instance_id , TIMESTAMP ) VALUES ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ) ON duplicate KEY UPDATE bytes = IFNULL( VALUES( bytes ) , bytes ) /* , ... */ ,comment = IFNULL( VALUES( comment ) , comment ) /* , ... */ , connection_id = IFNULL( VALUES( connection_id ) , connection_id ) /* , ... */ , data_base = IFNULL( VALUES( data_base ) , data_base ) /* , ... */ , errors = IFNULL( VALUES( errors ) , errors ) /* , ... */ , exec_time = IFNULL( VALUES( exec_time ) , exec_time ) /* , ... */ , explain_plan = IFNULL( VALUES( explain_plan ) , explain_plan ) /* , ... */ , host_from = IFNULL( VALUES( host_from ) , host_from ) /* , ... */ , host_to = IFNULL( VALUES( host_to ) , host_to ) /* , ... */ , no_good_index_used = IFNULL( VALUES( no_good_index_used ) , no_good_index_used ) /* , ... */ , no_index_used = IFNULL( VALUES( no_index_used ) , no_index_used ) /* , ... */ , query_type = IFNULL( VALUES( query_type ) , query_type ) /* , ... */ , `rows` = IFNULL( VALUES( `rows` ) , `rows` ) /* , ... */ , source_location = IFNULL( VALUES( source_location ) , source_location ) /* , ... */ , TEXT = IFNULL( VALUES( TEXT ) , TEXT ) /* , ... */ , user = IFNULL( VALUES( user ) , user ) /* , ... */ , warnings = IFNULL( VALUES( warnings ) , warnings )$$
SHOW ENGINE INNODB STATUS$$
UPDATE rule_schedules SET alarm_id = ? , autoCloseEnabled = ? , autoCloseNote = ? , enabled = ? , frequency = ? , instance_id = ? , rule_id = ? , snmpEnabled = ? WHERE schedule_id = ?$$
SELECT next_value FROM hilo_sequence_rule_alarms FOR UPDATE$$
SELECT rulevariab_ . instance_attribute_id , rulevariab_ . rule_schedule_id , rulevariab_ . variable_id FROM rule_dc_schedules rulevariab_ WHERE rulevariab_ . instance_attribute_id = ? AND rulevariab_ . rule_schedule_id = ? AND rulevariab_ . variable_id = ?$$
UPDATE rule_alarms SET schedule_id = ? , severe_result_id = ? , fixed_time = ? , email_targets = NULL , notes = ? , fixed_by_user_id = ? WHERE alarm_id = ?$$
UPDATE hilo_sequence_rule_alarms SET next_value = ? WHERE next_value = ?$$
SHOW CREATE DATABASE foo$$
SHOW CREATE EVENT foo$$
SHOW CREATE FUNCTION foo_bar$$
SHOW CREATE PROCEDURE bar$$
SHOW CREATE TRIGGER a$$
SHOW CREATE VIEW viewey$$
SELECT statementt0_ . type_id as type1_3_ , statementt0_ . type_name AS type2_3_ , statementt0_ . namespace_id AS namespace3_3_ , statementt0_ . insert_count AS insert4_3_ FROM inventory_types statementt0_ , inventory_namespaces hibnamespa1_ WHERE ( SELECT CONCAT( inv_ns . namespace , ? , `t` . type_name ) FROM inventory_namespaces inv_ns JOIN inventory_types `t` ON ( inv_ns . namespace_id = `t` . namespace_id ) WHERE `t` . type_id = statementt0_ . type_id ) = ? AND statementt0_ . namespace_id = hibnamespa1_ . namespace_id AND hibnamespa1_ . namespace = ? AND statementt0_ . type_name = ?$$
select statementt0_.type_id as type1_3_, statementt0_.type_name as type2_3_, statementt0_.namespace_id as namespace3_3_, statementt0_.insert_count as insert4_3_ from inventory_types statementt0_, inventory_namespaces hibnamespa1_ where (select concat(inv_ns.namespace, '.', t.type_name) from inventory_namespaces inv_ns join inventory_types t on (inv_ns.namespace_id=t.namespace_id) where t.type_id=statementt0_.type_id) ='mysql.Statement' and statementt0_.namespace_id=hibnamespa1_.namespace_id and hibnamespa1_.namespace='mysql' and statementt0_.type_name='Statement'$$
SELECT 1 FROM dual where 1 = 2$$
[<80017]select * from (select 1 from dual) = one$$
DELETE FROM TABLE1 LIMIT 1$$
SELECT * FROM a_a_ AS b_b_, a_a_ AS c_c_ limit 5$$
SELECT  hibinvento0_.instance_id as instance1_5_2_, hibinvento0_.instance_name as instance2_5_2_, hibinvento0_.type_id as type3_5_2_, hibinvento0_.parent_id as parent4_5_2_, hibinvento0_.insert_count as insert5_5_2_, hibtype1_.type_id as type1_3_0_, hibtype1_.type_name as type2_3_0_, hibtype1_.namespace_id as namespace3_3_0_, hibtype1_.insert_count as insert4_3_0_, hibnamespa2_.namespace_id as namespace1_2_1_, hibnamespa2_.namespace as namespace2_1_  from inventory_instances hibinvento0_ inner join inventory_types hibtype1_ on hibinvento0_.type_id=hibtype1_.type_id left outer join inventory_namespaces hibnamespa2_ on hibtype1_.namespace_id=hibnamespa2_.namespace_id where hibinvento0_.instance_id=1835721$$
DELETE FROM FUS_DB_STATE WHERE LAST_CHECK < DATE_SUB(NOW(),INTERVAL 8 HOUR)$$
SELECT se . * , el . login FROM empdata . support_employees se JOIN empdata . employee_login el ON ( el . person_id = se . person_id ) WHERE el . login = ?$$
SELECT * FROM merlintest . agentlist WHERE id NOT IN ( SELECT SUBSTR( `o` . value , ? , ? ) AS agentID FROM mem . dc_ng_string_now AS `o` JOIN mem . inventory_instance_attributes AS iia USING ( instance_attribute_id ) JOIN mem . inventory_instances USING ( instance_id ) JOIN ( SELECT inventory_attributes . attribute_id , attribute_name , instance_attribute_id , MAX( end_time ) AS _end_time FROM mem . dc_ng_string_now JOIN mem . inventory_instance_attributes USING ( instance_attribute_id ) JOIN mem . inventory_instances USING ( instance_id ) JOIN mem . inventory_attributes USING ( attribute_id ) WHERE attribute_name = ? GROUP BY instance_attribute_id ) AS `i` ON `o` . instance_attribute_id = `i` . instance_attribute_id AND `o` . end_time = `i` . _end_time ) ORDER BY id$$
SELECT QRY_SID_QQ.QuestionID AS QuestionID,QRY_SID_QQ.QuestionTypeID AS QuestionTypeID,QRY_SID_QQ.`Options` AS "Options",QRY_SID_QQ.Points AS Points,Now() AS "Date", QRY_SID_QQ.`Unknown` AS "Unknown", QRY_SID_QQ.UnitID AS UnitID, QRY_SID_QQ.Threshold AS Threshold, QRY_SID_QQ.OtherUnit AS OtherUnit FROM  QRY_A0154_QuizQuestions QRY_SID_QQ  LEFT JOIN QRY_A0154_RecordQns QRY_SID_RQ  ON ( QRY_SID_QQ.QuizID=QRY_SID_RQ.QuizID AND QRY_SID_QQ.QuestionID=QRY_SID_RQ.QuestionID AND  QRY_SID_RQ.AttemptID='0' AND  QRY_SID_RQ.UserID='319459' ) WHERE  QRY_SID_QQ.QuizID='c29f8c6a94a2488eb93750d631b96ebb' AND QRY_SID_RQ.QuestionID IS NULL ORDER BY  RAND() LIMIT 1$$
SELECT ftable.id AS ftable_id, ftable.tid AS ftable_tid, ftable.fid AS ftable_fid, ftable.tablename AS ftable_tablename, ftable.ref AS ftable_ref FROM ftable INNER JOIN ttable ON ttable.id = ftable.tid WHERE ttable.state = 'TEST' AND ftable.fid = 'TEST' AND (ftable.tablename = 'testa' AND ftable.ref = 981675 OR ftable.tablename = 'testa' AND ftable.ref = 981663 OR ftable.tablename = 'testa' AND ftable.ref = 981668 OR ftable.tablename = 'testa' AND ftable.ref = 981694 OR ftable.tablename = 'testa' AND ftable.ref = 981699 OR ftable.tablename = 'testa' AND ftable.ref = 981687 OR ftable.tablename = 'testa' AND ftable.ref = 981659 OR ftable.tablename = 'testa' AND ftable.ref = 981664 OR ftable.tablename = 'testa' AND ftable.ref = 981690 OR ftable.tablename = 'testa' AND ftable.ref = 981652 OR ftable.tablename = 'testa' AND ftable.ref = 981683 OR ftable.tablename = 'testa' AND ftable.ref = 981676 OR ftable.tablename = 'testa' AND ftable.ref = 981669 OR ftable.tablename = 'testa' AND ftable.ref = 981695 OR ftable.tablename = 'testa' AND ftable.ref = 981672 OR ftable.tablename = 'testa' AND ftable.ref = 981660 OR ftable.tablename = 'testa' AND ftable.ref = 981665 OR ftable.tablename = 'testa' AND ftable.ref = 981691 OR ftable.tablename = 'testa' AND ftable.ref = 981696 OR ftable.tablename = 'testa' AND ftable.ref = 981653 OR ftable.tablename = 'testa' AND ftable.ref = 981684 OR ftable.tablename = 'testa' AND ftable.ref = 981656 OR ftable.tablename = 'testa' AND ftable.ref = 981677 OR ftable.tablename = 'testa' AND ftable.ref = 981670 OR ftable.tablename = 'testa' AND ftable.ref = 981680 OR ftable.tablename = 'testa' AND ftable.ref = 981673 OR ftable.tablename = 'testa' AND ftable.ref = 981661 OR ftable.tablename = 'testa' AND ftable.ref = 981666 OR ftable.tablename = 'testa' AND ftable.ref = 981692 OR ftable.tablename = 'testa' AND ftable.ref = 981697 OR ftable.tablename = 'testa' AND ftable.ref = 981654 OR ftable.tablename = 'testa' AND ftable.ref = 981685 OR ftable.tablename = 'testa' AND ftable.ref = 981657 OR ftable.tablename = 'testa' AND ftable.ref = 981678 OR ftable.tablename = 'testa' AND ftable.ref = 981688 OR ftable.tablename = 'testa' AND ftable.ref = 981650 OR ftable.tablename = 'testa' AND ftable.ref = 981671 OR ftable.tablename = 'testa' AND ftable.ref = 981681 OR ftable.tablename = 'testa' AND ftable.ref = 981674 OR ftable.tablename = 'testa' AND ftable.ref = 981662 OR ftable.tablename = 'testa' AND ftable.ref = 981667 OR ftable.tablename = 'testa' AND ftable.ref = 981693 OR ftable.tablename = 'testa' AND ftable.ref = 981698 OR ftable.tablename = 'testa' AND ftable.ref = 981655 OR ftable.tablename = 'testa' AND ftable.ref = 981686 OR ftable.tablename = 'testa' AND ftable.ref = 981658 OR ftable.tablename = 'testa' AND ftable.ref = 981679 OR ftable.tablename = 'testa' AND ftable.ref = 981689 OR ftable.tablename = 'testa' AND ftable.ref = 981651 OR ftable.tablename = 'testa' AND ftable.ref = 981682) ORDER BY ttable.datetime DESC$$
select title as "Betreff", FROM_UNIXTIME((startDate - 2440587.5) * 60 * 60 * 24, '%d.%m.%Y') as "Beginnt am", startTime as "Beginnt um", FROM_UNIXTIME((endDate - 2440587.5) * 60 * 60 * 24, '%d.%m.%Y') as "Endet am", endTime as "Endet um", "Aus" as "Ganztägiges Ereignis", descr as "Beschreibung", "" as "Ort" from `usr_web5_3`.`epc_calendar` order by startDate$$
select _utf8 0xc386C3a4; $$
select _ucs2 0x30da;$$
SELECT _big5'test'$$
SELECT _latin2'test' COLLATE latin2_czech_ci$$
SELECT _ujis'test'$$
SELECT _sjis'test'$$
SELECT _tis620'test'$$
SELECT _euckr'test'$$
SELECT _gb2312'test'$$
SELECT _cp1250'test' COLLATE cp1250_czech_ci$$
SELECT _gbk'test'$$
SELECT _utf8'test'$$
SELECT _ucs2 0xAABB$$
SELECT _binary 'test'$$
CREATE PROCEDURE do_insert(value INT)
BEGIN
  DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
    BEGIN
    END;
  SELECT result;
END$$
CREATE PROCEDURE do_insert(value INT)
BEGIN
  -- declare variables to hold diagnostics area information
  DECLARE code CHAR(5) DEFAULT '00000';
  DECLARE msg TEXT;
  DECLARE rowCount INT;
  DECLARE result TEXT;
  -- declare exception handler for failed insert
  DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
    BEGIN
      GET DIAGNOSTICS CONDITION 1
        code = RETURNED_SQLSTATE, msg = MESSAGE_TEXT;
    END;

  -- perform the insert
  INSERT INTO t1 (int_col) VALUES(value);
  -- check whether the insert was successful
  IF code = '00000' THEN
    GET DIAGNOSTICS rowCount = ROW_COUNT;
    SET result = CONCAT('insert succeeded, row count = ',rowCount);
  ELSE
    SET result = CONCAT('insert failed, error = ',code,', message = ',msg);
  END IF;
  -- say what happened
  SELECT result;
END$$
select (select t1.id as a, sakila.actor.actor_id b, t2.id c, (select  1 * 0.123, a from t3) from  `ÄÖÜ丈` t1, sakila.actor as t2)$$
SELECT 
	currency_code,
	SUM(CASE WHEN TYPE = 'buy'THEN to_amount END ) AS BUY, 
	SUM(CASE WHEN TYPE = 'sell' THEN to_amount END ) AS SELL, 
	SUM(CASE WHEN TYPE = 'sell' THEN rate END ) AS SELL_RATE, 
	SUM(CASE WHEN TYPE = 'buy' THEN rate END ) AS BUY_RATE, 
	AVG(CASE WHEN TYPE = 'buy' THEN rate END ) AS AVG_BUY_RATE, 
	AVG(CASE WHEN TYPE = 'sell' THEN rate END ) AS AVG_SELL_RATE
FROM tb_currency
LEFT JOIN tb_bill 
	ON tb_currency.CURRENCY_ID = tb_bill.CURRENCY_ID
		AND tb_bill.TYPE IN ('buy', 'sell')
		AND date( DATE_TIME ) >= '2011-01-01'
		AND date( DATE_TIME ) <= '2011-01-11'
GROUP BY currency_code$$

select 
    r.referrer,
    t.type,
    (case
        when
            isnull(ref_prior.referrals, 0) < @max1
        then
            (case
                when isnull(ref_prior.referrals, 0) + isnull(ref_period.referrals, 0) < @max1 then isnull(ref_period.referrals, 0)
                else @max1 - isnull(ref_prior.referrals, 0)
            end)
        else 0
    end) * (case t.type
        when 'A' then r.Comm_A1
        when 'B' then r.Comm_B1
        else null
    end) + (case
        when
            isnull(ref_prior.referrals, 0) + isnull(ref_period.referrals, 0) > @max1
        then
            (case
                when
                    isnull(ref_prior.referrals, 0) < @max2
                then
                    (case
                        when isnull(ref_prior.referrals, 0) + isnull(ref_period.referrals, 0) < @max2 then isnull(ref_period.referrals, 0)
                        else @max2 - isnull(ref_prior.referrals, 0)
                    end)
                else 0
            end) - (case
                when
                    isnull(ref_prior.referrals, 0) < @max1
                then
                    (case
                        when isnull(ref_prior.referrals, 0) + isnull(ref_period.referrals, 0) < @max1 then isnull(ref_period.referrals, 0)
                        else @max1 - isnull(ref_prior.referrals, 0)
                    end)
                else 0
            end)
        else 0
    end) * (case t.type
        when 'A' then r.Comm_A2
        when 'B' then r.Comm_B2
        else null
    end) + (case
        when
            isnull(ref_prior.referrals, 0) + isnull(ref_period.referrals, 0) > @max2
        then
            (isnull(ref_period.referrals, 0)) - ((case
                when
                    isnull(ref_prior.referrals, 0) + isnull(ref_period.referrals, 0) > @max1
                then
                    (case
                        when
                            isnull(ref_prior.referrals, 0) < @max2
                        then
                            (case
                                when isnull(ref_prior.referrals, 0) + isnull(ref_period.referrals, 0) < @max2 then isnull(ref_period.referrals, 0)
                                else @max2 - isnull(ref_prior.referrals, 0)
                            end)
                        else 0
                    end) - (case
                        when
                            isnull(ref_prior.referrals, 0) < @max1
                        then
                            (case
                                when isnull(ref_prior.referrals, 0) + isnull(ref_period.referrals, 0) < @max1 then isnull(ref_period.referrals, 0)
                                else @max1 - isnull(ref_prior.referrals, 0)
                            end)
                        else 0
                    end)
                else 0
            end) + (case
                when
                    isnull(ref_prior.referrals, 0) < @max1
                then
                    (case
                        when isnull(ref_prior.referrals, 0) + isnull(ref_period.referrals, 0) < @max1 then isnull(ref_period.referrals, 0)
                        else @max1 - isnull(ref_prior.referrals, 0)
                    end)
                else 0
            end))
        else 0
    end) * (case t.type
        when 'A' then r.Comm_A3
        when 'B' then r.Comm_B3
        else null
    end) as Total_Commission
from
    referrer r
        join
    type t ON 1 = 1
        left join
    (select 
        referrer, type, count(1) as referrals
    from
        referral
    where
        date < @start_date
    group by referrer , type) ref_prior ON ref_prior.referrer = r.referrer
        and ref_prior.type = t.type
        left join
    (select 
        referrer, type, count(1) as referrals
    from
        referral
    where
        date between @start_date and @end_date
    group by referrer , type) ref_period ON ref_period.referrer = r.referrer
        and ref_period.type = t.type$$

SELECT 
  item,
  SUBSTR( MIN( CONCAT( LPAD(price,6,0),supplier) ), 7)   AS MinSupplier,
    LEFT( MIN( CONCAT( LPAD(price,6,0),supplier) ), 6)+0 AS MinPrice,
  SUBSTR( MAX( CONCAT( LPAD(price,6,0),supplier) ), 7)   AS MaxSupplier,
    LEFT( MAX( CONCAT( LPAD(price,6,0),supplier) ), 6)+0 AS MaxPrice
FROM  products
GROUP BY item$$
CREATE PROCEDURE ListDbUsers( dbname CHAR(64) )
  SELECT host,user
  FROM mysql.user
  WHERE Select_priv = 'Y' OR Insert_priv = 'Y' OR Update_priv = 'Y' OR Delete_priv = 'Y' OR Create_priv = 'Y' OR Drop_priv = 'Y'
	OR Reload_priv = 'Y' OR Shutdown_priv = 'Y' OR Process_priv = 'Y' OR File_priv = 'Y' OR Grant_priv = 'Y' OR References_priv = 'Y' 
	OR Index_priv = 'Y' OR Alter_priv = 'Y' OR Show_db_priv = 'Y' OR Super_priv = 'Y' OR Create_tmp_table_priv = 'Y' OR Lock_tables_priv = 'Y' 
	OR Execute_priv = 'Y' OR Repl_slave_priv = 'Y' OR Repl_client_priv = 'Y' OR Create_view_priv = 'Y' OR Show_view_priv = 'Y'
	OR Create_routine_priv = 'Y' OR Alter_routine_priv = 'Y' OR Create_user_priv = 'Y' OR Event_priv = 'Y' OR Trigger_priv = 'Y' 
  UNION
  SELECT host,user
  FROM mysql.db
  WHERE db=dbname
    AND (
     Select_priv = 'Y' OR Insert_priv = 'Y' OR Update_priv = 'Y' OR Delete_priv = 'Y' OR Create_priv = 'Y' OR Drop_priv = 'Y' OR Grant_priv = 'Y' 
     OR References_priv = 'Y' OR Index_priv = 'Y' OR Alter_priv = 'Y' OR Create_tmp_table_priv = 'Y' OR Lock_tables_priv = 'Y' OR Create_view_priv = 'Y' 
     OR Show_view_priv = 'Y' OR Create_routine_priv = 'Y' OR Alter_routine_priv = 'Y' OR Execute_priv = 'Y' OR Event_priv = 'Y' OR Trigger_priv = 'Y' 
  )
  UNION
  SELECT host,user
  FROM mysql.tables_priv
  WHERE db=dbname
  UNION
  SELECT host,user
  FROM mysql.columns_priv
  WHERE db=dbname$$
SELECT GROUP_CONCAT('\\\\\n* ', t.table_schema, '.', t.table_name, ' (', ROUND(t.pct_used, 1) , '%)' ORDER BY pct_used DESC) AS table_list 
  FROM ( SELECT t.table_schema, t.table_name, 
                100 * (t.auto_increment / (
                CASE 
                  WHEN ((LOCATE('tinyint',   c.column_type) > 0) AND (LOCATE('unsigned', c.column_type) = 0)) THEN 127 
                  WHEN ((LOCATE('tinyint',   c.column_type) > 0) AND (LOCATE('unsigned', c.column_type) > 0)) THEN 255 
                  WHEN ((LOCATE('smallint',  c.column_type) > 0) AND (LOCATE('unsigned', c.column_type) = 0)) THEN 32767 
                  WHEN ((LOCATE('smallint',  c.column_type) > 0) AND (LOCATE('unsigned', c.column_type) > 0)) THEN 65535 
                  WHEN ((LOCATE('mediumint', c.column_type) > 0) AND (LOCATE('unsigned', c.column_type) = 0)) THEN 8388607 
                  WHEN ((LOCATE('mediumint', c.column_type) > 0) AND (LOCATE('unsigned', c.column_type) > 0)) THEN 16777215 
                  WHEN ((LOCATE('bigint',    c.column_type) > 0) AND (LOCATE('unsigned', c.column_type) = 0)) THEN 9223372036854775807 
                  WHEN ((LOCATE('bigint',    c.column_type) > 0) AND (LOCATE('unsigned', c.column_type) > 0)) THEN 18446744073709551615 
                  WHEN ((LOCATE('int',       c.column_type) > 0) AND (LOCATE('unsigned', c.column_type) = 0)) THEN 2147483647 
                  WHEN ((LOCATE('int',       c.column_type) > 0) AND (LOCATE('unsigned', c.column_type) > 0)) THEN 4294967295 
                  ELSE 0 
                END)) AS pct_used 
           FROM information_schema.tables t, information_schema.columns c 
          WHERE t.table_schema = c.table_schema 
            AND t.table_name = c.table_name 
            AND LOCATE('auto_increment', c.extra) > 0
       ) AS t 
 WHERE t.pct_used > 75$$
SELECT * FROM merlintest . agentlist WHERE id NOT IN ( SELECT SUBSTR( `o` . value , ? , ? ) AS agentID FROM mem . dc_ng_string_now AS `o` JOIN mem . inventory_instance_attributes AS iia USING ( instance_attribute_id ) JOIN mem . inventory_instances USING ( instance_id ) JOIN ( SELECT inventory_attributes . attribute_id , attribute_name , instance_attribute_id , MAX( end_time ) AS _end_time FROM mem . dc_ng_string_now JOIN mem . inventory_instance_attributes USING ( instance_attribute_id ) JOIN mem . inventory_instances USING ( instance_id ) JOIN mem . inventory_attributes USING ( attribute_id ) WHERE attribute_name = ? GROUP BY instance_attribute_id ) AS `i` ON `o` . instance_attribute_id = `i` . instance_attribute_id AND `o` . end_time = `i` . _end_time ) ORDER BY id$$
DELETE FROM FUS_DB_STATE WHERE LAST_CHECK < DATE_SUB(NOW(),INTERVAL 8 HOUR)$$
SELECT id , label FROM test WHERE label > 1$$
(SELECT COUNT( * ) `c` FROM meetings LEFT JOIN users jt1 ON jt1 . id = meetings . assigned_user_id AND jt1 . deleted = ? AND jt1 . deleted = ? INNER JOIN meetings_contacts ON ( meetings . id = meetings_contacts . meeting_id AND meetings_contacts . contact_id = ? ) WHERE ( meetings_contacts . deleted = ? AND meetings . deleted = ? AND ( meetings . status = ? ) ) AND meetings . deleted = ? ) UNION ALL ( SELECT COUNT( * ) `c` FROM tasks LEFT JOIN contacts contacts ON contacts . id = tasks . contact_id AND contacts . deleted = ? AND contacts . deleted = ? LEFT JOIN users jt1 ON jt1 . id = tasks . assigned_user_id AND jt1 . deleted = ? AND jt1 . deleted = ? WHERE ( tasks . contact_id = ? AND tasks . deleted = ? AND ( tasks . status = ? OR tasks . status = ? OR tasks . status = ? ) ) AND tasks . deleted = ? ) UNION ALL ( SELECT COUNT( * ) `c` FROM calls LEFT JOIN users jt1 ON jt1 . id = calls . assigned_user_id AND jt1 . deleted = ? AND jt1 . deleted = ? INNER JOIN calls_contacts ON ( calls . id = calls_contacts . call_id AND calls_contacts . contact_id = ? ) WHERE ( calls_contacts . deleted = ? AND calls . deleted = ? AND ( calls . status = ? ) ) AND calls . deleted = ?)$$
SELECT GROUP_CONCAT( ? , ? , `d` . user , ? , `d` . host , ? , `d` . db ORDER BY `d` . user , `d` . host , `d` . db ) AS user , GROUP_CONCAT( ? , `d` . db ORDER BY `d` . db ) AS db_name FROM mysql . db `d` LEFT JOIN information_schema . schemata `s` ON `d` . db = `s` . schema_name WHERE `s` . schema_name IS NULL ORDER BY `d` . user , `d` . db$$
SELECT a,b,a+b INTO OUTFILE '/tmp/result.txt'
   FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
   LINES TERMINATED BY '\n'
   FROM test_table$$
SELECT left_tbl.*
   FROM left_tbl LEFT JOIN right_tbl ON left_tbl.id = right_tbl.id
   WHERE right_tbl.id IS NULL$$
SELECT left_tbl.*
       FROM { OJ left_tbl LEFT OUTER JOIN right_tbl ON left_tbl.id = right_tbl.id }
       WHERE right_tbl.id IS NULL$$
SELECT * FROM (t1, t2) JOIN t3 ON (t1.i1 = t3.i3)$$
SELECT * FROM t1 JOIN t2 JOIN t3 ON (t1.i1 = t3.i3)$$
SELECT * FROM t1 NATURAL JOIN t2 WHERE b > 1$$
SELECT
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
1
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))$$
prepare stmt from
'
SELECT
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
1
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
'$$
CREATE PROCEDURE proc_overflow()
BEGIN

  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN

  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN

  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN

  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN

  select 1;
  select 2;
  select 3;

  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;

  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;

END $$
create function func_overflow() returns int
BEGIN
  DECLARE x int default 0;

  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN

  SET x=x+1;
  SET x=x+2;
  SET x=x+3;

  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;

  return x;
END $$
create trigger trigger_overflow before insert on table_overflow
for each row
BEGIN

  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
  BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN

  SET NEW.b := NEW.a;
  SET NEW.b := NEW.b + 1;
  SET NEW.b := NEW.b + 2;
  SET NEW.b := NEW.b + 3;

  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;
  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;  END;

END $$
CREATE PROCEDURE proc_35577()
BEGIN
  DECLARE z_done INT DEFAULT 0;
  DECLARE t_done VARCHAR(5000);
  outer_loop: LOOP
    IF t_done=1  THEN
      LEAVE outer_loop;
    END IF;

    inner_block:BEGIN
      DECLARE z_done INT DEFAULT  0;
      SET z_done = 0;
      inner_loop: LOOP
        IF z_done=1  THEN
          LEAVE inner_loop;
        END IF;
        IF (t_done = 'a') THEN
          IF (t_done <> 0) THEN
            IF ( t_done > 0) THEN
              IF (t_done = 'a') THEN
                SET t_done = 'a';
              ELSEIF (t_done = 'a') THEN
                SET t_done = 'a';
              ELSEIF(t_done = 'a') THEN
                SET t_done = 'a';
              ELSEIF(t_done = 'a') THEN
                SET t_done = 'a';
              ELSEIF(t_done = 'a') THEN
                SET t_done = 'a';
              ELSEIF(t_done = 'a') THEN
                SET t_done = 'a';
              ELSEIF(t_done = 'a') THEN
                SET t_done = 'a';
              ELSEIF(t_done = 'a') THEN
                SET t_done = 'a';
              END IF;
            END IF;
          END IF;
        END IF;
      END LOOP inner_loop;
    END inner_block;
  END LOOP outer_loop;
END $$
create procedure p_37269()
begin
  declare done int default 0;
  declare varb int default 0;
  declare vara int default 0;

  repeat
    select now();
  until done end repeat;
  while varb do
    select now();
    begin
      select now();
      repeat
        select now();
      until done end repeat;
      if vara then 
        select now();
        repeat
          select now();
          loop
            select now();
          end loop;
          repeat
            select now();
            label1: while varb do
              select now();
            end while label1;
            if vara then 
              select now();
              repeat
                select now();
              until done end repeat;
              begin
                select now();
                while varb do
                  select now();
                  label1: while varb do
                    select now();
                  end while label1;
                  if vara then 
                    select now();
                    while varb do
                      select now();
                      loop
                        select now();
                      end loop;
                      repeat
                        select now();
                        loop
                          select now();
                          while varb do
                            select now();
                          end while;
                          repeat
                            select now();
                            label1: loop
                              select now();
                              if vara then 
                                select now();
                              end if;
                            end loop label1;
                          until done end repeat;
                        end loop;
                      until done end repeat;
                    end while;
                  end if;
                end while;
              end;
            end if;
          until done end repeat;
        until done end repeat;
      end if;
    end;
  end while;
end $$
create procedure p_37228 ()
BEGIN
  DECLARE v INT DEFAULT 123;

  IF (v > 1) THEN SET v = 1; 
  ELSEIF (v < 10) THEN SET v = 10;
  ELSEIF (v < 11) THEN SET v = 11;
  ELSEIF (v < 12) THEN SET v = 12;
  ELSEIF (v < 13) THEN SET v = 13;
  ELSEIF (v < 14) THEN SET v = 14;
  ELSEIF (v < 15) THEN SET v = 15;
  ELSEIF (v < 16) THEN SET v = 16;
  ELSEIF (v < 17) THEN SET v = 17;
  ELSEIF (v < 18) THEN SET v = 18;
  ELSEIF (v < 19) THEN SET v = 19;
  ELSEIF (v < 20) THEN SET v = 20;
  ELSEIF (v < 21) THEN SET v = 21;
  ELSEIF (v < 22) THEN SET v = 22;
  ELSEIF (v < 23) THEN SET v = 23;
  ELSEIF (v < 24) THEN SET v = 24;
  ELSEIF (v < 25) THEN SET v = 25;
  ELSEIF (v < 26) THEN SET v = 26;
  ELSEIF (v < 27) THEN SET v = 27;
  ELSEIF (v < 28) THEN SET v = 28;
  ELSEIF (v < 29) THEN SET v = 29;
  ELSEIF (v < 30) THEN SET v = 30;
  ELSEIF (v < 31) THEN SET v = 31;
  ELSEIF (v < 32) THEN SET v = 32;
  ELSEIF (v < 33) THEN SET v = 33;
  ELSEIF (v < 34) THEN SET v = 34;
  ELSEIF (v < 35) THEN SET v = 35;
  ELSEIF (v < 36) THEN SET v = 36;
  ELSEIF (v < 37) THEN SET v = 37;
  ELSEIF (v < 38) THEN SET v = 38;
  ELSEIF (v < 39) THEN SET v = 39;
  END IF;
END $$
SET sort_buffer_size=10000$$
SET @@local.sort_buffer_size=10000$$
SET GLOBAL sort_buffer_size=1000000, SESSION sort_buffer_size=1000000$$
SET @@sort_buffer_size=1000000$$
SET @@global.sort_buffer_size=1000000, @@local.sort_buffer_size=1000000$$
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE$$
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE$$
SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND$$
SELECT 1 + INTERVAL(1,0,1,2) + 1$$
SELECT INTERVAL(1^1,0,1,2) + 1$$
SELECT INTERVAL(1,0+1,2,3) * 5.5$$
SELECT INTERVAL(3,3,1+3,4+4) / 0.5$$
SELECT (INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2$$
SELECT INTERVAL(1,0,1,2) + 1, 5 * INTERVAL(1,0,1,2)$$
SELECT INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3)$$
SELECT 1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND$$
SELECT 1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND$$
CREATE TABLE t1 (a1 INT, a2 INT, a3 INT, a4 DATETIME)$$
CREATE TABLE t2 LIKE t1$$
CREATE TABLE t3 LIKE t1$$
SELECT t1.* FROM t1 AS t0, { OJ t2 INNER JOIN t1 ON (t1.a1=t2.a1) } WHERE t0.a3=2$$
SELECT t1.*,t2.* FROM { OJ ((t1 INNER JOIN t2 ON (t1.a1=t2.a2)) LEFT OUTER JOIN t3 ON t3.a3=t2.a1)}$$
SELECT t1.*,t2.* FROM { OJ ((t1 LEFT OUTER JOIN t2 ON t1.a3=t2.a2) INNER JOIN t3 ON (t3.a1=t2.a2))}$$
SELECT t1.*,t2.* FROM { OJ (t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a2) CROSS JOIN t3 ON (t3.a2=t2.a3)}$$
SELECT * FROM {oj t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a3} WHERE t1.a2 > 10$$
SELECT {fn CONCAT(a1,a2)} FROM t1$$
UPDATE t3 SET a4={d '1789-07-14'} WHERE a1=0$$
SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')}$$
DROP TABLE t1, t2, t3$$
select "non terminated"$$
select "terminated";$$
select "non terminated, space"      $$
select "terminated, space";      $$
select "non terminated, comment" /* comment */$$
select "terminated, comment"; /* comment */$$
select b'01010', x'AF', X'af', B'01010'$$
(select 1) union all (select 2) union distinct (select 3)$$
SELECT file_id , archive_path FROM archive WHERE file_date < DATE_SUB( NOW( ) , INTERVAL ? DAY )$$
SELECT * FROM merlintest . agentlist WHERE id NOT IN ( SELECT 1 from b) and NOT 0 and not id IN (1,2,3) ORDER BY id$$
SELECT QRY_SID_QQ.QuestionID AS QuestionID,QRY_SID_QQ.QuestionTypeID AS QuestionTypeID,QRY_SID_QQ.Options AS Options,QRY_SID_QQ.Points AS Points,Now() AS Date,
QRY_SID_QQ.Unknown AS Unknown,
QRY_SID_QQ.UnitID AS UnitID,
QRY_SID_QQ.Threshold AS Threshold,
QRY_SID_QQ.OtherUnit AS OtherUnit
FROM 
QRY_A0154_QuizQuestions QRY_SID_QQ 
LEFT JOIN
QRY_A0154_RecordQns QRY_SID_RQ 
ON (
QRY_SID_QQ.QuizID=QRY_SID_RQ.QuizID AND
QRY_SID_QQ.QuestionID=QRY_SID_RQ.QuestionID AND 
QRY_SID_RQ.AttemptID='0' AND 
QRY_SID_RQ.UserID='319459'
)
WHERE 
QRY_SID_QQ.QuizID='c29f8c6a94a2488eb93750d631b96ebb' AND
QRY_SID_RQ.QuestionID IS NULL
ORDER BY 
RAND()
LIMIT 1$$
(select a from t1) union (select a from t2) union select b from t2$$
( ( SELECT COUNT( * ) `c` FROM accounts INNER JOIN emails_beans ON (
accounts . id = emails_beans . bean_id AND emails_beans . email_id = ?
AND emails_beans . bean_module = ? ) WHERE ( emails_beans . deleted = ?
AND accounts . deleted = ? ) AND accounts . deleted = ? ) )$$
select 1 from dual union select 2 from dual$$
select 2 as expected, /*!01000/**/*/ 2 as result$$
select 1 as expected, /*! /**/*/ 1 as result$$
select 3 as expected, /*!01000 1 + */ 2 as result$$
select 2 as expected, /*!99990 1 + */ 2 as result$$
select 7 as expected, /*!01000 1 + /* 8 + */ 2 + */ 4 as result$$
select 8 as expected, /*!19998 1 + /* 2 + */ 4 + /* ddd */ */ 8 as result$$
select 4 as expected, /*!99998 1 + 2 + */ 4 as result$$
select 4 as expected, /*!99998 1 + 2 + */ 4 as result$$
select 4 /*! as */ b$$
select/**/5 /*   */from dual where 1=1$$
describe DELETE FROM somelog WHERE user = 'jcole' ORDER BY timestamp_column LIMIT 1$$
create aggregate function udf1 returns string soname 'udf.dll'$$
create function udf2 returns real soname 'udf.dll'$$
begin work$$
alter view emp as select * from employees$$
CREATE EVENT myevent
    ON SCHEDULE
      EVERY 6 HOUR
    COMMENT 'A sample comment.'
    DO
      UPDATE myschema.mytable SET mycol = mycol + 1$$
ALTER EVENT myevent
    ON SCHEDULE
      EVERY 12 HOUR
    STARTS CURRENT_TIMESTAMP + INTERVAL 4 HOUR$$
ALTER EVENT myevent DISABLE$$
SET @s = _latin1 'AB' COLLATE latin1_swedish_ci$$
SET @s = CAST('AB' AS BINARY)$$
SET @s = CONVERT(0xC39F USING utf8) COLLATE utf8_czech_ci$$
select locate('a', 'aa'), count(*)$$
SELECT ASCII('2')$$
SELECT BIN(12)$$
SELECT BIT_LENGTH('text')$$
SELECT CHAR(77,121,83,81,'76')$$
SELECT CHAR(77,77.3,'77.3')$$
SELECT HEX(CHAR(1,0)), HEX(CHAR(256))$$
SELECT HEX(CHAR(1,0,0)), HEX(CHAR(256*256))$$
SELECT CHARSET(CHAR(0x65)), CHARSET(CHAR(0x65 USING utf8))$$
select char_length('abcde')$$
select character_length('abcde')$$
SELECT CONCAT('My', 'S', 'QL')$$
SELECT CONCAT('My', NULL, 'QL')$$
SELECT CONCAT(14.3)$$
SELECT 'My' 'S' 'QL'$$
SELECT CONCAT_WS(',','First name','Second name','Last Name')$$
SELECT CONCAT_WS(',','First name',NULL,'Last Name')$$
SELECT ELT(1, 'ej', 'Heja', 'hej', 'foo')$$
SELECT EXPORT_SET(5,'Y','N',',',4)$$
SELECT EXPORT_SET(6,'1','0',',',10)$$
SELECT FIELD('ej', 'Hej', 'ej', 'Heja', 'hej', 'foo')$$
SELECT FIND_IN_SET('b','a,b,c,d')$$
SELECT FORMAT(12332.123456, 4)$$
SELECT FORMAT(12332.1,4)$$
SELECT FORMAT(12332.2,0)$$
SELECT FORMAT(12332.2,2,'de_DE')$$
SELECT TO_BASE64('abc'), FROM_BASE64(TO_BASE64('abc'))$$
SELECT 0x616263, HEX('abc'), UNHEX(HEX('abc'))$$
SELECT HEX(255), CONV(HEX(255),16,10)$$
SELECT INSERT('Quadratic', 3, 4, 'What')$$
SELECT INSTR('foobarbar', 'bar')$$
SELECT LEFT('foobarbar', 5)$$
SELECT LENGTH('text')$$
UPDATE t SET blob_col=LOAD_FILE('/tmp/picture') WHERE id=1$$
SELECT LOCATE('xbar', 'foobar')$$
SELECT LOCATE('bar', 'foobarbar', 5)$$
SELECT LOWER('QUADRATICALLY')$$
SELECT LOWER(@str), LOWER(CONVERT(@str USING latin1))$$
SELECT LPAD('hi',4,'??')$$
SELECT LTRIM('  barbar')$$
SELECT MAKE_SET(1,'a','b','c')$$
SELECT MAKE_SET(1 | 4,'hello','nice','world')$$
SELECT MAKE_SET(1 | 4,'hello','nice',NULL,'world')$$
SELECT MAKE_SET(0,'a','b','c')$$
SELECT OCT(12)$$
SELECT ORD('2')$$
SELECT QUOTE('Don\'t!')$$
SELECT QUOTE(NULL)$$
SELECT REPEAT('MySQL', 3)$$
SELECT REPLACE('www.mysql.com', 'w', 'Ww')$$
SELECT REVERSE('abc')$$
SELECT RIGHT('foobarbar', 4)$$
SELECT RPAD('hi',5,'?')$$
SELECT RTRIM('barbar   ')$$
SELECT SOUNDEX('Quadratically')$$
select 'aa' 'bb' sounds like 'cc' ''dd$$
SELECT SPACE(6)$$
SELECT SUBSTRING('Quadratically',5)$$
SELECT SUBSTRING('foobarbar' FROM 4)$$
SELECT SUBSTRING('Quadratically',5,6)$$
SELECT SUBSTRING('Sakila', -3)$$
SELECT SUBSTRING('Sakila', -5, 3)$$
SELECT SUBSTRING('Sakila' FROM -4 FOR 2)$$
SELECT SUBSTR('Quadratically',5)$$
SELECT SUBSTR('foobarbar' FROM 4)$$
SELECT SUBSTR('Quadratically',5,6)$$
SELECT SUBSTR('Sakila', -3)$$
SELECT SUBSTR('Sakila', -5, 3)$$
SELECT SUBSTR('Sakila' FROM -4 FOR 2)$$
SELECT SUBSTRING_INDEX('www.mysql.com', '.', 2)$$
SELECT SUBSTRING_INDEX('www.mysql.com', '.', -2)$$
SELECT TO_BASE64('abc'), FROM_BASE64(TO_BASE64('abc'))$$
SELECT TRIM('  bar   ')$$
SELECT TRIM(LEADING 'x' FROM 'xxxbarxxx')$$
SELECT TRIM(BOTH 'x' FROM 'xxxbarxxx')$$
SELECT TRIM(TRAILING 'xyz' FROM 'barxxyz')$$
SELECT UNHEX('4D7953514C')$$
SELECT 0x4D7953514C$$
SELECT UNHEX(HEX('string'))$$
SELECT HEX(UNHEX('1267'))$$
SELECT UPPER('Hej')$$
SELECT UCASE('Hej')$$
SELECT @s, HEX(@s), HEX(WEIGHT_STRING(@s));$$
SELECT HEX(WEIGHT_STRING('ab' AS BINARY(4)))$$
SELECT HEX(WEIGHT_STRING('ab' AS CHAR(4)))$$
[<80000]SELECT HEX(WEIGHT_STRING(0x007fff LEVEL 1))$$
[<80000]SELECT HEX(WEIGHT_STRING(0x007fff LEVEL 1 DESC))$$
[<80000]SELECT HEX(WEIGHT_STRING(0x007fff LEVEL 1 REVERSE))$$
[<80000]SELECT HEX(WEIGHT_STRING(0x007fff LEVEL 1 DESC REVERSE))$$
[<80000]SELECT HEX(WEIGHT_STRING('ab' AS CHAR(4) LEVEL 1-3))$$
[<80000]SELECT HEX(WEIGHT_STRING('ab' AS CHAR(4) LEVEL 1, 2, 3, 4))$$
SELECT 'Monty!' REGEXP '.*'$$
SELECT 'new*\n*line' REGEXP 'new\\*.\\*line'$$
SELECT 'a' REGEXP 'A', 'a' REGEXP BINARY 'A'$$
SELECT 'a' REGEXP '^[a-d]'$$
SELECT 'Monty!' RLIKE '.*'$$
SELECT 'new*\n*line' RLIKE 'new\\*.\\*line'$$
SELECT 'a' RLIKE 'A', 'a' REGEXP BINARY 'A'$$
SELECT 'a' RLIKE '^[a-d]'$$
SELECT 'a' NOT RLIKE '^[a-d]'$$
SELECT NOT ('a' RLIKE '^[a-d]')$$
SELECT CAST('18015376320243459' AS UNSIGNED) = 18015376320243459$$
SELECT '18015376320243459'+0.0$$
SELECT IF(1>2,2,3)$$
SELECT IF(1<2,'yes','no')$$
SELECT IF(STRCMP('test','test1'),'no','yes')$$
SELECT IFNULL(1,0)$$
SELECT IFNULL(NULL,10)$$
SELECT IFNULL(1/0,10)$$
SELECT IFNULL(1/0,'yes')$$
SELECT NULLIF(1,1)$$
SELECT NULLIF(1,2)$$
SELECT DATE_ADD('2008-01-02', INTERVAL 31 DAY)$$
SELECT ADDDATE('2008-01-02', INTERVAL 31 DAY)$$
SELECT ADDDATE('2008-01-02', 31)$$
SELECT ADDTIME('2007-12-31 23:59:59.999999', '1 1:1:1.000002')$$
SELECT ADDTIME('01:00:00.999999', '02:00:00.999998')$$
SELECT CONVERT_TZ('2004-01-01 12:00:00','GMT','MET')$$
SELECT CONVERT_TZ('2004-01-01 12:00:00','+00:00','+10:00')$$
SELECT CURDATE()$$
SELECT CURDATE() + 0$$
SELECT CURRENT_DATE()$$
SELECT CURRENT_DATE() + 0$$
SELECT CURTIME()$$
SELECT CURTIME() + 0$$
SELECT CURRENT_TIME()$$
SELECT CURRENT_TIME() + 0$$
SELECT DATE('2003-12-31 01:02:03')$$
SELECT DATEDIFF('2007-12-31 23:59:59','2007-12-30')$$
SELECT DATEDIFF('2010-11-30 23:59:59','2010-12-31')$$
SELECT '2008-12-31 23:59:59' + INTERVAL 1 SECOND$$
SELECT INTERVAL 1 DAY + '2008-12-31'$$
SELECT '2005-01-01' - INTERVAL 1 SECOND$$
SELECT DATE_ADD('2000-12-31 23:59:59', INTERVAL 1 SECOND)$$
SELECT DATE_ADD('2010-12-31 23:59:59', INTERVAL 1 DAY)$$
SELECT DATE_ADD('2100-12-31 23:59:59', INTERVAL '1:1' MINUTE_SECOND)$$
SELECT DATE_SUB('2005-01-01 00:00:00', INTERVAL '1 1:1:1' DAY_SECOND)$$
SELECT DATE_ADD('1900-01-01 00:00:00', INTERVAL '-1 10' DAY_HOUR)$$
SELECT DATE_SUB('1998-01-02', INTERVAL 31 DAY)$$
SELECT DATE_ADD('1992-12-31 23:59:59.000002', INTERVAL '1.999999' SECOND_MICROSECOND)$$
SELECT DATE_ADD('2009-01-01', INTERVAL 6/4 HOUR_MINUTE)$$
SELECT CAST(6/4 AS DECIMAL(3,1))$$
SELECT DATE_ADD('1970-01-01 12:00:00', INTERVAL CAST(6/4 AS DECIMAL(3,1)) HOUR_MINUTE)$$
SELECT DATE_ADD('2013-01-01', INTERVAL 1 DAY)$$
SELECT DATE_ADD('2013-01-01', INTERVAL 1 HOUR)$$
SELECT DATE_FORMAT('2009-10-04 22:23:00', '%W %M %Y')$$
SELECT DAYNAME('2007-02-03')$$
SELECT DAYOFMONTH('2007-02-03')$$
SELECT DAYOFWEEK('2007-02-03')$$
SELECT DAYOFYEAR('2007-02-03')$$
SELECT EXTRACT(YEAR FROM '2009-07-02')$$
SELECT EXTRACT(YEAR_MONTH FROM '2009-07-02 01:02:03')$$
SELECT EXTRACT(DAY_MINUTE FROM '2009-07-02 01:02:03')$$
SELECT EXTRACT(MICROSECOND FROM '2003-01-02 10:30:00.000123')$$
SELECT FROM_DAYS(730669)$$
SELECT FROM_UNIXTIME(1196440219)$$
SELECT FROM_UNIXTIME(1196440219) + 0$$
SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(), '%Y %D %M %h:%i:%s %x')$$
SELECT DATE_FORMAT('2003-10-03',GET_FORMAT(DATE,'EUR'))$$
SELECT HOUR('272:59:59')$$
SELECT LAST_DAY('2004-01-01 01:01:01')$$
SELECT MAKEDATE(2011,365), MAKEDATE(2014,365)$$
SELECT MICROSECOND('2009-12-31 23:59:59.000010')$$
SELECT MINUTE('2008-02-03 10:05:03')$$
SELECT MONTH('2008-02-03')$$
SELECT MONTHNAME('2008-02-03')$$
select now()$$
select now(6)$$
select localtime()$$
select localtime(6)$$
select localtimestamp()$$
select localtimestamp(6)$$
SELECT PERIOD_ADD(200801,2)$$
SELECT PERIOD_DIFF(200802,200703)$$
SELECT QUARTER('2008-04-01')$$
SELECT SECOND('10:05:03')$$
SELECT SEC_TO_TIME(2378)$$
SELECT SEC_TO_TIME(2378) + 0$$
SELECT STR_TO_DATE('01,5,2013','%d,%m,%Y')$$
SELECT STR_TO_DATE('May 1, 2013','%M %d,%Y')$$
SELECT DATE_SUB('2008-01-02', INTERVAL 31 DAY)$$
SELECT SUBDATE('2008-01-02', INTERVAL 31 DAY)$$
SELECT SUBTIME('2007-12-31 23:59:59.999999','1 1:1:1.000002')$$
SELECT SUBTIME('01:00:00.999999', '02:00:00.999998')$$
SELECT SYSDATE(), SLEEP(2), SYSDATE()$$
SELECT TIME('2003-12-31 01:02:03.000123')$$
SELECT TIMEDIFF('2008-12-31 23:59:59.000001', '2008-12-30 01:01:01.000002')$$
SELECT TIMESTAMP('2003-12-31 12:00:00','12:00:00')$$
SELECT TIMESTAMPADD(MINUTE,1,'2003-01-02')$$
SELECT TIMESTAMPADD(WEEK,1,'2003-01-02')$$
SELECT TIMESTAMPDIFF(MONTH,'2003-02-01','2003-05-01')$$
SELECT TIMESTAMPDIFF(YEAR,'2002-05-01','2001-01-01')$$
SELECT TIMESTAMPDIFF(MINUTE,'2003-02-01','2003-05-01 12:05:55')$$
SELECT TIME_FORMAT('100:00:00', '%H %k %h %I %l')$$
SELECT TIME_TO_SEC('00:39:38')$$
SELECT TO_DAYS(950501)$$
SELECT TO_DAYS('2007-10-07')$$
SELECT TO_SECONDS(950501)$$
SELECT TO_SECONDS('2009-11-29')$$
SELECT TO_SECONDS('2009-11-29 13:43:32')$$
SELECT TO_SECONDS( NOW() )$$
SELECT UNIX_TIMESTAMP()$$
SELECT UNIX_TIMESTAMP('2007-11-30 10:30:19')$$
SELECT UNIX_TIMESTAMP('2005-03-27 02:00:00')$$
SELECT FROM_UNIXTIME(1111885200)$$
SELECT UTC_DATE(), UTC_DATE() + 0$$
SELECT UTC_TIME(), UTC_TIME() + 0$$
SELECT UTC_TIMESTAMP(), UTC_TIMESTAMP() + 0$$
SELECT WEEK('2008-02-20')$$
SELECT WEEK('2008-02-20',0)$$
SELECT YEAR('2000-01-01'), WEEK('2000-01-01',0)$$
SELECT YEARWEEK('2000-01-01')$$
SELECT MID(YEARWEEK('2000-01-01'),5,2)$$
SELECT WEEKDAY('2008-02-03 22:23:00')$$
SELECT WEEKOFYEAR('2008-02-20')$$
SELECT YEAR('1987-01-01')$$
SELECT YEARWEEK('1987-01-01')$$
SELECT YEARWEEK('1987-01-01', 4)$$
SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('database' IN NATURAL LANGUAGE MODE)$$
SELECT id, body, MATCH (title,body) AGAINST
    ('Security implications of running MySQL as root'
    IN NATURAL LANGUAGE MODE) AS score
    FROM articles WHERE MATCH (title,body) AGAINST
    ('Security implications of running MySQL as root'
    IN NATURAL LANGUAGE MODE)$$
SELECT * FROM quotes_table WHERE MATCH (quote) AGAINST ('"mangé"' IN BOOLEAN MODE)$$
SELECT * FROM quotes_table WHERE MATCH (quote) AGAINST ('"mangé" "pensé"' IN BOOLEAN MODE)$$
SELECT * FROM quotes_table WHERE MATCH (quote) AGAINST ('+"mangé" +"pensé"' IN BOOLEAN MODE)$$
SELECT *, ( (1.3 * (MATCH(title) AGAINST ('+term +term2' IN BOOLEAN MODE))) + (0.6 * (MATCH(text) AGAINST ('+term +term2' IN BOOLEAN MODE))) ) AS relevance FROM table_name WHERE ( MATCH(title,text) AGAINST ('+term +term2' IN BOOLEAN MODE) ) HAVING relevance > 0 ORDER BY relevance DESC$$
SELECT id,
store,
name,
(((MATCH(name)
AGAINST(?) * 1.2) +
MATCH(`description`, keywords)
AGAINST (?) +
((MATCH(creators)
AGAINST (?) * 1.2)) / 3) +
(((store IN ('xfx','w3d')) * .12) * ((store IN ('iv', '3da', 'vp')) * .1))) *
MATCH(`description`,keywords,requirements,creators,name)
AGAINST(? IN BOOLEAN MODE)
AS sort_rel
FROM prod_text
WHERE MATCH(`description`,keywords,requirements,creators,name)
AGAINST(? IN BOOLEAN MODE)
AND store != 'pp'
HAVING sort_rel > 0.2
ORDER BY sort_rel DESC$$
SELECT * FROM articles
    WHERE MATCH (title,body)
    AGAINST ('database' WITH QUERY EXPANSION)$$
SELECT * FROM t1 WHERE MATCH (a) AGAINST ('----' IN BOOLEAN MODE)$$
SELECT *,MATCH (YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,JR,KW,AUS,GEO,AN,RB,CO,RR) AGAINST ('Margaret Atwood' IN BOOLEAN MODE) AS relevancy FROM
ccl_main WHERE MATCH (YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,JR,KW,AUS,GEO,AN,RB,CO,RR) AGAINST ('Margaret Atwood' IN BOOLEAN MODE) ORDER BY
relevancy DESC$$
SELECT * FROM data WHERE haystack LIKE ('%word1%word2%')
AND haystack RLIKE '[[:<:]]word1[[:>:]].*[[:<:]]word2[[:>:]]'$$
SELECT 'a' = 'A'$$
SELECT BINARY 'a' = 'A'$$
SELECT 'a' = 'a '$$
SELECT BINARY 'a' = 'a '$$
SELECT CONVERT('abc' USING utf8)$$
SELECT 'A' LIKE CONVERT(blob_col USING latin1) FROM tbl_name$$
SELECT 'A' LIKE CONVERT(blob_col USING latin1) COLLATE latin1_german1_ci
  FROM tbl_name$$
SET @str = BINARY 'New York'$$
SELECT LOWER(@str), LOWER(CONVERT(@str USING latin1))$$
SELECT enum_col FROM tbl_name ORDER BY CAST(enum_col AS CHAR)$$
SELECT CAST(1-2 AS UNSIGNED)$$
SELECT CAST(CAST(1-2 AS UNSIGNED) AS SIGNED)$$
CREATE FUNCTION `IntToInt10`(TheInt INT)
RETURNS INT(10) SIGNED -- here is the trick
DETERMINISTIC
BEGIN
RETURN TheInt;
END$$
select * from table1 WHERE dst LIKE CONCAT("%", CAST(fs.nid as BINARY),"%")$$
SELECT CAST(_latin1'test' AS CHAR CHARACTER SET utf8) COLLATE utf8_bin$$
SELECT CAST(x'01ABCDEF' AS DECIMAL)$$
SELECT BIT_COUNT(29), BIT_COUNT(b'101010')$$
SELECT 5 & ~1$$
select prefs &~ 512 &~ 64 | 4$$
SELECT
	SUM(rubrik & 1) actus,
	SUM(rubrik & 2)>>1 shopping,
	SUM(rubrik & 4)>>2 utils,
	SUM(rubrik & 8)>>3 communication,
	SUM(rubrik & 16)>>4 services,
	COUNT(user_id) AS total
FROM preferences p$$
SELECT * FROM customers WHERE status & 1$$
SELECT * FROM customers WHERE status & 16$$
SELECT * FROM customers WHERE (status & 16) AND !(status & 2)$$
SELECT * FROM customers WHERE status & 36$$
SELECT * FROM customers WHERE status & 10$$
SELECT * FROM customers WHERE (status & 32) AND !(status & 128)$$
SELECT LENGTH(COMPRESS(REPEAT('a',1000)))$$
SELECT LENGTH(COMPRESS(''))$$
SELECT LENGTH(COMPRESS('a'))$$
SELECT LENGTH(COMPRESS(REPEAT('a',16)))$$
SELECT customer_address FROM customer_table WHERE crypted_credit_card = DES_ENCRYPT('credit_card_number')$$
SELECT ENCRYPT('hello')$$
SELECT MD5('testing')$$
SELECT PASSWORD('mypass')$$
SELECT SHA1('abc')$$
SELECT SHA2('abc', 224)$$
SELECT UNCOMPRESS(COMPRESS('any string'))$$
SELECT UNCOMPRESS('any string')$$
SELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT('a',30)))$$
CREATE PROCEDURE HMACMD5(IN keynumber INTEGER, IN message BLOB, OUT output BINARY(16))
BEGIN
DECLARE ipad,opad BINARY(64);
DECLARE hexkey CHAR(32);

SELECT LPAD(HEX(`key`),32,"0") INTO hexkey FROM `keytable` WHERE `id` = keynumber;

SET ipad = UNHEX(CONCAT(LPAD(RIGHT(CONV(CONV( MID(hexkey,1,11) , 16, 10 ) ^ CONV( '36363636363', 16, 10 ),10,16),11),11,"0"),
LPAD(RIGHT(CONV(CONV( MID(hexkey,12,11) , 16, 10 ) ^ CONV( '63636363636' , 16, 10 ),10,16),11),11,"0"),
LPAD(RIGHT(CONV(CONV( MID(hexkey,23,10) , 16, 10 ) ^ CONV( '3636363636' , 16, 10 ),10,16),10),10,"0"),'363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636'));

SET opad = UNHEX(CONCAT(LPAD(RIGHT(CONV(CONV( MID(hexkey,1,11) , 16, 10 ) ^ CONV( '5c5c5c5c5c5', 16, 10 ),10,16),11),11,"0"),
LPAD(RIGHT(CONV(CONV( MID(hexkey,12,11) , 16, 10 ) ^ CONV( 'c5c5c5c5c5c' , 16, 10 ),10,16),11),11,"0"),
LPAD(RIGHT(CONV(CONV( MID(hexkey,23,10) , 16, 10 ) ^ CONV( '5c5c5c5c5c' , 16, 10 ),10,16),10),10,"0"),'5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c'));

SET output = UNHEX(MD5(CONCAT(opad,UNHEX(MD5(CONCAT(ipad,message))))));

END$$
DROP FUNCTION IF EXISTS fc_ssha_encode$$
CREATE FUNCTION fc_ssha_encode(_senha VARCHAR(255))
RETURNS CHAR (46)
DETERMINISTIC
BEGIN
/*
Funcao para criptografar em Salted SHA {SSHA}
Muito útil para LDAP com MySQL Backend.

Por Fernando Claudio dos Santos Junior (04/11/2010)

Inspirado no Post de vovó Vicki (http://www.numaboa.com/criptografia/codigos/codigos-abertos/492-base64)
e no Utilitário Javascript UTF-8 Decoder and Encoder - base64 Encoder and Decoder de Tobias Kieslich.

Uso livre.
Sem qualquer garantia de funcionamento ou seguranca.
*/
DECLARE MAPA CHAR(64);
DECLARE SALT CHAR(10);
DECLARE SALTBITS CHAR(80);
DECLARE B_ALEATORIO CHAR(8);
DECLARE C_ALEATORIO CHAR(1);
DECLARE SHASED CHAR(40);
DECLARE SHASEDBITS CHAR(160);
DECLARE SSHABITS CHAR(240);
DECLARE SSHA CHAR(46);
DECLARE CONT TINYINT UNSIGNED;

SET MAPA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; #BASE64

/* Passo 1) Gerar um salt aleatorio com 10 caracteres. Obs.: 10 é importante para garantir o tamanho final da senha criptografada. */
/* Passo 2) Coverter caracter por caracter do salt em byte com 8 bits cada. */
SET SALT = '';
SET SALTBITS = '';
SET CONT = 1;
WHILE (CONT < 11) DO
SET B_ALEATORIO = CONCAT(ROUND(RAND()), ROUND(RAND()), ROUND(RAND()), ROUND(RAND()), ROUND(RAND()), ROUND(RAND()));
SET C_ALEATORIO = SUBSTRING(MAPA, CONV(B_ALEATORIO,2,10)+1, 1);
SET SALT = CONCAT(SALT, C_ALEATORIO);
SET SALTBITS = CONCAT(SALTBITS,LPAD(CONV(ORD(C_ALEATORIO),10,2),8,'0'));
SET CONT = CONT + 1;
END WHILE;

/*
#FORCE SALT (para obter hash constante)
SET SALTBITS = '01110011010101100110110000110010010000010110010001100100010010010110111001000110';
SET SALT = 'sVl2AddInF';
*/

/* Passo 3) Criptografar utilizando SHA1(), o salt gerado irá garantir distintos resultados a cada tentativa. */
SET SHASED = SHA1(CONCAT(_senha, SALT));

/* Passo 4) Obter bits do hash gerado pelo SHA1(), para isso converter 2 a 2 caracteres de hexadecimal para base binaria, em byte com 8 bits cada. */
SET SHASEDBITS = '';
SET CONT = 1;
WHILE CONT < 40 DO
SET SHASEDBITS = CONCAT(SHASEDBITS, LPAD(CONV(SUBSTRING(SHASED,CONT,2),16,2),8,'0'));
SET CONT = CONT + 2;
END WHILE;

/* Passo 5) Obter todos bits da senha criptografada em SSHA, juntar bits do Passo4 com os bits do Passo2. */
SET SSHABITS = CONCAT(SHASEDBITS,SALTBITS);

/* Passo 6) Transformar bits do Passo5 em BASE64, para isso ler de 6 bits em 6 bits, comparado o respectivo valor decimal com a posicao no MAPA. */
SET SSHA = '{SSHA}';
SET CONT = 1;
WHILE CONT < 240 DO
SET SSHA = CONCAT(SSHA,SUBSTRING(MAPA,CONV(SUBSTRING(SSHABITS,CONT,6),2,10)+1,1));
SET CONT = CONT + 6;
END WHILE;

RETURN SSHA;
END$$
DROP FUNCTION IF EXISTS fc_bind_ssha_password$$
CREATE FUNCTION fc_bind_ssha_password(_senha VARCHAR(255), _hash VARCHAR(255))
RETURNS VARCHAR (10)
DETERMINISTIC
BEGIN
/*
Funcao para validar senhas criptografadas com Salted SHA {SSHA}
Muito útil para LDAP com MySQL Backend.

Por Fernando Claudio dos Santos Junior (04/11/2010)

Inspirado no Post de vovó Vicki (http://www.numaboa.com/criptografia/codigos/codigos-abertos/492-base64)
e no Utilitário Javascript UTF-8 Decoder and Encoder - base64 Encoder and Decoder de Tobias Kieslich.

Uso livre.
Sem qualquer garantia de funcionamento ou seguranca.
*/
DECLARE MAPA CHAR(64);
DECLARE SSHA, SHASED CHAR(40);
DECLARE SSHABITS, SSHABITS2 CHAR(240);
DECLARE SALTBITS CHAR(80);
DECLARE SALT CHAR(10);
DECLARE SHASEDBITS CHAR(160);
DECLARE CONT TINYINT UNSIGNED;
SET MAPA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; #BASE64

/* Passo 1) Tranformar caracter em caracter do _hash em bytes de 6 bits, de acordo com o MAPA Base64 */

SET SSHA = SUBSTRING(_hash, 7, 40);
SET SSHABITS = '';
SET CONT = 1;
WHILE CONT < 41 DO
SET SSHABITS = CONCAT(SSHABITS, LPAD( CONV( POSITION(SUBSTRING(SSHA,CONT,1) IN CONVERT(MAPA USING BINARY))-1, 10, 2),6,'0'));
SET CONT = CONT + 1;
END WHILE;

/* Passo 2) Pegar bits apartir da posicao 161 a 240 */
SET SALTBITS = SUBSTRING(SSHABITS,161,80);

/* Passo 3) Obter salt, Ler de 8 em 8 bits, transformado o octeto em caracteres */
SET SALT = '';
SET CONT = 1;
WHILE CONT < 80 DO
SET SALT = CONCAT(SALT, CHAR(CONV(SUBSTRING(SALTBITS,CONT,8), 2, 10)));
SET CONT = CONT + 8;
END WHILE;

/* Passo 4) Criptografar senha testada com salt encontrado no rash, transformar em seguida, 2 a 2 de hexadecimal para binario. */
SET SHASED = SHA1(CONCAT(_senha, SALT));
SET SHASEDBITS = '';
SET CONT = 1;
WHILE CONT < 40 DO
SET SHASEDBITS = CONCAT(SHASEDBITS, LPAD(CONV(SUBSTRING(SHASED,CONT,2),16,2),8,'0'));
SET CONT = CONT + 2;
END WHILE;

/* Passo 5) Obter todos bits da senha criptografada em SSHA, juntar bits do Passo4 com os bits do Passo2. */
SET SSHABITS2 = CONCAT(SHASEDBITS,SALTBITS);

/* Passo 6) Testar se os hashs conferem */
RETURN (SSHABITS2 = SSHABITS);
END$$
create function hex2b64 (hex text)
returns text
comment 'Converts a string containing hex values into base64'
deterministic
begin
declare b64set text default
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789./";
declare bin text default '';
declare b64 text default '';
declare chars int;
declare chip int;
declare n int default 0;
declare d char(1);
-- mysql's conv function has a limit on the length of the hex string
-- it can convert in one shot, so convert it one character at a time.
HEX2BIN: loop
if n = length(hex) then
leave HEX2BIN;
end if;
set n = n + 1;
set d = substr(hex, n, 1);
set bin = concat(bin, conv(d, 16, 2));
end loop;
-- Chip away at the binary representation of the hex string 6 bits at
-- a time. 6 bits => 2**6 => base64. The binary number can then be
-- used as an index into b64set to get the next base64 character.
B64DIGIT: loop
set chars = length(bin);
if !chars then
leave B64DIGIT;
end if;
set chip = if(chars % 6, chars % 6, 6);
set n = conv(substr(bin, 1, chip), 2, 10);
set d = substr(b64set, n + 1, 1);
set b64 = concat(b64, d);
set bin = substr(bin, chip + 1);
end loop;
return b64;
end$$
SELECT BENCHMARK(1000000,ENCODE('hello','goodbye'))$$
SELECT CHARSET('abc')$$
SELECT CHARSET(CONVERT('abc' USING utf8))$$
SELECT CHARSET(USER())$$
SELECT COERCIBILITY('abc' COLLATE latin1_swedish_ci)$$
SELECT COERCIBILITY(USER())$$
SELECT COERCIBILITY('abc')$$
SELECT COLLATION('abc')$$
SELECT COLLATION(_utf8'abc')$$
SELECT CONNECTION_ID()$$
SELECT USER()$$
SELECT CURRENT_USER()$$
SELECT DATABASE()$$
SELECT FOUND_ROWS()$$
SET @rows = FOUND_ROWS()$$
SELECT LAST_INSERT_ID()$$
SELECT ROW_COUNT()$$
SELECT USER()$$
SELECT SUBSTRING_INDEX(USER(),'@',1)$$
SELECT VERSION()$$
SELECT INET6_NTOA(INET6_ATON('fdfe::5a55:caff:fefa:9089'))$$
SELECT INET6_NTOA(INET6_ATON('10.0.5.9'))$$
SELECT INET6_NTOA(UNHEX('FDFE0000000000005A55CAFFFEFA9089'))$$
SELECT INET6_NTOA(UNHEX('0A000509'))$$
SELECT COUNT(DISTINCT results) FROM student$$
SELECT student_name, GROUP_CONCAT(test_score) FROM student GROUP BY student_name$$
SELECT student_name, GROUP_CONCAT(DISTINCT test_score ORDER BY test_score DESC SEPARATOR ' ') FROM student GROUP BY student_name$$
SELECT year, SUM(profit) FROM sales GROUP BY year WITH ROLLUP$$
SELECT year, country, product, SUM(profit) FROM sales GROUP BY year, country, product WITH ROLLUP LIMIT 5$$
SELECT X(POINT(56.7, 53.34))$$
SELECT AsText(EndPoint(GeomFromText(@ls)))$$
SELECT GLength(GeomFromText(@ls))$$
SELECT NumPoints(GeomFromText(@ls))$$
SELECT AsText(PointN(GeomFromText(@ls),2))$$
SELECT AsText(StartPoint(GeomFromText(@ls)))$$
CREATE FUNCTION GetCenterPoint(g GEOMETRY) RETURNS POINT NO SQL DETERMINISTIC
BEGIN
DECLARE envelope POLYGON;
DECLARE sw, ne POINT; #South-West and North-East points
DECLARE lat, lng DOUBLE;

SET envelope = ExteriorRing(Envelope(g));
SET sw = PointN(envelope, 1);
SET ne = PointN(envelope, 3);
SET lat = X(sw) + (X(ne)-X(sw))/2;
SET lng = Y(sw) + (Y(ne)-Y(sw))/2;
RETURN POINT(lat, lng);
END$$
SELECT MBRContains(@g1,@g2), MBRContains(@g2,@g1)$$
SELECT (.1 + .2) = .3$$
SELECT (.1E0 + .2E0) = .3E0$$
SELECT ROUND(2.5), ROUND(-2.5)$$
CREATE TABLE t SELECT 2.5 AS a, 25E-1 AS b$$
select `MyS` `QL`, `My``SQL`, 'My' 'S' 'QL', 'My''SQL', "MyS" "QL", "My" "SQL"$$
select "abc\0def", "abc\\def", "abc\bdef", "abc\ndef", "abc\rdef", "abc\tdef", "abc\zdef"$$
/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 FUNCTION `test_restore_work`() RETURNS int(11)
BEGIN DECLARE result INT; set result := 42; RETURN result; END */$$
select @my_var := 1000000, @my_var + 123;$$
ALTER TABLE `SMaLLCallUps`
  ADD CONSTRAINT `FK_CallUps_ForGameID_Games` FOREIGN KEY (`ForGameID`) REFERENCES `SMaLLGames` (`id`),
  ADD CONSTRAINT `FK_CallUps_ForTeamID_Teams` FOREIGN KEY (`ForTeamID`) REFERENCES `SMaLLTeams` (`id`),
  ADD CONSTRAINT `FK_CallUps_FromTeamID_Teams` FOREIGN KEY (`FromTeamID`) REFERENCES `SMaLLTeams` (`id`),
  ADD CONSTRAINT `FK_CallUps_PlayerID_Players` FOREIGN KEY (`PlayerID`) REFERENCES `SMaLLPlayers` (`id`)$$
ALTER TABLE `SO`.`unit` CHANGE COLUMN `id` `id` INT(11) NOT NULL AUTO_INCREMENT  , CHANGE COLUMN `unit_type_id` `unit_type_id` INT(11) NOT NULL ,
	ADD CONSTRAINT `Unit is instance of which Unit Type?` FOREIGN KEY (`unit_type_id` ) REFERENCES `SO`.`unit_type` (`id` )
		ON DELETE NO ACTION
		ON UPDATE NO ACTION$$
show count(*) errors$$
show count(*) warnings$$

CREATE TABLE `test`.`t0001` (
`a1` varchar(154) CHARACTER SET utf8 DEFAULT NULL,
`col21` longtext CHARACTER SET ucs2 COLLATE ucs2_sinhala_ci NOT NULL,
`col22` time NOT NULL DEFAULT '04:51:41',
`col23` double unsigned DEFAULT '4.726285e32',
`col24` datetime NOT NULL DEFAULT '2012-10-05 15:26:22',
`col25` linestring NOT NULL,
`col26` decimal(15,7) NOT NULL DEFAULT '-1665.3640000',
`col27` date NOT NULL DEFAULT '2012-06-21',
`col28` bit(47) DEFAULT b'10000101100000111011000000',
`col36` point NOT NULL,
`col37` datetime NOT NULL DEFAULT '2013-04-23 13:36:30',
`col38` linestring DEFAULT NULL,
`col39` int(10) unsigned DEFAULT '99999',
`col40` point NOT NULL,
`col41` varchar(239) CHARACTER SET utf8 NOT NULL DEFAULT 'ncapvpzonjgftarsuzyqivsvlgqnvxkgldpaqshlxvnioarwenorzcvosehetsdzsbvmqasogi',
`col42` double unsigned NOT NULL DEFAULT '1004.7298',
`col43` bit(17) NOT NULL DEFAULT b'0',
`col44` date NOT NULL DEFAULT '2011-12-04',
`col45` datetime NOT NULL DEFAULT '2012-05-07 22:58:08',
`col46` time NOT NULL DEFAULT '08:49:40',
`col92` blob NOT NULL,
`col103` multilinestring DEFAULT NULL,
`col104` datetime NOT NULL DEFAULT '2012-07-01 09:10:05',
`col105` linestring DEFAULT NULL,
`col106` geometry NOT NULL,
`col130` time NOT NULL DEFAULT '12:16:51',
`col131` blob NOT NULL,
`col132` smallint(6) DEFAULT '-824',
`col133` timestamp NOT NULL DEFAULT '2013-09-01 07:36:02',
`col134` blob NOT NULL,
`col135` int(10) unsigned NOT NULL DEFAULT '100001',
`col147` time DEFAULT '02:57:10',
`col148` multipolygon DEFAULT NULL,
`col149` timestamp NOT NULL DEFAULT '2011-12-28 16:27:32',
`col150` bit(3) DEFAULT b'0',
`col151` polygon NOT NULL,
`col152` longblob NOT NULL,
`col153` binary(1) NOT NULL,
`col154` tinyblob NOT NULL,
`col155` timestamp NOT NULL DEFAULT '2012-07-29 19:10:10',
`col156` binary(1) NOT NULL,
`col157` linestring DEFAULT NULL,
`col158` double unsigned NOT NULL DEFAULT '1001.0574',
`col159` timestamp NOT NULL DEFAULT '2013-04-16 05:00:48',
`col160` geometry NOT NULL,
`col161` bigint(20) unsigned DEFAULT '0',
`col167` geometry DEFAULT NULL,
`col168` multilinestring NOT NULL,
`col169` decimal(15,2) unsigned NOT NULL DEFAULT '1487.00',
`col176` set('rbnxmhou','wg','wneihpbzw','uprcuq','zyddz','ukyc','pfrhk') CHARACTER SET ucs2 COLLATE ucs2_unicode_ci NOT NULL,
`col177` geometrycollection DEFAULT NULL,
`col178` date DEFAULT '2012-12-10',
`col179` geometrycollection DEFAULT NULL,
`col180` datetime NOT NULL DEFAULT '2012-06-10 14:38:36',
`col181` decimal(48,20) unsigned NOT NULL DEFAULT '0.00000159700000000000',
`col182` time DEFAULT '12:58:46',
`col190` binary(1) NOT NULL,
`col191` timestamp NOT NULL DEFAULT '2013-05-18 14:53:34',
`col192` timestamp NOT NULL DEFAULT '2012-07-15 04:11:49',
`col193` polygon DEFAULT NULL,
`col194` time DEFAULT '14:38:03',
`col195` date NOT NULL DEFAULT '2012-09-03',
`col196` decimal(40,28) NOT NULL DEFAULT '1118.2558000000000000000000000000',
`col197` blob NOT NULL,
`col198` double unsigned DEFAULT '100000',
`col199` time NOT NULL DEFAULT '04:28:18',
`col200` tinytext CHARACTER SET macroman NOT NULL,
`col201` time NOT NULL DEFAULT '10:14:47',
`col210` multipoint DEFAULT NULL,
`col211` geometrycollection DEFAULT NULL,
`col212` point DEFAULT NULL,
`col220` longblob NOT NULL,
`col221` bigint(20) DEFAULT '-154',
`col222` multipoint DEFAULT NULL,
`col223` tinyblob NOT NULL,
`col224` polygon NOT NULL,
`col225` multipoint NOT NULL,
`col226` mediumblob NOT NULL,
`col227` binary(1) NOT NULL,
`col228` geometry DEFAULT NULL,
`col229` decimal(65,21) DEFAULT '-308.697800000000000000000',
`col230` time NOT NULL DEFAULT '04:35:34',
`col239` varchar(237) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL DEFAULT 'fxygzisjplsjwnskzhfsrnmyxrcyqnehkidghfdmd',
`col249` tinyblob NOT NULL,
`col250` double DEFAULT '-100000',
`col251` datetime NOT NULL DEFAULT '2012-06-05 13:17:57',
`col252` mediumblob NOT NULL,
`col253` decimal(15,5) unsigned NOT NULL DEFAULT '534.54920',
`col254` timestamp NOT NULL DEFAULT '2012-05-04 18:50:02',
`col255` char(184) CHARACTER SET utf8 NOT NULL DEFAULT 'kdnikktwyoberotjrtkinsdkogqfldjpmjkionsvwjgisjyyqfbkmgqotoqgtvccqyhtiqmikneymkvehv',
`col256` geometry NOT NULL,
`col257` multilinestring NOT NULL,
`col258` multipoint DEFAULT NULL,
`col277` multilinestring NOT NULL,
`col278` linestring NOT NULL,
`col279` datetime NOT NULL DEFAULT '2012-02-22 15:18:16',
`col288` double DEFAULT '5.493504e-69',
`col289` bigint(20) unsigned NOT NULL DEFAULT '801',
`col290` point DEFAULT NULL,
`col291` double unsigned NOT NULL DEFAULT '1.4404555e-78',
`col292` double NOT NULL DEFAULT '1662',
`col301` tinytext CHARACTER SET geostd8 NOT NULL,
`col302` multipolygon DEFAULT NULL,
`col303` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`col304` point DEFAULT NULL,
`col305` geometrycollection NOT NULL,
`col306` double unsigned DEFAULT '239.669',
`col307` set('','rpnfxzz','jvnaghtxi','wkyeobkf','swuwr','iznokdzntz','xvrarsxw','qre','','gnnazwazgw','rugat','xg','nmgrbzoalx','bnvlntb','','','rlxxdtiqqa','vykprrwn','nyuvvco','hyg','ylfryabeyb','xrwvsexyhi','azmhwp','socx','sniic','p','eyext','sitgnityj','mseh','vehotiakrs','hxmfifsimy','azwnkmkf','zpo','n','futqgzdqcn','cpf','seuxwuo','mbeygpybwy','f','bf','xrl','txwrq','jqqhpcymq','','ypcnj','oxhbvvca','fincldrtc') CHARACTER SET ucs2 COLLATE ucs2_unicode_ci NOT NULL,
`col340` longtext CHARACTER SET ucs2 COLLATE ucs2_swedish_ci NOT NULL,
`col341` int(11) DEFAULT '-227',
`col342` binary(1) NOT NULL,
`col343` timestamp NOT NULL DEFAULT '2012-08-17 02:51:39',
`col344` geometrycollection NOT NULL,
`col345` timestamp NOT NULL DEFAULT '2013-06-10 20:51:17',
`col346` geometrycollection NOT NULL,
`col347` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`col348` mediumblob NOT NULL,
`col349` date NOT NULL DEFAULT '2012-10-25',
`col350` blob NOT NULL,
`col351` double unsigned zerofill DEFAULT '00000000004.995411e-28',
`col352` multilinestring DEFAULT NULL,
`col353` binary(1) NOT NULL,
`col363` int(10) unsigned DEFAULT '1268',
`col364` set('zviaxv','lwuntcgoim','tfcaahz','rknpwdul','axfp','hxnoyzub','zjg','ehqqwzpdyp','pz','izvdhdb','','ue','xsydpcs','frasemwk','owypymt','rllf','lvehbd','oofm','oe','kxsv','psopswjw','a','uxszj','kspknyiy','tctzkz','dbilhc','gjxuopja','zog','xtv','nidb','gkcntubt','zhbcqshuvr','','ixhgqb','otw','txihnn','zhuuclgbmd','rpgcvyqrap','oskvfw','wzhuybpzh','fmmspgzn','jeg','uwrhfq','b','r','dfzkqmx','qvbmxoy','tffku','lsbxafbmpo','peues','jyblbrc','jclidb','wehrvk','cvodufegn','','vslgh','xlowmeudpl','jcfshomnv','vl','vg','fhipniex','') CHARACTER SET macroman COLLATE macroman_bin NOT NULL,
`col365` varchar(133) CHARACTER SET utf8 NOT NULL DEFAULT 'rkgipvotjooksnvdsilmopjhreiahomvrtkyvtgijsowgpviczzoisgmyvruayncglgruhiwgvbaxdnxklljelqavxsdhxkuyyqviaasvvczrkhasyzkblbtoqjn',
`col366` char(36) CHARACTER SET latin5 NOT NULL DEFAULT 'rvzkjadahysuszmmrtizylkhnjrwmidqxtfr',
`col367` decimal(26,0) DEFAULT '-759',
`col368` decimal(35,10) DEFAULT '0.0000000000',
`col369` tinytext CHARACTER SET utf8 NOT NULL,
`col370` float unsigned DEFAULT '902.273',
`col371` binary(1) NOT NULL,
`col372` double unsigned DEFAULT '921.8662',
`col373` blob NOT NULL,
`col374` double unsigned DEFAULT '886',
`col375` tinyblob NOT NULL,
`col376` point NOT NULL,
`col377` datetime DEFAULT '2012-08-21 08:45:51',
`col378` blob NOT NULL,
`col379` polygon NOT NULL,
`col380` time DEFAULT '12:14:26',
`col381` multilinestring NOT NULL,
`col382` text CHARACTER SET cp1250 COLLATE cp1250_polish_ci NOT NULL,
`col383` datetime DEFAULT '2012-05-28 23:03:10',
`col384` binary(1) NOT NULL,
`col385` multipoint NOT NULL,
`col386` multipoint NOT NULL,
`col387` polygon NOT NULL,
`col388` date NOT NULL DEFAULT '2012-02-22',
`col389` multipolygon NOT NULL,
`col390` multilinestring DEFAULT NULL,
`col391` time DEFAULT '05:08:20',
`col392` binary(1) NOT NULL,
`col393` decimal(26,14) DEFAULT '100001.00000000000000',
`col394` set('','mrubwn','w','fkkdwyaw','ukffmnboe','scilxu','','clqhpxcktz','o','akrq') CHARACTER SET utf8 COLLATE utf8_danish_ci NOT NULL,
`col395` bit(44) NOT NULL DEFAULT b'0',
`col396` binary(1) NOT NULL,
`col397` point DEFAULT NULL,
`col398` mediumblob NOT NULL,
`col411` timestamp NOT NULL DEFAULT '2013-05-16 02:24:07',
`col412` point DEFAULT NULL,
`col413` decimal(54,10) DEFAULT '773.0000000000',
`col414` multipolygon DEFAULT NULL,
`col415` geometrycollection DEFAULT NULL,
`col416` date NOT NULL DEFAULT '2013-04-06',
`col424` polygon DEFAULT NULL,
`col425` date DEFAULT '2013-03-20',
`col463` time DEFAULT '13:04:27',
`col464` smallint(5) unsigned DEFAULT '999',
`col465` polygon DEFAULT NULL,
`col466` decimal(50,27) NOT NULL DEFAULT '669.951800000000000000000000000',
`col467` char(163) CHARACTER SET utf8 NOT NULL DEFAULT 'wygsbikppkbrvhppifmgqafobdqoatrxzbmtlnifqbnhtcyirtflwropwlliiyfkvct',
`col552` time DEFAULT '09:26:14',
`col553` linestring NOT NULL,
`col554` time DEFAULT '19:38:36',
`col555` time DEFAULT '18:49:01',
`col556` time NOT NULL DEFAULT '06:05:08',
`col557` datetime NOT NULL DEFAULT '2011-12-28 00:57:00',
`col558` varbinary(208) NOT NULL,
`col559` double DEFAULT '115078000000',
`col560` time DEFAULT '12:26:50',
`col561` polygon DEFAULT NULL,
`col589` double DEFAULT '84.637',
`col590` multipolygon DEFAULT NULL,
`col591` multipolygon DEFAULT NULL,
`col592` bit(15) NOT NULL DEFAULT b'1000101011',
`col593` multipoint DEFAULT NULL,
`col594` float NOT NULL DEFAULT '361',
`col595` geometrycollection DEFAULT NULL,
`col596` text CHARACTER SET ucs2 COLLATE ucs2_icelandic_ci NOT NULL,
`col597` geometrycollection NOT NULL,
`col598` enum('dh','ysvot','e','lhmqrwg','v','lbblbipyv','ntl','tvbcaxud','cyaexa','qgfr') CHARACTER SET latin5 COLLATE latin5_bin NOT NULL,
`col599` bit(46) DEFAULT b'0',
`col600` int(11) DEFAULT '0',
`col601` geometrycollection DEFAULT NULL,
`col602` char(151) CHARACTER SET utf8mb4 COLLATE utf8mb4_czech_ci NOT NULL DEFAULT 'uhflarjdygvadyjgbdnllswuvtfzshmpiwszulazbjxkwrcfznueywqzyttbuopogamusiwjoevgytrzukwzltflomyxluhthuerqftp',
`col603` multipoint DEFAULT NULL,
`col604` decimal(62,9) NOT NULL DEFAULT '1626.723900000',
`col605` tinytext CHARACTER SET ucs2 COLLATE ucs2_roman_ci NOT NULL,
`col606` multipolygon DEFAULT NULL,
`col607` enum('yykolocq','xepw','j','ep','mcqczop','l','','oouwt','shvvsowfgh','mwidvbc','okrkfzyt','wbvxe','axqv','','pv','chzpn') CHARACTER SET ucs2 COLLATE ucs2_romanian_ci NOT NULL,
`col608` multipolygon DEFAULT NULL,
`col609` bigint(20) DEFAULT '-347',
`col610` linestring DEFAULT NULL,
`col611` point DEFAULT NULL,
`col645` double DEFAULT '361',
`col646` time NOT NULL DEFAULT '03:58:52',
`col647` polygon NOT NULL,
`col648` date DEFAULT '2012-02-29',
`col657` double unsigned NOT NULL DEFAULT '100000',
`col658` multipolygon DEFAULT NULL,
`col659` geometrycollection NOT NULL,
`col660` time NOT NULL DEFAULT '14:01:49',
`col661` multilinestring DEFAULT NULL,
`col662` geometrycollection DEFAULT NULL,
`col663` linestring NOT NULL,
`col668` set('cby','atw','c','mqa','','e','brfn','yg','uctewxvrfq','','jivnqt','o','qgxrjvle','dmeqnxbo','kxrihw','jgjvsic','a','thkiryyjg','bcfspu','rtucgn','mmmmf','umnbvjzqmz','lziqmuo','hesqyfwi','pwpb','','ldzgmgaia','myt','ymro','jqzhkmh','wnzh','zx','','r','wndmbonazr','pwqshgn','kuugct','jylih','yebbv','swtxvvex','ib','wobbqtrgn','rwftdkd','wbp','frb','rz','fgmri','jpx','hosllux','q','heyeuyuw','xvbxwpikw','dfglvxwre','crayksvq','k','g','bseplrubv') CHARACTER SET eucjpms COLLATE eucjpms_bin NOT NULL,
`col669` int(11) DEFAULT '369',
`col670` varchar(217) CHARACTER SET utf8 NOT NULL DEFAULT 'sllgwgmdnbwzpxtyxnhiqjakuryhsrnlbjpbzmmfjqoqhhjranxxuebxeihtffopdqfngbsejihzbbftieuoyqkagxnimmrj',
`col671` geometrycollection DEFAULT NULL,
`col672` point NOT NULL,
`col673` timestamp NOT NULL DEFAULT '2011-11-09 05:52:00',
`col757` datetime DEFAULT '2012-02-22 10:30:36',
`col758` tinyblob NOT NULL,
`col759` multipolygon NOT NULL,
`col760` date NOT NULL DEFAULT '2013-06-26',
`col761` geometrycollection DEFAULT NULL,
`col762` double NOT NULL DEFAULT '7.614857e33',
`col813` point DEFAULT NULL,
`col814` varchar(126) CHARACTER SET utf8 NOT NULL DEFAULT 'scq',
`col815` double NOT NULL DEFAULT '100000',
`col816` geometrycollection DEFAULT NULL,
`col817` timestamp NOT NULL DEFAULT '2013-01-31 16:41:20',
`col832` date DEFAULT '2012-10-08',
`col833` multipoint DEFAULT NULL,
`col834` varchar(103) CHARACTER SET utf8 COLLATE utf8_slovenian_ci NOT NULL DEFAULT 'tffrzzkchfaomhopktjiipcmgbxehlffymfnaolparrhxrobburwpbrmymhwhsoasdvetzlvikz',
`col835` time NOT NULL DEFAULT '19:49:41',
`col836` time DEFAULT '16:16:29',
`col837` linestring DEFAULT NULL,
`col838` binary(1) NOT NULL,
`col839` datetime DEFAULT '2013-07-02 09:14:19',
`col840` float unsigned NOT NULL DEFAULT '0',
`col841` datetime DEFAULT '2013-02-26 13:52:37',
`col842` char(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_esperanto_ci NOT NULL DEFAULT 'dhmwpzjiuvfxzzbxbckjebalpiumdoqcdheuizaxjgpfenygwqrdfcumjsnicvwhhzzagbgbycbpjpkvldshenwqlmossbuzbnqasycetkudmztqsdggc',
`col860` datetime DEFAULT '2012-07-04 10:54:36',
`col861` tinyint(1) DEFAULT '0',
`col895` geometrycollection NOT NULL,
`col896` blob NOT NULL,
`col897` multipolygon NOT NULL,
`col898` bigint(20) unsigned zerofill NOT NULL DEFAULT '00000000000000099999',
`col899` datetime NOT NULL DEFAULT '2012-09-08 03:23:24',
`col908` datetime NOT NULL DEFAULT '2012-06-04 00:18:37',
`col946` tinyint(1) DEFAULT '53',
`col947` tinyblob NOT NULL,
`col948` char(6) CHARACTER SET utf8 NOT NULL,
`col949` varchar(122) CHARACTER SET utf8 NOT NULL DEFAULT 'vuplkgvqpcxnheptiwkbvtilenaokcscaddnqscqxsqmebojloggeogchdanoaroqmmrrmgsaamdqcirntfsprdwsdmjlacugxsmdburfytfxmxsjgkhcvya',
`col950` longtext CHARACTER SET keybcs2 NOT NULL,
`col964` multilinestring NOT NULL,
`col965` time DEFAULT '14:21:06',
`col979` date NOT NULL DEFAULT '2013-09-18',
`col980` geometry NOT NULL,
`col981` varchar(182) CHARACTER SET cp932 NOT NULL DEFAULT 'yqxvggnkhwraaylqdffzhnshrbmvcnnrdfyostcforapjjgguscueeokumjjovvcuoycesrbdldetsswwhapkihjjduneewghuqcxprdgsedikwqyaxvvwkgkzpopqthvjaagnasycsih',
`col982` timestamp NOT NULL DEFAULT '2011-10-28 16:27:05',
`col983` linestring NOT NULL,
`col984` point NOT NULL,
`col1009` geometrycollection NOT NULL,
`col1010` multipolygon NOT NULL,
`col1011` multipolygon DEFAULT NULL,
`col1012` point NOT NULL,
`col1013` multipoint NOT NULL,
`col1014` binary(1) NOT NULL,
`col1015` geometry NOT NULL,
`col1016` geometrycollection NOT NULL,
`col1017` time DEFAULT '22:49:14',
`col1018` geometry DEFAULT NULL,
`col1019` mediumblob NOT NULL,
`col1020` geometrycollection DEFAULT NULL,
`col1021` time NOT NULL DEFAULT '20:00:53',
`col1029` mediumtext CHARACTER SET utf8 COLLATE utf8_polish_ci NOT NULL,
`col1030` mediumtext CHARACTER SET utf8 COLLATE utf8_danish_ci NOT NULL,
`col1031` polygon DEFAULT NULL,
`col1032` timestamp NOT NULL DEFAULT '2012-06-07 07:56:51',
`col1033` time NOT NULL DEFAULT '00:34:05',
`col1063` date DEFAULT '2013-03-15',
`col1064` timestamp NOT NULL DEFAULT '2013-07-15 10:06:20',
`col1065` datetime DEFAULT '2011-11-10 23:42:30',
`col1066` date DEFAULT '2012-06-18',
`col1067` binary(1) NOT NULL,
`col1068` double DEFAULT '-1.39e-45',
`col1069` multipolygon NOT NULL,
`col1070` polygon NOT NULL,
`col1071` time DEFAULT '00:08:11',
`col1078` multilinestring NOT NULL,
`col1079` date NOT NULL DEFAULT '2013-09-19',
`col1080` char(56) CHARACTER SET utf8 NOT NULL,
`col1081` int(10) unsigned DEFAULT '1126',
`col1082` timestamp NOT NULL DEFAULT '2013-06-12 22:26:55',
`col1095` double DEFAULT '397.9621',
`col1096` set('rtwkwd','vduqdrk','ot','vjjn','wizl','kngzzgyao','s','wa','qorhe','bdaxktgrgb','cvett','fbdnmwo','vgplugut','bcz','ysrdyjs','qbgzplb','ovdfsouoit','bbdnjbx','','dyjkaer') CHARACTER SET swe7 COLLATE swe7_bin NOT NULL,
`col1106` double NOT NULL DEFAULT '-916',
`col1107` timestamp NOT NULL DEFAULT '2013-09-24 19:52:45',
`col1108` mediumint(9) NOT NULL DEFAULT '0',
`col1109` polygon NOT NULL,
`col1110` decimal(34,7) unsigned zerofill DEFAULT '000000000000000000000000000.0000000',
`col1111` date DEFAULT '2011-10-14',
`col1112` timestamp NOT NULL DEFAULT '2013-02-06 14:54:39',
`col1113` geometrycollection NOT NULL,
`col1114` geometry DEFAULT NULL,
`col1138` linestring NOT NULL,
`col1148` time DEFAULT '00:01:33',
`col1149` enum('hkrg','j','xvzve','hcgsbeejqq','tojfi') CHARACTER SET armscii8 COLLATE armscii8_bin NOT NULL,
`col1150` multipolygon DEFAULT NULL,
`col1151` float unsigned DEFAULT '99999',
`col1152` char(27) CHARACTER SET utf8 NOT NULL,
`col1153` longtext CHARACTER SET cp1250 COLLATE cp1250_czech_cs NOT NULL,
`col1154` varbinary(243) NOT NULL,
`col1155` double DEFAULT '-824',
`col1156` set('','bxdihtgoto','umoexkebrx','bpwdqesm','apthks','','co','uvpsebzelq','tduivisrfg','','sfffmukeev','','vkjlxmlh','','snphdfrzu','','jlboqwambe','y','psh','','','croobejgpb','','afnmnegc','mllj','','wlwajss','f','hlnrku','mn','tfldg','su','muyvzhwfk','awtkwjkls','','oznf') CHARACTER SET ucs2 COLLATE ucs2_lithuanian_ci NOT NULL,
`col1157` multilinestring DEFAULT NULL,
`col1158` geometry NOT NULL,
`col1159` date DEFAULT '2013-07-07',
`col1160` mediumtext CHARACTER SET ujis COLLATE ujis_bin NOT NULL,
`col1161` datetime NOT NULL DEFAULT '2011-10-11 18:44:14',
`col1162` tinytext CHARACTER SET hp8 COLLATE hp8_bin NOT NULL,
`col1163` multipoint NOT NULL,
`col1164` point DEFAULT NULL,
`col1165` enum('yjepshc','koeorw') CHARACTER SET euckr NOT NULL,
`col1166` tinyblob NOT NULL,
`col1167` datetime DEFAULT '2013-04-05 13:31:15',
`col1168` date DEFAULT '2012-09-15',
`col1169` polygon DEFAULT NULL,
`col1170` geometrycollection DEFAULT NULL,
`col1171` polygon NOT NULL,
`col1172` bigint(20) unsigned DEFAULT '0',
`col1175` linestring DEFAULT NULL,
`col1176` timestamp NOT NULL DEFAULT '2012-03-03 04:58:09',
`col1177` polygon NOT NULL,
`col1178` binary(1) NOT NULL,
`col1179` longtext CHARACTER SET ucs2 NOT NULL,
`col1180` date DEFAULT '2013-07-15',
`col1181` multipoint NOT NULL,
`col1182` multipolygon NOT NULL,
`col1183` smallint(5) unsigned DEFAULT '0',
`col1184` set('vpsmm','fkvplpoka','w','','rbvf','eo','jkzqltuwxr','lrecudfbqu','vavlpzahrp','eohh','qejkmujh','cjzlavxc','','ikwpssgf','letlkvrsp','qyfljpxa','qp','mkcbja','thqebki','nujkvkf','vtxzmjlgo','','nd','arjde','ldwwtqkp','qsoirvqdw','wbt','ogkapaqufp','uhvt','hcsauh','ir','n','vvkrzeo','lwnjdf','nu','hpan','wlnzjzsga','qbcwovn','jq','uvlbss','fujjpomhwl','dh','cynydo','agsxn','yr','j','ncibl','pjoysiwi','urcf','eoovghfqfk','kbjp','ydzr','upqdnz','uywxzzib','fxlhfdvbf') CHARACTER SET greek NOT NULL,
`col1185` multipolygon NOT NULL,
`col1220` datetime NOT NULL DEFAULT '2012-12-16 11:54:39',
`col1221` bit(43) NOT NULL DEFAULT b'0',
`col1222` polygon DEFAULT NULL,
`col1223` point DEFAULT NULL,
`col1224` tinyblob NOT NULL,
`col1225` text CHARACTER SET koi8r NOT NULL,
`col1232` tinytext CHARACTER SET utf8 COLLATE utf8_slovenian_ci NOT NULL,
`col1233` polygon NOT NULL,
`col1238` datetime DEFAULT '2011-11-16 14:53:53',
`col1239` smallint(6) NOT NULL DEFAULT '411',
`col1240` point DEFAULT NULL,
`col1241` smallint(6) NOT NULL DEFAULT '0',
`col1242` bigint(20) unsigned DEFAULT '773',
`col1243` timestamp NOT NULL DEFAULT '2012-10-14 09:13:17',
`col1244` timestamp NOT NULL DEFAULT '2012-10-16 13:52:15',
`col1245` multilinestring NOT NULL,
`col1277` datetime NOT NULL DEFAULT '2013-05-16 00:28:37',
`col1278` mediumblob NOT NULL,
`col1279` date DEFAULT '2012-11-26',
`col1289` longblob NOT NULL,
`col1290` point DEFAULT NULL,
`col1291` polygon DEFAULT NULL,
`col1292` longblob NOT NULL,
`col1293` text CHARACTER SET cp1251 COLLATE cp1251_bulgarian_ci NOT NULL,
`col1297` longtext CHARACTER SET eucjpms NOT NULL,
`col1298` set('ofzme','qrylphnkc','pswxfu','jg','rtmee','','','oyej','veaob','dv','q','vez','tdvsvoif','zfngh','wh','rpbgkros','mhnlgqcwj','ggocf','','','vbbiva','','glpjccp','tulrg','dlstzgtvbf','xkeu','x','oqyullakt','unamtpyna','d','wgnyeaozz','radlqrm','vvyw','ybbbw','di','nzvvcs','jrrttwryw','fnjs','lliecdice','qijay','mjcdhmuulg','xr','o','jpesjwg','ckrlfmy') CHARACTER SET ucs2 COLLATE ucs2_persian_ci NOT NULL,
`col1299` datetime DEFAULT '2012-08-14 13:24:42',
`col1300` mediumblob NOT NULL,
`col1301` mediumblob NOT NULL,
`col1302` text CHARACTER SET utf8 COLLATE utf8_sinhala_ci NOT NULL,
`col1303` text CHARACTER SET koi8u NOT NULL,
`col1314` polygon NOT NULL,
`col1315` multilinestring NOT NULL,
`col1316` date NOT NULL DEFAULT '2012-01-17',
`col1317` multilinestring DEFAULT NULL,
`col1318` int(10) unsigned zerofill DEFAULT '0000000497',
`col1319` multipoint DEFAULT NULL,
`col1320` char(235) CHARACTER SET utf8 NOT NULL,
`col1321` double unsigned DEFAULT '260.5115',
`col1322` multipolygon NOT NULL,
`col1323` decimal(61,28) DEFAULT '0.0000000000000000000000000000',
`col1331` double NOT NULL DEFAULT '-1.5554463e71',
`col1332` timestamp NOT NULL DEFAULT '2013-05-17 16:29:07',
`col1333` multipoint NOT NULL,
`col1334` double NOT NULL DEFAULT '-716.6961',
`col1335` double unsigned zerofill NOT NULL DEFAULT '0000000000000000000000',
`col1336` longblob NOT NULL,
`col1337` smallint(5) unsigned DEFAULT '0',
`col1338` linestring DEFAULT NULL,
`col1340` multipoint NOT NULL,
`col1341` datetime NOT NULL DEFAULT '2012-03-21 03:00:47',
`col1342` polygon DEFAULT NULL,
`col1343` mediumint(9) DEFAULT '1474',
`col1344` mediumtext CHARACTER SET cp852 NOT NULL,
`col1345` set('','qrav','a','hupxrrqey','y','yxc','dtpt','cwdfnpu','pl','mlyod','jhncgf','','ilciog','apmzi','qkad','erlls','','trxvo','mtbhhqpz','gb','jk','cw','j','am','gxevz','jr','wknqndtz','i','ec','pbbq','hu','cmyot','ibgda','rqzqozrr','twmrwoysmg','pil','brm','b','wmiv','wceyfloxk','v','ekcvumegqg','','fndmgoxbs','ork','bmjppngd','vmhillbvwl','wmlzckw','','embrhxj','tcobqoeokw','syugqmcnem','goxoroemb','ktbhbzehq','cqveydcrdd','qaeqquhc','ycdqsajr') CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`col1346` mediumtext CHARACTER SET hp8 COLLATE hp8_bin NOT NULL,
`col1347` set('vohe','rxnxu','dzcmlze','tkmpozcucp','fbsmbrj','xq','ngepicomit','flznp','z','egtrkkwrzp','vc','oon','','ssrzfgtoy','oihvkh','ntxb','gygqhxf','o','nzg','rh','tbagjx','bsdn','tq','kltc','mie','djqouzpklm','iyhmfy','oiib','gtffz','afoo','t','dgbdmi','paywcr','','aw','','tbct','njbhlvohmx','jcluq','ffesb','gjtoyyp','unlistpv','pbxdcra','lihacyx','nzawy','nv','wwwds','lweonnf','evvam','','sdfabgdwb','nsj','neyyncn','md','','jqvlwyt') CHARACTER SET latin1 COLLATE latin1_spanish_ci NOT NULL,
`col1348` int(11) NOT NULL DEFAULT '0',
`col1349` time DEFAULT '15:28:30',
`col1350` geometry DEFAULT NULL,
`col1351` float unsigned NOT NULL DEFAULT '1429.64',
`col1352` binary(1) NOT NULL,
`col1359` tinytext CHARACTER SET utf8 COLLATE utf8_icelandic_ci NOT NULL,
`col1360` linestring DEFAULT NULL,
`col1361` datetime NOT NULL DEFAULT '2013-09-19 18:01:04',
`col1362` tinyint(1) NOT NULL DEFAULT '0',
`col1363` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_roman_ci NOT NULL,
`col1370` blob NOT NULL,
`col1371` polygon DEFAULT NULL,
`col1372` timestamp NOT NULL DEFAULT '2012-05-30 09:54:00',
`col1373` set('elff','edb','zmpxpiaaj','iixqfeun','dxbgb','jkuuvqdnan','ktddpvgotu','','kecyaieqn','','bqjvqdqs','ccevv','pwymcfljwn','fat','rqzf','','jtuoq','vtdzz','dvgg','x','rqgfqfadbq','xsdsxzj','wjtqumldr','byzno','qtuyhp','has','ibn','','cequ','ixbbovmhii','kedyrmqfs','xu','jzeibppzm','wdyt','aelpp','lgm','ejfuchkqz','','onblcyc','utrpyxenm','nfwcdmo','','wwxvy','wamsek','','veqwsr','t','oukdzrgzm','yejbtk','spwpzgg','nh','ixjnydlyzt','rksxkf','f','gixnou','pcohfohg','rgnnqcszb') CHARACTER SET euckr COLLATE euckr_bin NOT NULL,
UNIQUE KEY `idx4714` (`col1106`,`col596`(218),`col1185`(45),`col21`(154)) USING BTREE,
UNIQUE KEY `idx3509` (`col306`) USING BTREE,
UNIQUE KEY `idx271` (`col306`,`col28`,`col152`(203),`col757`,`col1350`(210)) USING HASH,
UNIQUE KEY `idx1257` (`col353`,`col40`(25),`col1290`(25),`col1302`(12),`col552`,`col412`(25),`col1289`(246),`col660`,`col147`) USING BTREE,
UNIQUE KEY `idx1260` (`col1114`(86),`col1020`(33),`col948`(5),`col230`,`col384`,`col1157`(124),`col1066`,`col1361`,`col1015`(146),`col1239`,`col1169`(206),`col302`(111),`col1107`,`col1184`,`col227`) USING HASH,
UNIQUE KEY `idx1410` (`col611`(25),`col153`,`col1164`(25),`col41`(165),`col43`),
UNIQUE KEY `idx1661` (`col1183`,`col657`,`col388`,`col1171`(41),`col671`(6),`col1291`(239),`col1064`,`col1079`,`col158`,`col1151`,`col599`,`col1350`(207),`col1178`,`col39`) USING BTREE,
UNIQUE KEY `idx2959` (`col606`(49),`col1298`,`col1349`,`col351`,`col663`(191),`col464`,`col1152`(24),`col1171`(127),`col1010`(94),`col1299`,`col230`) USING HASH,
UNIQUE KEY `idx3108` (`col22`,`col1063`,`col1290`(25),`col947`(2),`col288`,`col351`,`col373`(255),`col1029`(17),`col1332`,`col647`(104),`col1181`(75),`col177`(70),`col758`(41),`col1179`(174)) USING HASH,
UNIQUE KEY `idx3396` (`col226`(70),`col839`,`col1161`,`col303`(205),`col984`(25)) USING HASH,
UNIQUE KEY `idx3397` (`col840`,`col1021`,`col817`,`col289`,`col1361`,`col558`(51),`col1150`(65),`col395`,`col24`,`col1063`),
UNIQUE KEY `idx3511` (`col251`,`col1013`(93),`col190`,`col158`,`col1167`,`col896`(214),`col1278`(234),`col815`) USING BTREE,
UNIQUE KEY `idx3980` (`col1020`(230),`col1349`,`col947`(179),`col1240`(25),`col1148`,`col291`,`col42`,`col948`(4),`col899`,`col257`(60),`col222`(207),`col393`) USING HASH,
UNIQUE KEY `idx4041` (`col230`,`col191`,`col200`(205),`col609`,`col1154`(128),`col559`,`col28`,`col1149`,`col1337`,`col1359`(51),`col815`,`col1065`,`col1338`(213),`col1321`) USING HASH,
UNIQUE KEY `idx4257` (`col1371`(50),`col353`),
UNIQUE KEY `idx4374` (`col1337`,`col1113`(185),`col1319`(4),`col602`(42),`col816`(83),`col340`(161),`col1111`,`col608`(192),`col1223`(25),`col28`) USING BTREE,
UNIQUE KEY `idx4375` (`col130`,`col762`,`col1162`(115),`col398`(230),`col288`,`col1081`,`col673`,`col1029`(178),`col1033`) USING HASH,
UNIQUE KEY `idx5510` (`col398`(117),`col813`(25),`col1344`(24),`col38`(48),`col373`(189),`col393`,`col1068`,`col1298`,`col150`,`col965`,`col1162`(51),`col383`,`col606`(87)) USING HASH,
UNIQUE KEY `idx5654` (`col1351`,`col1321`,`col1081`,`col251`,`col1067`,`col1030`(244),`col896`(8),`col374`,`col196`,`col161`,`col211`(145),`col1079`,`col646`,`col757`),
KEY `idx270` (`col672`(25),`col1224`(252)),
KEY `idx356` (`col671`(158),`col1289`(211)) USING HASH,
KEY `idx752` (`col302`(186),`col1352`,`col179`(80),`col201`,`col1321`,`col658`(206),`col1279`,`col1151`),
KEY `idx753` (`col156`,`col302`(129),`col1069`(127),`col1220`) USING HASH,
KEY `idx1258` (`col558`(123),`col279`,`col984`(25),`col302`(46),`col662`(174),`col343`,`col257`(169),`col1069`(71),`col46`,`col607`,`col1079`,`col43`) USING HASH,
KEY `idx1259` (`col1071`,`col1223`(25),`col278`(216),`col133`) USING BTREE,
KEY `idx1261` (`col610`(97)) USING HASH,
KEY `idx1262` (`col411`) USING BTREE,
KEY `idx1263` (`col1349`,`col381`(59)) USING BTREE,
KEY `idx1411` (`col662`(38),`col386`(14),`col305`(63),`col158`,`col1165`) USING BTREE,
KEY `idx1574` (`col153`,`col1340`(30),`col896`(2),`col224`(27),`col1138`(218),`col44`,`col396`,`col1033`,`col841`,`col603`(196),`col307`,`col1337`,`col28`,`col425`),
KEY `idx1575` (`col291`,`col1079`,`col277`(148),`col1180`,`col1165`,`col195`,`col1338`(193),`col1157`(127),`col1222`(13),`col353`) USING HASH,
KEY `idx1576` (`col1155`,`col948`(1),`col1344`(244),`col43`,`col227`,`col393`,`col398`(101),`col553`(31)),
KEY `idx1992` (`col28`,`col133`,`col1343`,`col1289`(142),`col278`(1),`col252`(101),`col176`,`col592`,`col195`,`col1360`(16),`col896`(8),`col1290`(25),`col1320`(148)),
KEY `idx2581` (`col598`,`col1154`(120)) USING BTREE,
KEY `idx2582` (`col673`,`col1156`,`col1013`(200),`col36`(25),`col353`,`col366`(7),`col1346`(78),`col182`,`col24`,`col1010`(60),`col292`,`col27`,`col1172`,`col761`(73)),
KEY `idx2583` (`col1163`(18),`col758`(224),`col351`,`col663`(134)),
KEY `idx2584` (`col611`(25),`col181`,`col159`,`col663`(226),`col815`,`col195`,`col1345`,`col1021`,`col196`,`col255`(27),`col897`(192)) USING HASH,
KEY `idx2585` (`col660`,`col896`(113),`col1081`),
KEY `idx2647` (`col1163`(93),`col226`(171),`col229`,`col1111`,`col27`,`col221`,`col381`(38),`col605`(172)),
KEY `idx2648` (`col1343`,`col1009`(116),`col1110`,`col306`,`col1183`,`col1333`(126),`col1158`(59),`col839`,`col150`,`col1152`(6),`col224`(223),`col1063`,`col758`(54),`col230`) USING HASH,
KEY `idx2649` (`col1277`,`col398`(20),`col979`,`col1110`,`col22`,`col1183`,`col347`(235),`col835`),
KEY `idx2650` (`col1070`(106),`col609`,`col1067`,`col178`,`col1159`,`col1323`,`col227`) USING BTREE,
KEY `idx2958` (`col156`,`col561`(30),`col836`) USING HASH,
KEY `idx2960` (`col179`(84),`col1180`,`col104`,`col277`(2),`col1314`(126),`col1338`(237),`col279`,`col762`,`col222`(227)),
KEY `idx3109` (`col646`,`col659`(199),`col599`,`col1162`(7),`col594`,`col1110`,`col198`,`col669`,`col1068`) USING BTREE,
KEY `idx3110` (`col662`(128),`col1166`(111),`col1373`,`col1170`(224),`col147`,`col946`,`col148`(5)) USING BTREE,
KEY `idx3394` (`col1169`(49),`col1233`(96),`col1063`,`col1303`(91)) USING HASH,
KEY `idx3395` (`col1020`(199)) USING BTREE,
KEY `idx3508` (`col908`,`col1009`(1),`col594`,`col1176`,`col759`(3),`col1343`,`col1166`(25),`col1371`(89),`col841`,`col253`,`col42`) USING BTREE,
KEY `idx3510` (`col1244`,`col817`,`col465`(217),`col288`,`col252`(14),`col1110`,`col1160`(215),`col1318`) USING HASH,
KEY `idx3583` (`col948`(5),`col168`(53),`col1163`(5)) USING BTREE,
KEY `idx3926` (`col1344`(126),`col1291`(220),`col23`,`col348`(2),`col1244`,`col1016`(173),`col179`(247),`col761`(42),`col1177`(28),`col1148`) USING HASH,
KEY `idx3927` (`col366`(16),`col1108`,`col363`,`col415`(105),`col151`(234),`col817`,`col1321`,`col167`(90),`col344`(14),`col1070`(193),`col258`(98),`col1241`,`col1110`,`col92`(48)) USING BTREE,
KEY `idx3981` (`col1346`(179),`col412`(25),`col1019`(131),`col1113`(146),`col302`(116),`col1349`,`col591`(41),`col555`,`col229`,`col364`,`col303`(37)) USING HASH,
KEY `idx3982` (`col353`,`col201`,`col372`) USING HASH,
KEY `idx4040` (`col657`,`col158`,`col1344`(173)),
KEY `idx4256` (`col1112`,`col1323`,`col598`) USING BTREE,
KEY `idx4258` (`col1063`,`col92`(226),`col1348`) USING HASH,
KEY `idx4373` (`col816`(157),`col415`(28),`col251`),
KEY `idx4450` (`col559`,`col1068`,`col1080`(17),`col662`(120),`col1096`,`col1032`,`col23`,`col193`(249)) USING HASH,
KEY `idx4451` (`col840`,`col1151`,`col1290`(25),`col555`,`col553`(211),`col372`,`col1069`(211),`col1361`,`col1169`(90),`col394`,`col661`(249),`col1172`,`col1021`) USING BTREE,
KEY `idx4452` (`col291`,`col425`,`col1182`(134),`col840`,`col39`,`col1320`(33),`col558`(94)) USING HASH,
KEY `idx5655` (`col389`(12),`col1107`,`col1290`(25),`col1180`) USING HASH,
KEY `idx5656` (`col374`,`col1029`(107),`col306`,`col349`,`col239`(209),`col416`,`col382`(85),`col147`,`col42`,`col412`(25)) USING HASH
) ENGINE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=178017 MAX_ROWS=1000251 PACK_KEYS=0 DELAY_KEY_WRITE=1 ROW_FORMAT=COMPACT$$

alter database db default collate = 'utf8'$$
[<80000]alter database db upgrade data directory name$$
alter logfile group grp add undofile 'blah' initial_size 12345 wait engine = InnoDB$$
alter function func1 comment 'blah' language sql contains sql reads sql data no sql modifies sql data sql security invoker contains sql$$
alter procedure proc1 comment 'blah' language sql contains sql reads sql data no sql modifies sql data sql security invoker contains sql$$
alter server server1 options (host 'host', database 'database', user 'user', password 'pw', socket 'socket', owner 'owner', port 1234, user 'user')$$
[<50700]alter ignore table table1 discard tablespace$$
alter table table1 import tablespace$$
alter table table1 change column column1 column2 bit (5) column_format dynamic storage memory not null default now() key remove partitioning$$

alter tablespace space1 add datafile '/path/to/data' initial_size = 123 wait engine innodb$$
alter tablespace space2 drop datafile '/path/to/data' engine innodb$$
[<80000]alter tablespace space1 change datafile '/path/to/data' initial_size = 123$$
[<80000]alter tablespace test not accessible$$
[<80000]alter tablespace test read_write$$

alter definer = current_user () event event1 on schedule every a.b * 5 >> 1 week starts (select 1) + interval (15.2, 2) on completion preserve enable comment 'blah' do select @a := 1$$
alter algorithm = merge definer = 'abc'@`def` sql security invoker view view1 (a, b) as select (select a from b) as subselect with cascaded check option$$

create temporary table if not exists app_userprofile ( id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY , user_id INTEGER NOT NULL UNIQUE , pref_brew_type VARCHAR( 1 ) NOT NULL , pref_make_starter bool NOT NULL , pref_secondary_ferm bool NOT NULL , pref_dispensing_style VARCHAR( 1 ) NOT NULL , timezone VARCHAR( 1 ) NOT NULL ) $$
create table actor_copy (like sakial.actor)$$
create fulltext index index1 on sakila.actor(id(123)ASC,actor_id desc) with parser gulp key_block_size = 15$$
[<80011]create database if not exists sakila char set = default$$
create database if not exists sakila char set = binary$$
CREATE EVENT myevent ON SCHEDULE EVERY 6 HOUR COMMENT 'A sample comment.' DO UPDATE myschema.mytable SET mycol = mycol + 1$$
CREATE ALGORITHM = UNDEFINED DEFINER = `root`@`localhost` SQL SECURITY DEFINER VIEW `film_list` AS
  select `film`.`film_id` AS `FID`, `film`.`title` AS `title`, `film`.`description` AS `description`,
  `category`.`name` AS `category`, `film`.`rental_rate` AS `price`, `film`.`length` AS `length`,
  `film`.`rating` AS `rating`, group_concat(concat(`actor`.`first_name`, _utf8' ', `actor`.`last_name`)
  separator ', ') AS `actors` from ((((`category` left join `film_category` ON ((`category`.`category_id` = `film_category`.`category_id`)))
  left join `film` ON ((`film_category`.`film_id` = `film`.`film_id`))) join `film_actor` ON ((`film`.`film_id` = `film_actor`.`film_id`)))
  join `actor` ON ((`film_actor`.`actor_id` = `actor`.`actor_id`))) group by `film`.`film_id`$$
CREATE FUNCTION `inventory_held_by_customer`(p_inventory_id INT) RETURNS int(11) READS SQL DATA
  BEGIN DECLARE v_customer_id INT; DECLARE EXIT HANDLER FOR NOT FOUND RETURN NULL;
  SELECT customer_id INTO v_customer_id FROM rental WHERE return_date IS NULL AND inventory_id = 
  p_inventory_id; RETURN v_customer_id; END$$
create aggregate function udf1 returns real soname 'lib-name'$$
CREATE TRIGGER `upd_film` AFTER UPDATE ON `film` FOR EACH ROW BEGIN
  IF (old.title != new.title) or (old.description != new.description) THEN UPDATE film_text 
  SET title=new.title, `description`=new.description, film_id=new.film_id WHERE film_id=old.film_id;
  END IF; END$$
CREATE DEFINER=CURRENT_USER TRIGGER trigger1 BEFORE INSERT ON table1 FOR EACH ROW 
BEGIN 
  UPDATE table2 SET table2.type = 'translator' WHERE table2.profile_id = NEW.translator_id;
END$$
  
create logfile group group1 add undofile 'file' initial_size = 1G redo_buffer_size 20M wait, no_wait, engine InnoDB initial_size = 100M$$
create server 'server1' foreign data wrapper 'blah' options (host 'host', port 3306)$$
create tablespace space1 add datafile 'file1' use logfile group group1 autoextend_size = 1M no_wait, initial_size 10G$$

drop database if exists sakila$$
drop event actor.event1$$
drop function if exists sakila.get_customer_balance$$
drop procedure film_in_stock$$
drop index idx_fk_staff_id on sakila.payment$$
drop logfile group group1 wait wait wait, no_wait, no_wait, storage engine = InnoDB storage engine MyISAM$$
drop server if exists 'server1'$$
drop temporary tables if exists sakila.actor, sakila.city restrict$$
drop tablespace space1 wait$$
drop trigger if exists payment.payment_date$$
drop view sakila.film_list, actor_info cascade$$
  
rename tables a to b, c to d, sakila.actor to sakila.bctor$$

truncate sakila.film_text$$

call sakila.rewards_report ((select * from actor where actor_id = 1), 22, @a)$$

delete low_priority quick ignore from sakila.actor where actor_id = 1 order by actor_id limit 22$$
delete from sakila.city.*, payment.*, staff using { OJ (select * from actor a) as oneone inner join sakila.store as s on s.store_id = a.actor_id } where payment.payment_id = 1$$
[<80017]delete sakila.city.*, payment.*, staff from { one (select * from actor a) as oneone inner join sakila.store as s on s.store_id = a.actor_id } where payment.payment_id = 1$$

do (select 1 from city), @a := 1,  111 >> 222 and 333$$

handler .id1 open as b$$
handler id2 close$$
handler id3 read first$$
handler id3 read id4 prev where actor_id = 1 limit 1,1$$
handler id4 read id5 <= (123, default, (select 1)) limit 10$$

insert into .actor set actor_id = 1, first_name = 'Arnold', last_name = 'Schwarzenegger'$$
insert low_priority ignore into .city (city_id, city, country_id) values (1, 'Munich', 2)$$
insert staff (staff_id, address_id, active) (select staff_id, address_id, active from staff where staff_id < 5) union (select staff_id, address_id, active from staff where staff_id > 10)$$
insert .order (a.order.*) values (1)$$
insert .order (a.order.select) values (1)$$
insert .order (a.*) values (1)$$

load data concurrent local infile 'filename' ignore into table city charset binary columns terminated by '\\t' lines starting by 'blah' ignore 20 lines (actor.actor_id, @x) set actor_id = 1, a = (select 1)$$
load xml concurrent local infile 'filename' ignore into table city charset binary rows identified by 'starting' columns terminated by '\\t' lines starting by 'blah' ignore 20 lines (actor.actor_id, @x)$$

replace delayed into language (language_id, name) values (1, 'Esperanto')$$
replace staff (staff_id, address_id, active) (select staff_id, address_id, active from staff where staff_id < 5) union (select staff_id, address_id, active from staff where staff_id > 10)$$

update ignore { OJ actor a straight_join city c on a.actor_id = city.city_id} set c.city = 'blah', a.last_update = default$$

start transaction with consistent snapshot$$
commit work and no chain release$$
savepoint blah$$
release savepoint blah$$
lock tables sakila.actor a read local, payment write$$
unlock tables$$
xa start '123456789' resume$$
xa commit '1'$$
xa recover$$

purge binary logs to 'blah'$$
purge master logs before (select * from customer)$$
change master to master_bind = 'blah', relay_log_pos = 1, ignore_server_ids = (1, 2, 3, 4)$$
start slave relay_thread, sql_thread, sql_thread until master_log_pos = 42 user = 'mike'$$
stop slave relay_thread, sql_thread$$

prepare s1 from 'select * from customer'$$
prepare s2 from @select_var$$
execute s1 using @'blah', @blah$$
deallocate prepare s1$$

drop user current_user(), 'mike'@localhost$$
[<80011]grant insert (a, b, c), references (d, e, f) on function *.* to mike@'localhost', friends@`anyhost` require CIPHER '12345' ISSUER 'me' with max_queries_per_hour 10000 grant option$$
grant insert (a, b, c), references (d, e, f) on function *.* to mike@'localhost', friends@`anyhost`$$
rename user mike to ekim, ekim to mike, me to myself$$
revoke all privileges, grant option from mike$$
revoke insert (a, b, c), references (d, e, f) on sakily.* from mike, alex, alfredo, rene, sergio, carlos$$
[<80014]set password for mike := password('blah')$$
[>=80014]set password for mike := 'blah'$$

analyze no_write_to_binlog table sakila.city, customer, film$$
check table sakila.actor, sakila.country for upgrade$$
checksum table customer extended$$
optimize table payment$$
repair local table category, film_actor, film_category quick$$

install plugin soname soname 'plugin'$$
uninstall plugin owner$$

set global transaction isolation level repeatable read$$
set global names := (32, 1 << 20, brother or sister, (select * from actor)), session default.blah = ON$$

show collation like 'blah'$$
show full columns from customer in sakila where customer_id in (1, 2, 3)$$

binlog 'blah'$$
[<80000]flush local des_key_file, hosts, binary logs$$
flush local hosts, binary logs$$
cache index actor partition (all) index (idx_actor_last_name, primary, primary) in sakila$$
cache index actor index (idx_actor_last_name, primary, primary), category key (primary) in default$$
kill query 1$$
load index into cache inventory$$
[<80000]reset master, query cache, slave$$
reset master, slave$$

describe sakila.inventory store_id$$
[<80000]explain extended replace staff (staff_id, address_id, active) (select staff_id, address_id, active from staff where staff_id < 5) union (select staff_id, address_id, active from staff where staff_id > 10)$$
[>=80000]explain replace staff (staff_id, address_id, active) (select staff_id, address_id, active from staff where staff_id < 5) union (select staff_id, address_id, active from staff where staff_id > 10)$$
help 'me'$$
use less$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `migrate_PressingsFormatsFromAlbums`(
IN pressingID INT(10),
IN pFormat VARCHAR(255))
BEGIN

IF pFormat = '' THEN SELECT NULL;
ELSEIF pformat = '7' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
ELSEIF pformat = '10"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 13);
ELSEIF pformat = '10" EP' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 13);
ELSEIF pformat = '10" flexi' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 14);
ELSEIF pformat = '12"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 17);
ELSEIF pformat = '12" ' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 17);
ELSEIF pformat = '12" EP' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 17);
ELSEIF pformat = '12"+2x7"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 39);
ELSEIF pformat = '2x12"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 18);
ELSEIF pformat = '2x7"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 6);
ELSEIF pformat = '2xCD' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 24);
ELSEIF pformat = '2xCDR' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 28);
ELSEIF pformat = '2xLP' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 30);
ELSEIF pformat = '2xtape' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, '2 x Tape', 39);
ELSEIF pformat = '3x7"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, '3 x 7"', 39);
ELSEIF pformat = '3xCD' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 25);
ELSEIF pformat = '3xLP' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, '3 x LP', 39);
ELSEIF pformat = '3xtape' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, '3 x Tape', 39);
ELSEIF pformat = '4x7"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, '4 x 7"', 39);
ELSEIF pformat = '4xCD' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, '4 x CD', 39);
ELSEIF pformat = '4xCD box set' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, '4 x CD', 39);
ELSEIF pformat = '5"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 1);
ELSEIF pformat = '5" flexi' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 2);
ELSEIF pformat = '5x7"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, '4 x 7"', 39);
ELSEIF pformat = '5x7" flexi' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, '5 x 7" flexi', 39);
ELSEIF pformat = '5xCD' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, '5 x CD', 39);
ELSEIF pformat = '5xCD box set' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, '5 x CD', 39);
ELSEIF pformat = '6" EP' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 3);
ELSEIF pformat = '6" flexi' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 4);
ELSEIF pformat = '6xLP' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, '6 x LP', 39);
ELSEIF pformat = '7"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
ELSEIF pformat = '7" ' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
ELSEIF pformat = '7" + 7" flexi' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 8);
ELSEIF pformat = '7" EP' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
ELSEIF pformat = '7" EP ' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
ELSEIF pformat = '7" EP + 7" flexi' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 8);
ELSEIF pformat = '7" EP+7" flexi' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 8);
ELSEIF pformat = '7" flexi' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 7);
ELSEIF pformat = '7" flexi ' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 7);
ELSEIF pformat = '7" flexi EP' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 7);
ELSEIF pformat = '7""' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
ELSEIF pformat = '7"+7" flexi' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 8);
ELSEIF pformat = '7"aaa' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
ELSEIF pformat = '7aaa' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
ELSEIF pformat = '7aaaaaa' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
ELSEIF pformat = '7x7"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, '7 x 7"', 39);
ELSEIF pformat = '8"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 10);
ELSEIF pformat = '8" EP' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 10);
ELSEIF pformat = '8" flexi' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 11);
ELSEIF pformat = 'CD' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = 'CD ' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = 'CD EP' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = 'CD single' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = 'CD-R' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 27);
ELSEIF pformat = 'CD+DVD' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 26);
ELSEIF pformat = 'CD5' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = 'CDEP' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = 'CDR' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 27);
ELSEIF pformat = 'demo' THEN SELECT pressingID, pformat;
ELSEIF pformat = 'demo tape' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 37);
ELSEIF pformat = 'EP' THEN SELECT pressingID, pformat;
ELSEIF pformat = 'LP' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 29);
ELSEIF pformat = 'LP ' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 29);
ELSEIF pformat = 'LP + 7" flexi' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 32);
ELSEIF pformat = 'LP+12"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, 'LP + 12"', 39);
ELSEIF pformat = 'LP+7"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 31);
ELSEIF pformat = 'LP+7" EP' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 31);
ELSEIF pformat = 'LP+7" flexi' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 32);
ELSEIF pformat = 'LP+7" flexi ' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 32);
ELSEIF pformat = 'split 10"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 13);
ELSEIF pformat = 'split 12"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 17);
ELSEIF pformat = 'split 12" EP' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 17);
ELSEIF pformat = 'split 2x7"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 6);
ELSEIF pformat = 'split 7"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
ELSEIF pformat = 'split 7" EP' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
ELSEIF pformat = 'split 7" flexi' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 7);
ELSEIF pformat = 'split 8"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 10);
ELSEIF pformat = 'split 8" flexi' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 11);
ELSEIF pformat = 'split CD' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = 'split LP' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 29);
ELSEIF pformat = 'split tape' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 37);
ELSEIF pformat = 'tape' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 37);
ELSEIF pformat = 'tape ' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 37);
ELSEIF pformat = 'unreleased 12"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 17);
ELSEIF pformat = 'unreleased 7"' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
ELSEIF pformat = 'unreleased 7" EP' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
ELSEIF pformat = 'unreleased album' THEN SELECT pressingID, pformat;
ELSEIF pformat = 'unreleased EP' THEN SELECT pressingID, pformat;
ELSEIF pformat = 'unreleased LP' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 29);
ELSEIF pformat = 'unreleased split LP' THEN INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 29);
ELSEIF pformat = '7"/10"' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 13);
ELSEIF pformat = '7"/10"/12"' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 13);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 17);
ELSEIF pformat = '7"/10"/12"/CD' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 13);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 17);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = '7"/10"/CD' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 13);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = '7"/12" ' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 17);
ELSEIF pformat = '7"/12"' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 17);
ELSEIF pformat = '7"/12" EP' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 17);
ELSEIF pformat = '7"/12"/CD' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 17);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = '7"/12"/CDEP' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 17);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = '7"/2x7"' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 6);
ELSEIF pformat = '7"/2x7"/10"/12"' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 6);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 17);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 13);
ELSEIF pformat = '7"/2x7"/12"' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 6);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 17);
ELSEIF pformat = '7"/CD' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = '7"/CDEP' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = 'CD/LP' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 29);
ELSEIF pformat = 'CD/tape' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 37);
ELSEIF pformat = 'LP/4x7"/CD' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 29);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, '4 x 7"', 39);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = 'LP/CD ' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 29);
ELSEIF pformat = 'LP/CD' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 29);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = 'LP/CD/tape' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 29);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 37);
ELSEIF pformat = 'LP/tape' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 29);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 37);
ELSEIF pformat = '10"/12"' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 13);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 17);
ELSEIF pformat = '10"/CD' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 13);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = '12"/CD' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 17);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = '12"/CD EP' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 17);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = '2x7"/CD' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 6);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = '2xLP/2xCD' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 30);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 24);
ELSEIF pformat = '2xLP/CD' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 30);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = '5x7"/LP' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, '5 x 7"', 39);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 29);
ELSEIF pformat = '2x12"/CD' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 18);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = '7" EP/10" EP' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 3);
ELSEIF pformat = '7" EP/CD' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = '7" EP/CDEP' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = '7" EP/tape' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 5);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 37);
ELSEIF pformat = 'LP+7"/2xCD' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 31);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 24);
ELSEIF pformat = 'LP+7"/CD' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 31);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = '12" EP/CD' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 17);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSEIF pformat = 'split LP/CD' THEN
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 29);
INSERT INTO kfth.pressing_formats (PressingId, Other, FormatsId) VALUES (pressingID, NULL, 23);
ELSE SELECT pressingId, pFormat;
END IF;
END$$
--
ALTER TABLE `SMaLLCallUps`
  ADD CONSTRAINT `FK_CallUps_ForGameID_Games` FOREIGN KEY (`ForGameID`) REFERENCES `SMaLLGames` (`id`),
  ADD CONSTRAINT `FK_CallUps_ForTeamID_Teams` FOREIGN KEY (`ForTeamID`) REFERENCES `SMaLLTeams` (`id`),
  ADD CONSTRAINT `FK_CallUps_FromTeamID_Teams` FOREIGN KEY (`FromTeamID`) REFERENCES `SMaLLTeams` (`id`),
  ADD CONSTRAINT `FK_CallUps_PlayerID_Players` FOREIGN KEY (`PlayerID`) REFERENCES `SMaLLPlayers` (`id`)$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `create_synonym_db`(
        IN in_db_name VARCHAR(64), 
        IN in_synonym VARCHAR(64)
    )
    MODIFIES SQL DATA
    SQL SECURITY INVOKER
    COMMENT '\n             Description\n             -----------\n\n             Takes a source database name and synonym name, and then creates the \n             synonym database with views that point to all of the tables within\n             the source database.\n\n             Useful for creating a "ps" synonym for "performance_schema",\n             or "is" instead of "information_schema", for example.\n\n             Parameters\n             -----------\n\n             in_db_name (VARCHAR(64)):\n               The database name that you would like to create a synonym for.\n             in_synonym (VARCHAR(64)):\n               The database synonym name.\n\n             Example\n             -----------\n\n             mysql> SHOW DATABASES;\n             +--------------------+\n             | Database           |\n             +--------------------+\n             | information_schema |\n             | mysql              |\n             | performance_schema |\n             | sys                |\n             | test               |\n             +--------------------+\n             5 rows in set (0.00 sec)\n\n             mysql> CALL sys.create_synonym_db(''performance_schema'', ''ps'');\n             +-------------------------------------+\n             | summary                             |\n             +-------------------------------------+\n             | Created 74 views in the ps database |\n             +-------------------------------------+\n             1 row in set (8.57 sec)\n\n             Query OK, 0 rows affected (8.57 sec)\n\n             mysql> SHOW DATABASES;\n             +--------------------+\n             | Database           |\n             +--------------------+\n             | information_schema |\n             | mysql              |\n             | performance_schema |\n             | ps                 |\n             | sys                |\n             | test               |\n             +--------------------+\n             6 rows in set (0.00 sec)\n\n             mysql> SHOW FULL TABLES FROM ps;\n             +------------------------------------------------------+------------+\n             | Tables_in_ps                                         | Table_type |\n             +------------------------------------------------------+------------+\n             | accounts                                             | VIEW       |\n             | cond_instances                                       | VIEW       |\n             | events_stages_current                                | VIEW       |\n             | events_stages_history                                | VIEW       |\n             ...\n            '
BEGIN
    DECLARE v_done bool DEFAULT FALSE;
    DECLARE v_db_name_check VARCHAR(64);
    DECLARE v_db_err_msg TEXT;
    DECLARE v_table VARCHAR(64);
    DECLARE v_views_created INT DEFAULT 0;

    DECLARE db_doesnt_exist CONDITION FOR SQLSTATE '42000';
    DECLARE db_name_exists CONDITION FOR SQLSTATE 'HY000';

    DECLARE c_table_names CURSOR FOR 
        SELECT TABLE_NAME 
          FROM INFORMATION_SCHEMA.TABLES 
         WHERE TABLE_SCHEMA = in_db_name;

    DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;


    SELECT SCHEMA_NAME INTO v_db_name_check
      FROM INFORMATION_SCHEMA.SCHEMATA
     WHERE SCHEMA_NAME = in_db_name;

    IF v_db_name_check IS NULL THEN
        SET v_db_err_msg = CONCAT('Unknown database ', in_db_name);
        SIGNAL SQLSTATE 'HY000'
            SET MESSAGE_TEXT = v_db_err_msg;
    END IF;


    SELECT SCHEMA_NAME INTO v_db_name_check
      FROM INFORMATION_SCHEMA.SCHEMATA
     WHERE SCHEMA_NAME = in_synonym;

    IF v_db_name_check = in_synonym THEN
        SET v_db_err_msg = CONCAT('Can\'t create database ', in_synonym, '; database exists');
        SIGNAL SQLSTATE 'HY000'
            SET MESSAGE_TEXT = v_db_err_msg;
    END IF;


    SET @create_db_stmt := CONCAT('CREATE DATABASE ', in_synonym);
    PREPARE create_db_stmt FROM @create_db_stmt;
    EXECUTE create_db_stmt;
    DEALLOCATE PREPARE create_db_stmt;

    SET v_done = FALSE;
    OPEN c_table_names;
    c_table_names: LOOP
        FETCH c_table_names INTO v_table;
        IF v_done THEN
            LEAVE c_table_names;
        END IF;

        SET @create_view_stmt = CONCAT('CREATE SQL SECURITY INVOKER VIEW ', in_synonym, '.', v_table, ' AS SELECT * FROM ', in_db_name, '.', v_table);
        PREPARE create_view_stmt FROM @create_view_stmt;
        EXECUTE create_view_stmt;
        DEALLOCATE PREPARE create_view_stmt;

        SET v_views_created = v_views_created + 1;
    END LOOP;
    CLOSE c_table_names;

    SELECT CONCAT('Created ', v_views_created, ' view', IF(v_views_created != 1, 's', ''), ' in the ', in_synonym, ' database') AS summary;

END$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `ps_setup_reload_saved`()
    MODIFIES SQL DATA
    SQL SECURITY INVOKER
    COMMENT '\n             Description\n             -----------\n\n             Reloads a saved Performance Schema configuration,\n             so that you can alter the setup for debugging purposes, \n             but restore it to a previous state.\n             \n             Use the companion procedure - ps_setup_save(), to \n             save a configuration.\n\n             Requires the SUPER privilege for "SET sql_log_bin = 0;".\n\n             Parameters\n             -----------\n\n             None.\n\n             Example\n             -----------\n\n             mysql> CALL sys.ps_setup_save();\n             Query OK, 0 rows affected (0.08 sec)\n\n             mysql> UPDATE performance_schema.setup_instruments SET enabled = ''YES'', timed = ''YES'';\n             Query OK, 547 rows affected (0.40 sec)\n             Rows matched: 784  Changed: 547  Warnings: 0\n\n             /* Run some tests that need more detailed instrumentation here */\n\n             mysql> CALL sys.ps_setup_reload_saved();\n             Query OK, 0 rows affected (0.32 sec)\n            '
BEGIN
    DECLARE v_done bool DEFAULT FALSE;
    DECLARE v_lock_result INT;
    DECLARE v_lock_used_by BIGINT;
    DECLARE v_signal_message TEXT;
    DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
        SIGNAL SQLSTATE VALUE '90001'
           SET MESSAGE_TEXT = 'An error occurred, was sys.ps_setup_save() run before this procedure?';
    END;

    SET @log_bin := @@sql_log_bin;
    SET sql_log_bin = 0;

    SELECT IS_USED_LOCK('sys.ps_setup_save') INTO v_lock_used_by;

    IF (v_lock_used_by != CONNECTION_ID()) THEN
        SET v_signal_message = CONCAT('The sys.ps_setup_save lock is currently owned by ', v_lock_used_by);
        SIGNAL SQLSTATE VALUE '90002'
           SET MESSAGE_TEXT = v_signal_message;
    END IF;

    DELETE FROM performance_schema.setup_actors;
    INSERT INTO performance_schema.setup_actors SELECT * FROM tmp_setup_actors;

    BEGIN
        
        DECLARE v_name varchar(64);
        DECLARE v_enabled enum('YES', 'NO');
        DECLARE c_consumers CURSOR FOR SELECT NAME, ENABLED FROM tmp_setup_consumers;
        DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;

        SET v_done = FALSE;
        OPEN c_consumers;
        c_consumers_loop: LOOP
            FETCH c_consumers INTO v_name, v_enabled;
            IF v_done THEN
               LEAVE c_consumers_loop;
            END IF;

            UPDATE performance_schema.setup_consumers
               SET ENABLED = v_enabled
             WHERE NAME = v_name;
         END LOOP;
         CLOSE c_consumers;
    END;

    UPDATE performance_schema.setup_instruments
     INNER JOIN tmp_setup_instruments USING (NAME)
       SET performance_schema.setup_instruments.ENABLED = tmp_setup_instruments.ENABLED,
           performance_schema.setup_instruments.TIMED   = tmp_setup_instruments.TIMED;
    BEGIN
        
        DECLARE v_thread_id bigint unsigned;
        DECLARE v_instrumented enum('YES', 'NO');
        DECLARE c_threads CURSOR FOR SELECT THREAD_ID, INSTRUMENTED FROM tmp_threads;
        DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE;

        SET v_done = FALSE;
        OPEN c_threads;
        c_threads_loop: LOOP
            FETCH c_threads INTO v_thread_id, v_instrumented;
            IF v_done THEN
               LEAVE c_threads_loop;
            END IF;

            UPDATE performance_schema.threads
               SET INSTRUMENTED = v_instrumented
             WHERE THREAD_ID = v_thread_id;
        END LOOP;
        CLOSE c_threads;
    END;

    UPDATE performance_schema.threads
       SET INSTRUMENTED = IF(PROCESSLIST_USER IS NOT NULL,
                             sys.ps_is_account_enabled(PROCESSLIST_HOST, PROCESSLIST_USER),
                             'YES')
     WHERE THREAD_ID NOT IN (SELECT THREAD_ID FROM tmp_threads);

    DROP TEMPORARY TABLE tmp_setup_actors;
    DROP TEMPORARY TABLE tmp_setup_consumers;
    DROP TEMPORARY TABLE tmp_setup_instruments;
    DROP TEMPORARY TABLE tmp_threads;

    SELECT RELEASE_LOCK('sys.ps_setup_save') INTO v_lock_result;

    SET sql_log_bin = @log_bin; 
END$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `ps_trace_statement_digest`(
        IN in_digest VARCHAR(32),
        IN in_runtime INT, 
        IN in_interval DECIMAL(2,2),
        IN in_start_fresh BOOLEAN,
        IN in_auto_enable BOOLEAN
    )
    MODIFIES SQL DATA
    SQL SECURITY INVOKER
    COMMENT '\n             Description\n             -----------\n\n             Traces all instrumentation within Performance Schema for a specific\n             Statement Digest. \n\n             When finding a statement of interest within the \n             performance_schema.events_statements_summary_by_digest table, feed\n             the DIGEST MD5 value in to this procedure, set how long to poll for, \n             and at what interval to poll, and it will generate a report of all \n             statistics tracked within Performance Schema for that digest for the\n             interval.\n\n             It will also attempt to generate an EXPLAIN for the longest running \n             example of the digest during the interval. Note this may fail, as\n             Performance Schema truncates long SQL_TEXT values (and hence the \n             EXPLAIN will fail due to parse errors).\n\n             Parameters\n             -----------\n\n             in_digest (VARCHAR(32)):\n               The statement digest identifier you would like to analyze\n             in_runtime (INT):\n               The number of seconds to run analysis for (defaults to a minute)\n             in_interval (DECIMAL(2,2)):\n               The interval (in seconds, may be fractional) at which to try\n               and take snapshots (defaults to a second)\n             in_start_fresh (BOOLEAN):\n               Whether to TRUNCATE the events_statements_history_long and\n               events_stages_history_long tables before starting (default false)\n             in_auto_enable (BOOLEAN):\n               Whether to automatically turn on required consumers (default false)\n\n             Example\n             -----------\n\n             mysql> call ps_analyze_statement_digest(''891ec6860f98ba46d89dd20b0c03652c'', 10, 0.1, true, true);\n             +--------------------+\n             | SUMMARY STATISTICS |\n             +--------------------+\n             | SUMMARY STATISTICS |\n             +--------------------+\n             1 row in set (9.11 sec)\n\n             +------------+-----------+-----------+-----------+---------------+------------+------------+\n             | executions | exec_time | lock_time | rows_sent | rows_examined | tmp_tables | full_scans |\n             +------------+-----------+-----------+-----------+---------------+------------+------------+\n             |         21 | 4.11 ms   | 2.00 ms   |         0 |            21 |          0 |          0 |\n             +------------+-----------+-----------+-----------+---------------+------------+------------+\n             1 row in set (9.11 sec)\n\n             +------------------------------------------+-------+-----------+\n             | event_name                               | count | latency   |\n             +------------------------------------------+-------+-----------+\n             | stage/sql/checking query cache for query |    16 | 724.37 µs |\n             | stage/sql/statistics                     |    16 | 546.92 µs |\n             | stage/sql/freeing items                  |    18 | 520.11 µs |\n             | stage/sql/init                           |    51 | 466.80 µs |\n             ...\n             | stage/sql/cleaning up                    |    18 | 11.92 µs  |\n             | stage/sql/executing                      |    16 | 6.95 µs   |\n             +------------------------------------------+-------+-----------+\n             17 rows in set (9.12 sec)\n\n             +---------------------------+\n             | LONGEST RUNNING STATEMENT |\n             +---------------------------+\n             | LONGEST RUNNING STATEMENT |\n             +---------------------------+\n             1 row in set (9.16 sec)\n             \n             +-----------+-----------+-----------+-----------+---------------+------------+-----------+\n             | thread_id | exec_time | lock_time | rows_sent | rows_examined | tmp_tables | full_scan |\n             +-----------+-----------+-----------+-----------+---------------+------------+-----------+\n             |    166646 | 618.43 µs | 1.00 ms   |         0 |             1 |          0 |         0 |\n             +-----------+-----------+-----------+-----------+---------------+------------+-----------+\n             1 row in set (9.16 sec)\n\n             // Truncated for clarity...\n             +-----------------------------------------------------------------+\n             | sql_text                                                        |\n             +-----------------------------------------------------------------+\n             | select hibeventhe0_.id as id1382_, hibeventhe0_.createdTime ... |\n             +-----------------------------------------------------------------+\n             1 row in set (9.17 sec)\n\n             +------------------------------------------+-----------+\n             | event_name                               | latency   |\n             +------------------------------------------+-----------+\n             | stage/sql/init                           | 8.61 µs   |\n             | stage/sql/Waiting for query cache lock   | 453.23 µs |\n             | stage/sql/init                           | 331.07 ns |\n             | stage/sql/checking query cache for query | 43.04 µs  |\n             ...\n             | stage/sql/freeing items                  | 30.46 µs  |\n             | stage/sql/cleaning up                    | 662.13 ns |\n             +------------------------------------------+-----------+\n             18 rows in set (9.23 sec)\n\n             +----+-------------+--------------+-------+---------------+-----------+---------+-------------+------+-------+\n             | id | select_type | table        | type  | possible_keys | key       | key_len | ref         | rows | Extra |\n             +----+-------------+--------------+-------+---------------+-----------+---------+-------------+------+-------+\n             |  1 | SIMPLE      | hibeventhe0_ | const | fixedTime     | fixedTime | 775     | const,const |    1 | NULL  |\n             +----+-------------+--------------+-------+---------------+-----------+---------+-------------+------+-------+\n             1 row in set (9.27 sec)\n\n             Query OK, 0 rows affected (9.28 sec)\n            '
BEGIN

    DECLARE v_start_fresh BOOLEAN DEFAULT false;
    DECLARE v_auto_enable BOOLEAN DEFAULT false;
    DECLARE v_runtime INT DEFAULT 0;
    DECLARE v_start INT DEFAULT 0;
    DECLARE v_found_stmts INT;

    
    CALL sys.ps_setup_disable_thread(CONNECTION_ID());

    DROP TEMPORARY TABLE IF EXISTS stmt_trace;
    CREATE TEMPORARY TABLE stmt_trace (
        thread_id BIGINT,
        timer_start BIGINT,
        event_id BIGINT,
        sql_text longtext,
        timer_wait BIGINT,
        lock_time BIGINT,
        errors BIGINT,
        mysql_errno BIGINT,
        rows_sent BIGINT,
        rows_affected BIGINT,
        rows_examined BIGINT,
        created_tmp_tables BIGINT,
        created_tmp_disk_tables BIGINT,
        no_index_used BIGINT,
        PRIMARY KEY (thread_id, timer_start)
    );

    DROP TEMPORARY TABLE IF EXISTS stmt_stages;
    CREATE TEMPORARY TABLE stmt_stages (
       event_id BIGINT,
       stmt_id BIGINT,
       event_name VARCHAR(128),
       timer_wait BIGINT,
       PRIMARY KEY (event_id)
    );

    SET v_start_fresh = in_start_fresh;
    IF v_start_fresh THEN
        TRUNCATE TABLE performance_schema.events_statements_history_long;
        TRUNCATE TABLE performance_schema.events_stages_history_long;
    END IF;

    SET v_auto_enable = in_auto_enable;
    IF v_auto_enable THEN
        CALL sys.ps_setup_save(0);
    END IF;

    WHILE v_runtime < in_runtime DO
        SELECT UNIX_TIMESTAMP() INTO v_start;

        INSERT IGNORE INTO stmt_trace
        SELECT thread_id, timer_start, event_id, sql_text, timer_wait, lock_time, errors, mysql_errno, 
               rows_sent, rows_affected, rows_examined, created_tmp_tables, created_tmp_disk_tables, no_index_used
          FROM performance_schema.events_statements_history_long
        WHERE digest = in_digest;

        INSERT IGNORE INTO stmt_stages
        SELECT stages.event_id, stmt_trace.event_id,
               stages.event_name, stages.timer_wait
          FROM performance_schema.events_stages_history_long AS stages
          JOIN stmt_trace ON stages.nesting_event_id = stmt_trace.event_id;

        SELECT SLEEP(in_interval) INTO @sleep;
        SET v_runtime = v_runtime + (UNIX_TIMESTAMP() - v_start);
    END WHILE;

    SELECT "SUMMARY STATISTICS";

    SELECT COUNT(*) executions,
           sys.format_time(SUM(timer_wait)) AS exec_time,
           sys.format_time(SUM(lock_time)) AS lock_time,
           SUM(rows_sent) AS rows_sent,
           SUM(rows_affected) AS rows_affected,
           SUM(rows_examined) AS rows_examined,
           SUM(created_tmp_tables) AS tmp_tables,
           SUM(no_index_used) AS full_scans
      FROM stmt_trace;

    SELECT event_name,
           COUNT(*) as count,
           sys.format_time(SUM(timer_wait)) as latency
      FROM stmt_stages
     GROUP BY event_name
     ORDER BY SUM(timer_wait) DESC;

    SELECT "LONGEST RUNNING STATEMENT";

    SELECT thread_id,
           sys.format_time(timer_wait) AS exec_time,
           sys.format_time(lock_time) AS lock_time,
           rows_sent,
           rows_affected,
           rows_examined,
           created_tmp_tables AS tmp_tables,
           no_index_used AS full_scan
      FROM stmt_trace
     ORDER BY timer_wait DESC LIMIT 1;

    SELECT sql_text
      FROM stmt_trace
     ORDER BY timer_wait DESC LIMIT 1;

    SELECT sql_text, event_id INTO @sql, @sql_id
      FROM stmt_trace
    ORDER BY timer_wait DESC LIMIT 1;

    SELECT event_name,
           sys.format_time(timer_wait) as latency
      FROM stmt_stages
     WHERE stmt_id = @sql_id
     ORDER BY event_id;

    DROP TEMPORARY TABLE stmt_trace;
    DROP TEMPORARY TABLE stmt_stages;

    SET @stmt := CONCAT("EXPLAIN FORMAT=JSON", @sql);
    PREPARE explain_stmt FROM @stmt;
    EXECUTE explain_stmt;
    DEALLOCATE PREPARE explain_stmt;

    IF v_auto_enable THEN
        CALL sys.ps_reload_saved();
        CALL sys.ps_setup_enable_thread(CONNECTION_ID());
    END IF;

END$$
xa recover /*!50704 convert xid */$$
[<50708]select /*!50704 max_statement_time = 1*/ *, x.a, b, xxx.c from x xxx$$
CREATE DEFINER=`forex`@`%` PROCEDURE `set_next_minute`()
BEGIN
    SET @next_minute = (
        SELECT FLOOR(timestamp/60000) * 60
        FROM tick t 
        WHERE timestamp > (
            (SELECT value 
            FROM setting 
            WHERE name = 'next_minute')
            + 60) * 1000 
        ORDER BY timestamp 
        LIMIT 1);
    UPDATE setting 
    SET value = @next_minute 
    WHERE name = 'next_minute';
END$$
CREATE PROCEDURE `new_procedure` ()
BEGIN
DECLARE a INT;
SET @b = 1;
select col1 as x into @b,a from tab LIMIT 1;
END$$
CREATE FUNCTION `ufn_gettotalavg` (pUserID bigint,pclass bigint) RETURNS int(11)
BEGIN
  DECLARE learnavg BIGINT;
  DECLARE Assesavg BIGINT;
  DECLARE Pratiecavg BIGINT;
  DROP TABLE IF EXISTS AvgTemp;
  CREATE TEMPORARY TABLE IF NOT EXISTS AvgTemp (SType varchar(20),Percentage bigint);
  DROP TABLE IF EXISTS  assesTemp;
  CREATE TEMPORARY TABLE IF NOT EXISTS assesTemp AS (SELECT  COALESCE(ROUND(((SELECT uf_GetTotalScoreByAssessment( AssessmentID,pUserID,1)) /
  (SELECT ufn_getMaxMarks( AssessmentID))) * 100),0) AS Percentage FROM tr_t_assessments where AssessmentType='LiveTest');
  SET Assesavg= (SELECT COALESCE(round(AVG(Percentage)),0) FROM assesTemp);
  DROP TABLE IF EXISTS  learnTemp;
  CREATE TEMPORARY TABLE IF NOT EXISTS   learnTemp AS (SELECT IFNULL(ROUND((SELECT count(MaterialID) FROM tr_t_materialtracking 
  where MaterialStatus=1 and UserID=pUserID and SubjectID = S.SubjectID and MaterialID in 
  (SELECT MaterialID FROM tr_m_material where ClassID=pclass and SubjectID = S.SubjectID)) /
  (SELECT COUNT(TopicID) FROM tr_m_material where TopicID IN 
  (SELECT TopicID FROM tr_m_subjecttopics where SubjectID = S.SubjectID))* 100) ,0) AS Percentage
  FROM tr_m_subjects S WHERE Status = 1 AND SubjectID IN (SELECT SubjectID FROM tr_m_subjects where ClassID=pclass));
  SET learnavg= (SELECT round(AVG(Percentage)) FROM learnTemp);
  DROP TABLE IF EXISTS  PratiecTemp;
  CREATE TEMPORARY TABLE IF NOT EXISTS PratiecTemp AS (SELECT COALESCE(ufn_getPracticePercentage(pUserID,pclass,S.SubjectID),0) as Percentage   
  FROM tr_m_subjects S WHERE Status = 1 AND SubjectID IN (SELECT SubjectID FROM tr_m_subjects where ClassID=pclass)) ;
  SET Pratiecavg= (SELECT ROUND(AVG(Percentage)) FROM PratiecTemp); 
  INSERT INTO AvgTemp(SType ,Percentage) VALUES('Learn',learnavg);
  INSERT INTO AvgTemp(SType ,Percentage) VALUES('Pratice',Pratiecavg);
  INSERT INTO AvgTemp(SType ,Percentage) VALUES('Assess',Assesavg);
RETURN (SELECT ROUND(AVG(Percentage)) as consolidatedAvg FROM AvgTemp);
END$$
select NOT NOT TRUE, NOT NOT NOT FALSE;$$
[<80000]create user mike identified by password 'a'$$
create user mike identified by 'a'$$
[>=80011]select employee, monthname(date), sale, sum(sale) over (partition by month(date)) as sum from sales$$
[>=80014]alter table table1 alter column `𐎅𐎧𐎨` set default (22 + 1 -2 / 3)$$
[>=80014]alter table table1 convert to character set default collate utf8$$
[>=80014]create tablespace space1 initial_size 123, autoextend_size = 456 max_size 789 extent_size=1005678G, nodegroup = 1000200030004000 storage engine innodb wait wait, no_wait, file_block_size 100 encryption 'got it'$$
[>=80014]alter tablespace space1 initial_size 123, autoextend_size = 456 max_size =1005678G, storage engine innodb wait wait, no_wait, encryption 'got it'$$
[>=80013]CREATE TABLE def_expr (
  id        INT        NOT NULL AUTO_INCREMENT,
  uuid_def  BINARY(16) DEFAULT (uuid_to_bin(uuid())),
  geo_def   POINT      DEFAULT (Point(0,0)),
  json_def  JSON       DEFAULT (JSON_ARRAY()),
  json_def2 JSON       DEFAULT ('[]') /* this works too */,

  PRIMARY KEY (`id`),
  UNIQUE INDEX `id_UNIQUE` (`id` ASC) VISIBLE
)$$
[>=80013]CREATE TABLE func_index (
  id        INT        NOT NULL AUTO_INCREMENT,
  ipaddr4   INT UNSIGNED /* 4 bytes */,

  PRIMARY KEY (id),
  UNIQUE INDEX id_UNIQUE (id ASC) VISIBLE,
  INDEX func_idx ((INET_NTOA(ipaddr4)))
)$$
[>=80018]set password for mike to random replace 'abc' retain current password$$
[>=80019]TABLE t1 UNION TABLE t2$$
[>=80019]SELECT * FROM t1 WHERE a IN (TABLE t2)$$
[>=80019]TABLE t ORDER BY b LIMIT 3 OFFSET 2$$
[>=80019]VALUES ROW(1,2),ROW(3,4),ROW(5,6) UNION VALUES ROW(10,15),ROW(20,25)$$
