⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 crash-me

📁 开启mysql的远程连接的方法 mysql-noinstall-5.1.6-alpha-win32.zip
💻
📖 第 1 页 / 共 3 页
字号:
       "drop table crash_me_q $drop_attr");report("INSERT with empty value list","insert_with_empty_value_list",       "create table crash_me_q (a int)",       "insert into crash_me_q (a) values ()",       "drop table crash_me_q $drop_attr");report("INSERT DEFAULT VALUES","insert_default_values",       "create table crash_me_q (a int)",       "insert into crash_me_q  DEFAULT VALUES",       "drop table crash_me_q $drop_attr");       report("allows end ';'","end_colon", "select * from crash_me;");try_and_report("LIMIT number of rows","select_limit",	       ["with LIMIT",		"select * from crash_me limit 1"],	       ["with TOP",		"select TOP 1 * from crash_me"]);report("SELECT with LIMIT #,#","select_limit2",       "select * from crash_me limit 1,1");report("SELECT with LIMIT # OFFSET #",      "select_limit3", "select * from crash_me limit 1 offset 1");# The following alter table commands MUST be kept together!if ($dbh->do("create table crash_q (a integer, b integer,c1 CHAR(10))")){  report("Alter table add column",'alter_add_col',	 "alter table crash_q add d integer");  report_one("Alter table add many columns",'alter_add_multi_col',	     [["alter table crash_q add (f integer,g integer)","yes"],	      ["alter table crash_q add f integer, add g integer","with add"],	      ["alter table crash_q add f integer,g integer","without add"]] );  report("Alter table change column",'alter_change_col',	 "alter table crash_q change a e char(50)");  # informix can only change data type with modify  report_one("Alter table modify column",'alter_modify_col',	     [["alter table crash_q modify c1 CHAR(20)","yes"],	      ["alter table crash_q alter c1 CHAR(20)","with alter"]]);  report("Alter table alter column default",'alter_alter_col',	 "alter table crash_q alter b set default 10");  report_one("Alter table drop column",'alter_drop_col',	     [["alter table crash_q drop column b","yes"],	      ["alter table crash_q drop column b restrict",	      "with restrict/cascade"]]);  report("Alter table rename table",'alter_rename_table',	 "alter table crash_q rename to crash_q1");}# Make sure both tables will be dropped, even if rename fails.$dbh->do("drop table crash_q1 $drop_attr");$dbh->do("drop table crash_q $drop_attr");report("rename table","rename_table",       "create table crash_q (a integer, b integer,c1 CHAR(10))",       "rename table crash_q to crash_q1",       "drop table crash_q1 $drop_attr");# Make sure both tables will be dropped, even if rename fails.$dbh->do("drop table crash_q1 $drop_attr");$dbh->do("drop table crash_q $drop_attr");report("truncate","truncate_table",       "create table crash_q (a integer, b integer,c1 CHAR(10))",       "truncate table crash_q",       "drop table crash_q $drop_attr");if ($dbh->do("create table crash_q (a integer, b integer,c1 CHAR(10))") && $dbh->do("create table crash_q1 (a integer, b integer,c1 CHAR(10) not null)")){  report("Alter table add constraint",'alter_add_constraint',	 "alter table crash_q add constraint c2 check(a > b)");  report_one("Alter table drop constraint",'alter_drop_constraint',	     [["alter table crash_q drop constraint c2","yes"],	      ["alter table crash_q drop constraint c2 restrict",	      "with restrict/cascade"]]);  report("Alter table add unique",'alter_add_unique',	 "alter table crash_q add constraint u1 unique(c1)");  try_and_report("Alter table drop unique",'alter_drop_unique',		 ["with constraint",		  "alter table crash_q drop constraint u1"],		 ["with constraint and restrict/cascade",		  "alter table crash_q drop constraint u1 restrict"],		 ["with drop key",		  "alter table crash_q drop key u1"]);  try_and_report("Alter table add primary key",'alter_add_primary_key',		 ["with constraint",		  "alter table crash_q1 add constraint p1 primary key(c1)"],		 ["with add primary key",		  "alter table crash_q1 add primary key(c1)"]);  report("Alter table add foreign key",'alter_add_foreign_key',	 "alter table crash_q add constraint f1 foreign key(c1) references crash_q1(c1)");  try_and_report("Alter table drop foreign key",'alter_drop_foreign_key',		 ["with drop constraint",		  "alter table crash_q drop constraint f1"],		 ["with drop constraint and restrict/cascade",		  "alter table crash_q drop constraint f1 restrict"],		 ["with drop foreign key",		  "alter table crash_q drop foreign key f1"]);  try_and_report("Alter table drop primary key",'alter_drop_primary_key',		 ["drop constraint",		  "alter table crash_q1 drop constraint p1 restrict"],		 ["drop primary key",		  "alter table crash_q1 drop primary key"]);}$dbh->do("drop table crash_q $drop_attr");$dbh->do("drop table crash_q1 $drop_attr");check_and_report("Case insensitive compare","case_insensitive_strings",		 [],"select b from crash_me where b = 'A'",[],'a',1);check_and_report("Ignore end space in compare","ignore_end_space",		 [],"select b from crash_me where b = 'a '",[],'a',1);check_and_report("Group on column with null values",'group_by_null',		 ["create table crash_q (s char(10))",		  "insert into crash_q values(null)",		  "insert into crash_q values(null)"],		 "select count(*),s from crash_q group by s",		 ["drop table crash_q $drop_attr"],2,0);$prompt="Having";if (!defined($limits{'having'})){                               # Complicated because of postgreSQL  if (!safe_query_result_l("having",      "select a from crash_me group by a having a > 0",1,0))  {    if (!safe_query_result_l("having",           "select a from crash_me group by a having a < 0",	    1,0))    { save_config_data("having","error",$prompt); }    else    { save_config_data("having","yes",$prompt); }  }  else  { save_config_data("having","no",$prompt); }}print "$prompt: $limits{'having'}\n";if ($limits{'having'} eq 'yes'){  report("Having with group function","having_with_group",	 "select a from crash_me group by a having count(*) = 1");}if ($limits{'column_alias'} eq 'yes'){  report("Order by alias",'order_by_alias',	 "select a as ab from crash_me order by ab");  if ($limits{'having'} eq 'yes')  {    report("Having on alias","having_with_alias",	   "select a as ab from crash_me group by a having ab > 0");  }}report("binary numbers (0b1001)","binary_numbers","select 0b1001 $end_query");report("hex numbers (0x41)","hex_numbers","select 0x41 $end_query");report("binary strings (b'0110')","binary_strings","select b'0110' $end_query");report("hex strings (x'1ace')","hex_strings","select x'1ace' $end_query");report_result("Value of logical operation (1=1)","logical_value",	      "select (1=1) $end_query");report_result("Value of TRUE","value_of_true","select TRUE $end_query");report_result("Value of FALSE","value_of_false","select FALSE $end_query");$logical_value= $limits{'logical_value'};$false=0;$result="no";if ($res=safe_query_l('has_true_false',"select (1=1)=true $end_query")) {  $false="false";  $result="yes";}save_config_data('has_true_false',$result,"TRUE and FALSE");## Check how many connections the server can handle:# We can't test unlimited connections, because this may take down the# server...#$prompt="Simultaneous connections (installation default)";print "$prompt: ";if (defined($limits{'connections'})){  print "$limits{'connections'}\n";}else{  @connect=($dbh);  for ($i=1; $i < $max_connections ; $i++)  {    if (!($dbh=DBI->connect($server->{'data_source'},$opt_user,$opt_password,			  { PrintError => 0})))    {      print "Last connect error: $DBI::errstr\n" if ($opt_debug);      last;    }    $dbh->{LongReadLen}= $longreadlen; # Set retrieval buffer    print "." if ($opt_debug);    push(@connect,$dbh);  }  print "$i\n";  save_config_data('connections',$i,$prompt);  foreach $dbh (@connect)  {    print "#" if ($opt_debug);    $dbh->disconnect || warn $dbh->errstr;           # close connection  }  $#connect=-1;                 # Free connections  if ($i == 0)  {    print "Can't connect to server: $DBI::errstr.".          "  Please start it and try again\n";    exit 1;  }  $dbh=retry_connect();}## Check size of communication buffer, strings...#$prompt="query size";print "$prompt: ";if (!defined($limits{'query_size'})){  $query="select ";  $first=64;  $end=$max_buffer_size;  $select= $limits{'select_without_from'} eq 'yes' ? 1 : 'a';  assert($query . "$select$end_query");  $first=$limits{'restart'}{'low'} if ($limits{'restart'}{'low'});  if ($limits{'restart'}{'tohigh'})  {    $end = $limits{'restart'}{'tohigh'} - 1;    print "\nRestarting this with low limit: $first and high limit: $end\n";    delete $limits{'restart'};    $first=$first+int(($end-$first+4)/5);           # Prefere lower on errors  }  for ($i=$first ; $i < $end ; $i*=2)  {    last if (!safe_query($query .             (" " x ($i - length($query)-length($end_query) -1)) 	      . "$select$end_query"));    $first=$i;    save_config_data("restart",$i,"") if ($opt_restart);  }  $end=$i;  if ($i < $max_buffer_size)  {    while ($first != $end)    {      $i=int(($first+$end+1)/2);      if (safe_query($query .		     (" " x ($i - length($query)-length($end_query) -1)) .		     "$select$end_query"))      {	$first=$i;      }      else      {	$end=$i-1;      }    }  }  save_config_data('query_size',$end,$prompt);}$query_size=$limits{'query_size'};print "$limits{'query_size'}\n";## Check for reserved words#check_reserved_words($dbh);## Test database types#@sql_types=("character(1)","char(1)","char varying(1)", "character varying(1)",	    "boolean",	    "varchar(1)",	    "integer","int","smallint",	    "numeric(9,2)","decimal(6,2)","dec(6,2)",	    "bit", "bit(2)","bit varying(2)","float","float(8)","real",	    "double precision", "date","time","timestamp",	    "interval year", "interval year to month",            "interval month",            "interval day", "interval day to hour", "interval day to minute",            "interval day to second",            "interval hour", "interval hour to minute",	    "interval hour to second",            "interval minute", "interval minute to second",            "interval second",	    "national character varying(20)",	    "national character(20)","nchar(1)",	    "national char varying(20)","nchar varying(20)",	    "national character varying(20)",	    "timestamp with time zone");@odbc_types=("binary(1)","varbinary(1)","tinyint","bigint",	     "datetime");@extra_types=("blob","byte","long varbinary","image","text","text(10)",	      "mediumtext",	      "long varchar(1)", "varchar2(257)",	      "mediumint","middleint","int unsigned",	      "int1","int2","int3","int4","int8","uint",	      "money","smallmoney","float4","float8","smallfloat",	      "float(6,2)","double",	      "enum('red')","set('red')", "int(5) zerofill", "serial",	      "char(10) binary","int not null auto_increment,unique(q)",	      "abstime","year","datetime","smalldatetime","timespan","reltime",	      # Sybase types	      "int not null identity,unique(q)",	      # postgres types	      "box","bool","circle","polygon","point","line","lseg","path",	      "interval", "inet", "cidr", "macaddr",	      # oracle types	      "varchar2(16)","nvarchar2(16)","number(9,2)","number(9)",

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -