[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-internals
Subject:    bk commit into 4.0 tree (1.1441)
From:       walrus () mysql ! com
Date:       2002-11-29 13:07:08
[Download RAW message or body]

Below is the list of changes that have just been committed into a local
4.0 repository of walrus. When walrus does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
  1.1441 02/11/29 18:07:02 walrus@mysql.com +3 -0
  improvement crash-me

  sql-bench/server-cfg.sh
    1.43 02/11/29 18:06:57 walrus@mysql.com +1 -1
    Misprint correction (db_Sapdb ->db_sapdb)

  sql-bench/crash-me.sh
    1.37 02/11/29 18:06:57 walrus@mysql.com +89 -36
    1) restore #!@PERL@ that I (accidentally) deleted  last time
    2) comment order_by_remember_desc section
    3) rectify WEEK test. Now it returns "EURO" ,"USA", "error" (if it returns 
    wrong week number), or "no" (if this function isn't supported)
    4) merge 2 tests for noround() (func_extra_noround and ignoring_noround). 
     Now it returns yes/no/"syntax only"
    5) merge 2 tests for foreign key (foreign_key and foreign_key_syntax). Now it
     returns yes/no/"syntax only"
    6) correct misprint in crash-me help ( --db-start-cmd instead of --start-cmd)

  BitKeeper/etc/ignore
    1.138 02/11/29 18:06:57 walrus@mysql.com +1 -0
    Added core.2430 to the ignore list

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	walrus
# Host:	kishkin.ru
# Root:	/home/walrus/bk/40

--- 1.36/sql-bench/crash-me.sh	Thu Nov 28 20:01:13 2002
+++ 1.37/sql-bench/crash-me.sh	Fri Nov 29 18:06:57 2002
@@ -1,3 +1,4 @@
+#!@PERL@
 # Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
 #
 # This library is free software; you can redistribute it and/or
@@ -279,13 +280,14 @@
        "select a from crash_me order by a+1");
 report("Order by on unused column",'order_on_unused',
        "select b from crash_me order by a");
-check_and_report("Order by DESC is remembered",'order_by_remember_desc',
-		 ["create table crash_q (s int,s1 int)",
-		  "insert into crash_q values(1,1)",
-		  "insert into crash_q values(3,1)",
-		  "insert into crash_q values(2,1)"],
-		 "select s,s1 from crash_q order by s1 DESC,s",
-		 ["drop table crash_q $drop_attr"],[3,2,1],7,undef(),3);
+# little bit deprecated
+#check_and_report("Order by DESC is remembered",'order_by_remember_desc',
+#		 ["create table crash_q (s int,s1 int)",
+#		  "insert into crash_q values(1,1)",
+#		  "insert into crash_q values(3,1)",
+#		  "insert into crash_q values(2,1)"],
+#		 "select s,s1 from crash_q order by s1 DESC,s",
+#		 ["drop table crash_q $drop_attr"],[3,2,1],7,undef(),3);
 report("Compute",'compute',
        "select a from crash_me order by a compute sum(a) by a");
 report("INSERT with Value lists",'insert_multi_value',
@@ -843,7 +845,6 @@
    ["DAYOFWEEK","dayofweek","dayofweek(DATE '1997-02-01')",7,0],
    ["DAYOFYEAR","dayofyear","dayofyear(DATE '1997-02-01')",32,0],
    ["QUARTER","quarter","quarter(DATE '1997-02-01')",1,0],
-   ["WEEK","week","week(DATE '1997-02-01')",5,0],
    ["YEAR","year","year(DATE '1997-02-01')",1997,0],
    ["CURTIME","curtime","curtime()",0,2],
    ["HOUR","hour","hour('12:13:14')",12,0],
@@ -979,7 +980,6 @@
    ["ASCII in string cast",'ascii_string',"ascii('a')",'a',1],
    ["EBCDIC in string cast",'ebcdic_string',"ebcdic('a')",'a',1],
    ["TRUNC (1 arg)",'trunc1arg',"trunc(222.6)",222,0],
-   ["NOROUND",'noround',"noround(222.6)",222.6,0],
    ["FIXED",'fixed',"fixed(222.6666,10,2)",'222.67',0],
    ["FLOAT",'float',"float(6666.66,4)",6667,0],
    ["LENGTH",'length',"length(1)",2,0],
@@ -1186,12 +1186,31 @@
 }
 
 
-if ($limits{'func_extra_noround'} eq 'yes')
+#  Test: NOROUND 
 {
-  report("Ignoring NOROUND","ignoring_noround",
-  "create table crash_q (a int)",
-  "insert into crash_q values(noround(10.22))",
-  "drop table crash_q $drop_attr"); 
+ my $resultat = 'undefined';
+ my $error;
+ print "NOROUND: ";
+ save_incomplete('func_extra_noround','Function NOROUND');
+
+# 1) check if noround() function is supported
+ $error = safe_query("select noround(22.6) $end_query");
+ if ($error ne 1)         # syntax error -- noround is not supported 
+ {
+   $resultat = 'no'
+ } else                   # Ok, now check if it really works
+ {   
+   $error=safe_query(  "create table crash_me_nr (a int)",
+    "insert into crash_me_nr values(noround(10.2))",
+    "drop table crash_me_nr $drop_attr");
+  if ($error eq 1) {
+       $resultat = "syntax only";
+    } else {
+       $resultat = 'yes';
+    }
+ } 
+ print "$resultat\n";
+ save_config_data('func_extra_noround',$resultat,"Function NOROUND");
 }
 
 check_parenthesis("func_sql_","CURRENT_USER");
