CodeMirror.defineMode("mysql",function(f,d){function g(a,e){var b=a.next();if(b=='"'||b=="'"||b=="`"){b=h(b);e.tokenize=b;return b(a,e)}else if(/[\[\]{}\(\),;\.]/.test(b))return"separator";else if(/\d/.test(b)){a.eatWhile(/[\w\.]/);return"number"}else if(b=="/")if(a.eat("*")){b=r;e.tokenize=b;return b(a,e)}else{a.eatWhile(i);return"operator"}else if(b=="-")if(a.eat("-")){a.skipToEnd();return"comment"}else{a.eatWhile(i);return"operator"}else if(b=="@"||b=="$"){a.eatWhile(/[\w\d\$_]/);return"variable"}else if(i.test(b)){a.eatWhile(i);
return"operator"}else{a.eatWhile(/[\w\$_]/);var c=a.current().toLowerCase();b=a.pos;if(k&&k.propertyIsEnumerable(c))return"statement-verb";if(l&&l.propertyIsEnumerable(c))return"keyword";if(m&&m.propertyIsEnumerable(c)){a.eatSpace();if(a.peek()=="(")return"builtin";a.pos=b}if(n&&n.propertyIsEnumerable(c))return"variable-2";if(o&&o.propertyIsEnumerable(c))return"variable-3";a.eatSpace();a.eatWhile(/[\w\$_]/);c=a.current().toLowerCase();if(p&&p.propertyIsEnumerable(c))return"keyword";a.pos=b;return"mysql-word"}}
function h(a){return function(e,b){for(var c=false,j,q=false;(j=e.next())!=null;){if(j==a&&!c){q=true;break}c=!c&&j=="\\"}if(q||!(c||s))b.tokenize=g;return"mysql-string"}}function r(a,e){for(var b=false,c;c=a.next();){if(c=="/"&&b){e.tokenize=g;break}b=c=="*"}return"mysql-comment"}var l=d.keywords,k=d.verbs,m=d.functions,n=d.types,o=d.attributes,s=d.multiLineStrings,p=d.multiPartKeywords,i=/[+\-*&%=<>!?:\/|]/;return{startState:function(){return{tokenize:g,startOfLine:true}},token:function(a,e){if(a.eatSpace())return null;
return e.tokenize(a,e)}}});
(function(){function f(d){var g={},h=d;if(typeof d=="string")h=d.split(" ");for(d=0;d<h.length;++d)g[h[d]]=true;return g}CodeMirror.defineMIME("text/x-mysql",{name:"mysql",keywords:f("accessible add all and as asc asensitive before between bigint binary blob both cascade case char character collate column condition constraint continue convert cross current_date current_time current_timestamp current_user cursor database databases day_hour day_microsecond day_minute day_second dec decimal declare default delayed desc deterministic distinct distinctrow div double dual each else elseif enclosed escaped exists exit explain false fetch float float4 float8 for force foreign fulltext from having high_priority hour_microsecond hour_minute hour_second if ignore in index infile inner inout insensitive int int1 int2 int3 int4 int8 integer interval is iterate join key keys leading leave left like limit linear lines localtime localtimestamp long longblob longtext loop low_priority master_ssl_verify_server_cert match maxvalue mediumblob mediumint mediumtext middleint minute_microsecond minute_second mod modifies natural not no_write_to_binlog null numeric on option optionally or out outer outfile precision primary procedure range read reads read_write real references regexp repeat require restrict return right rlike schema schemas second_microsecond sensitive separator smallint spatial specific sql sqlexception sqlstate sqlwarning sql_big_result sql_calc_found_rows sql_small_result ssl starting straight_join table terminated then tinyblob tinyint tinytext to trailing trigger true undo union unique unsigned usage using utc_date utc_time utc_timestamp values varbinary varchar varcharacter varying when where while with write xor year_month zerofill"),multiPartKeywords:f(["insert into",
"group by","order by","delete from"]),verbs:f("alter analyze begin binlog call change check checksum commit create deallocate describe do drop execute flush grant handler install kill load lock optimize cache partition prepare purge release rename repair replace reset resignal revoke rollback savepoint select set signal show start truncate uninstall unlock update use xa"),functions:f("abs acos adddate addtime aes_decrypt aes_encrypt area asbinary ascii asin astext atan atan2 avg bdmpolyfromtext bdmpolyfromwkb bdpolyfromtext bdpolyfromwkb benchmark bin bit_and bit_count bit_length bit_or bit_xor boundary buffer cast ceil ceiling centroid char character_length charset char_length coalesce coercibility collation compress concat concat_ws connection_id contains conv convert convert_tz convexhull cos cot count crc32 crosses curdate current_date current_time current_timestamp current_user curtime database date datediff date_add date_diff date_format date_sub day dayname dayofmonth dayofweek dayofyear decode default degrees des_decrypt des_encrypt difference dimension disjoint distance elt encode encrypt endpoint envelope equals exp export_set exteriorring extract extractvalue field find_in_set floor format found_rows from_days from_unixtime geomcollfromtext geomcollfromwkb geometrycollection geometrycollectionfromtext geometrycollectionfromwkb geometryfromtext geometryfromwkb geometryn geometrytype geomfromtext geomfromwkb get_format get_lock glength greatest group_concat group_unique_users hex hour if ifnull inet_aton inet_ntoa insert instr interiorringn intersection intersects interval isclosed isempty isnull isring issimple is_free_lock is_used_lock last_day last_insert_id lcase least left length linefromtext linefromwkb linestring linestringfromtext linestringfromwkb ln load_file localtime localtimestamp locate log log10 log2 lower lpad ltrim makedate maketime make_set master_pos_wait max mbrcontains mbrdisjoint mbrequal mbrintersects mbroverlaps mbrtouches mbrwithin md5 microsecond mid min minute mlinefromtext mlinefromwkb mod month monthname mpointfromtext mpointfromwkb mpolyfromtext mpolyfromwkb multilinestring multilinestringfromtext multilinestringfromwkb multipoint multipointfromtext multipointfromwkb multipolygon multipolygonfromtext multipolygonfromwkb name_const now nullif numgeometries numinteriorrings numpoints oct octet_length old_password ord overlaps password period_add period_diff pi point pointfromtext pointfromwkb pointn pointonsurface polyfromtext polyfromwkb polygon polygonfromtext polygonfromwkb position pow power quarter quote radians rand related release_lock repeat replace reverse right round row_count rpad rtrim schema second sec_to_time session_user sha sha1 sign sin sleep soundex space sqrt srid startpoint std stddev stddev_pop stddev_samp strcmp str_to_date subdate substr substring substring_index subtime sum symdifference sysdate system_user tan time timediff timestamp timestampadd timestampdiff time_format time_to_sec touches to_days trim truncate ucase uncompress uncompressed_length unhex unique_users unix_timestamp updatexml upper user utc_date utc_time utc_timestamp uuid variance var_pop var_samp version week weekday weekofyear within x y year yearweek"),
types:f("bigint binary bit blob bool boolean char character date datetime dec decimal double enum float float4 float8 geometry geometrycollection int int1 int2 int3 int4 int8 integer linestring long longblob longtext mediumblob mediumint mediumtext middleint multilinestring multipoint multipolygon nchar numeric point polygon real serial set smallint text time timestamp tinyblob tinyint tinytext varbinary varchar year"),attributes:f("archive ascii auto_increment bdb berkeleydb binary blackhole csv default example federated heap innobase innodb isam maria memory merge mrg_isam mrg_myisam myisam national ndb ndbcluster precision undefined unicode unsigned varying zerofill")})})();