@@ -1199,6 +1218,32 @@
 check_parenthesis("func_sql_","SYSTEM_USER");
 check_parenthesis("func_sql_","USER");
 
+# Test: WEEK()
+{
+ my $explain="";
+ my $resultat="no";
+ my $error;
+ print "WEEK:";
+ save_incomplete('func_odbc_week','WEEK');
+ $error = safe_query_result("select week(DATE '1997-02-01') $end_query",5,0);
+ # actually this query must return 4 or 5 in the $last_result,
+ # $error can be 1 (not supported at all) , -1 ( probably USA weeks)
+ # and 0 - EURO weeks
+ if ($error == -1) { 
+     if ($last_result == 4) {
+       $resultat = 'USA';
+       $explain = ' started from Sunday';
+     } else {
+       $resultat='error';
+       $explain = " must return 4 or 5, but $last_error";
+     }
+ } elsif ($error == 0) {
+       $resultat = 'EURO';
+       $explain = ' started from Monday'; 
+ }
+ print " $resultat\n";
+ save_config_data('func_odbc_week',$resultat,"WEEK $explain");
+}
 
 report("LIKE on numbers","like_with_number",
        "create table crash_q (a int,b int)",
@@ -1681,28 +1726,36 @@
        "create view crash_q as select a from crash_me",
        "drop view crash_q $drop_attr");
 
-report("foreign key syntax","foreign_key_syntax",
-       create_table("crash_q",["a integer not null"],["primary key (a)"]),
-       create_table("crash_q2",["a integer not null",
-				"foreign key (a) references crash_q (a)"],
-		    []),
-       "insert into crash_q values (1)",
-       "insert into crash_q2 values (1)",
-       "drop table crash_q2 $drop_attr",
-       "drop table crash_q $drop_attr");
-
-if ($limits{'foreign_key_syntax'} eq 'yes')
+#  Test: foreign key
 {
-  report_fail("foreign keys","foreign_key",
-	      create_table("crash_q",["a integer not null"],
-			   ["primary key (a)"]),
-	      create_table("crash_q2",["a integer not null",
-				       "foreign key (a) references crash_q (a)"],
-			   []),
-	      "insert into crash_q values (1)",
-	      "insert into crash_q2 values (2)",
-	      "drop table crash_q2 $drop_attr",
-	      "drop table crash_q $drop_attr");
+ my $resultat = 'undefined';
+ my $error;
+ print "foreign keys: ";
+ save_incomplete('foreign_key','foreign keys');
+
+# 1) check if foreign keys are supported
+ safe_query(create_table("crash_me_qf",["a integer not null"],
+         ["primary key (a)"]));
+ $error = safe_query( create_table("crash_me_qf2",["a integer not null",
+	 "foreign key (a) references crash_me_qf (a)"], []));
+ 			   
+ if ($error eq 1)         # OK  -- syntax is supported 
+ {
+   $resultat = 'error';
+   # now check if foreign key really works
+   safe_query( "insert into crash_me_qf values (1)");
+   if (safe_query( "insert into crash_me_qf2 values (2)") eq 1) {
+     $resultat = 'syntax only';
+   } else {
+     $resultat = 'yes';
+   }       
+   
+ } else  { 
+   $resultat = "no";
+ } 
+ safe_query( "drop table crash_me_qf2 $drop_attr","drop table crash_me_qf $drop_attr");
+ print "$resultat\n";
+ save_config_data('foreign_key',$resultat,"foreign keys");
 }
 
 report("Create SCHEMA","create_schema",
@@ -2329,7 +2382,7 @@
 --user='user_name'
   User name to log into the SQL server.
 
---start-cmd='command to restart server'
+--db-start-cmd='command to restart server'
   Automaticly restarts server with this command if the database server dies.
 
 --sleep='time in seconds' (Default $opt_sleep)

--- 1.42/sql-bench/server-cfg.sh	Thu Nov 28 20:01:13 2002
+++ 1.43/sql-bench/server-cfg.sh	Fri Nov 29 18:06:57 2002
@@ -3386,7 +3386,7 @@
 #	     Configuration for SAPDB 
 #############################################################################
 
-package db_Sapdb;
+package db_sapdb;
 
 sub new
 {

--- 1.137/BitKeeper/etc/ignore	Wed Nov 27 17:01:40 2002
+++ 1.138/BitKeeper/etc/ignore	Fri Nov 29 18:06:57 2002
@@ -521,3 +521,4 @@
 innobase/autom4te-2.53.cache/requests
 innobase/autom4te-2.53.cache/traces.0
 pull.log
+core.2430

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail internals-thread5836@lists.mysql.com
To unsubscribe, e-mail <internals-unsubscribe@lists.mysql.com>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic