Commit 0c07817b authored by monty@donna.mysql.com's avatar monty@donna.mysql.com
Browse files

Abort patch

parents c28988e7 4496d43f
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -4,8 +4,8 @@ use Getopt::Long;
$opt_distribution=$opt_user=$opt_result=$opt_config_options=$opt_config_env="";
$opt_dbd_options=$opt_perl_options="";
$opt_tmp="";
$opt_help=$opt_Information=$opt_no_delete=$opt_debug=$opt_stage=$opt_rsh_mail=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=0;
GetOptions("Information","help","distribution=s","user=s","result=s","no-delete","no-test","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","sur","with-small-disk","dbd-options=s") || usage();
$opt_help=$opt_Information=$opt_no_delete=$opt_debug=$opt_stage=$opt_rsh_mail=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=0;
GetOptions("Information","help","distribution=s","user=s","result=s","no-delete","no-test","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","sur","with-small-disk","dbd-options=s","tcpip") || usage();

usage() if ($opt_help || $opt_Information);
usage() if (!$opt_distribution);
@@ -20,6 +20,7 @@ $log="$pwd/Logs/$host.log";
$opt_distribution =~ /(mysql-[^\/]*)\.tar/;
$ver=$1;
$gcc_version=which("gcc");
$connect_option= ($opt_tcpip ? "--host=$host" : "");
if (defined($gcc_version) && ! $opt_config_env)
{
  $tmp=`$gcc_version -v 2>&1`;
@@ -186,7 +187,7 @@ if ($opt_stage <= 7 && !$opt_no_test)
{
  safe_cd("$test_dir/sql-bench");
  log_system("rm -f limits/mysql.cfg");
  safe_system("perl ./crash-me --force --batch-mode");
  safe_system("perl ./crash-me --force --batch-mode $connect_option");
}

if ($opt_stage <= 8 && !$opt_no_test)
@@ -194,7 +195,7 @@ if ($opt_stage <= 8 && !$opt_no_test)
  safe_cd("$test_dir/sql-bench");
  log_system("rm -f output/*");
  $tmp= $opt_fast_benchmark ? "--fast --user root --small-test" : "";
  check_system("perl ./run-all-tests --log --die-on-errors $tmp","RUN-mysql");
  check_system("perl ./run-all-tests --log --die-on-errors $connect_option $tmp","RUN-mysql");
}

if ($opt_stage <= 9 && $opt_result)
+41 −9
Original line number Diff line number Diff line
@@ -238,7 +238,7 @@ Linux notes (all Linux versions)
* Linux-Alpha::                 Linux-Alpha notes
* MKLinux::                     MkLinux notes
* Qube2::                       Qube2 Linux notes
* Linux-Ia64::                  IA64 Linux notes
* Linux-Ia64::                  
BSD/OS notes
@@ -766,6 +766,7 @@ MySQL change history
Changes in release 3.23.x  (Recommended; beta)
* News-3.23.24::                
* News-3.23.23::                Changes in release 3.23.23
* News-3.23.22::                Changes in release 3.23.22
* News-3.23.21::                Changes in release 3.23.21
@@ -9895,8 +9896,9 @@ unchecked values to @strong{MySQL} is very dangerous!
Check data sizes before passing them to @strong{MySQL}.
@item
Consider having your application connect to the database using a
different user name than the one you use for administrative purposes. Do not give
your applications any more access privileges than what they need.
different user name than the one you use for administrative purposes. Do
not give your applications any more access privileges than what they
need.
@end itemize
@item
Users of PHP:
@@ -12302,6 +12304,11 @@ recent operation if you don't give it a value yourself. You can also set it
to the current date and time by assigning it a @code{NULL} value.  @xref{Date
and time types}.
Note that @code{TIMESTAMP(X)} columns where X is 8 or 14 are reported to
be numbers while other @code{TIMESTAMP(X)} columns are reported to be
strings.  This is just to ensure that one can reliable dump and restore
the table with these types!
@tindex TIME
@item TIME
@@ -28281,17 +28288,32 @@ If you are using Access 2000, you should get and install the newest
Microsoft MDAC (@code{Microsoft Data Access Components}) from
@uref{http://www.microsoft.com/data}.  This will fix the bug in Access
that when you export data to @strong{MySQL}, the table and column names
aren't specified.
aren't specified.  Another way to around this bug is to upgrade to
MyODBC 2.50.33 and @strong{MySQL} 3.23.x, which together provides a
workaround for this bug!
@item
Set the `Return matching rows' MyODBC option field when connecting to
@strong{MySQL}.
@item
You should have a primary key in the table.
You should have a primary key in the table;  If not, new or updated rows
may chow up as @code{#Deleted#}.
@item
You should have a timestamp in all tables you want to be able to update.
For maximum portability @code{TIMESTAMP(14)} or simple @code{TIMESTAMP}
is recommended instead of other @code{TIMESTAMP(X)} variations.
@item
Only use double float fields. Access fails when comparing with single floats.
The symptom usually is that new or updated rows may chow up as @code{#Deleted#}
or that you can't find or update rows.
@item
Set the `Return matching rows' option field when connecting to @strong{MySQL}.
If you still get the error @code{Another user has changed your data} after
adding a @code{TIMESTAMP} column the following trick may help you:
Don't use @code{table} data sheet view. Create instead a form with the
fields you want, and use that @code{form} data sheet view.  You should
set the @code{DefaultValue} property for the @code{TIMESTAMP} column to
@code{NOW()}.  It may be a good idea to hide the @code{TIMESTAMP} column
from the view to not confuse your users.
@item
Access on NT will report @code{BLOB} columns as @code{OLE OBJECTS}. If
you want to have @code{MEMO} columns instead, you should change the
@@ -28303,8 +28325,8 @@ with these, change the columns to @code{DATETIME}.
In some cases, Access may generate illegal SQL queries that
@strong{MySQL} can't understand. You can fix this by selecting
@code{"Query|SQLSpecific|Pass-Through"} from the Access menu.
@end itemize
@item Borland Builder 4
When you start a query you can use the property @code{Active} or use the
method @code{Open}.  Note that @code{Active} will start by automatically issue
@@ -35673,6 +35695,7 @@ version. The replication and BerkeleyDB code is still under development,
though, so 3.23 is not released as a stable version yet.
@menu
* News-3.23.24::                Changes in release 3.23.24
* News-3.23.23::                Changes in release 3.23.23
* News-3.23.22::                Changes in release 3.23.22
* News-3.23.21::                Changes in release 3.23.21
@@ -35699,7 +35722,16 @@ though, so 3.23 is not released as a stable version yet.
* News-3.23.0::                 Changes in release 3.23.0
@end menu
@node News-3.23.23, News-3.23.22, News-3.23.x, News-3.23.x
@node News-3.23.24, News-3.23.23, News-3.23.x, News-3.23.x
@appendixsubsec Changes in release 3.23.24
@itemize @bullet
@item
To make it possibly to reliable dump and restore tables with
@code{TIMESTAMP(X)} columns, @code{MySQL} now reports columns with X
other than 14 or 8 to be strings.
@end itemize
@node News-3.23.23, News-3.23.22, News-3.23.24, News-3.23.x
@appendixsubsec Changes in release 3.23.23
@itemize @bullet
@item
+134 −33
Original line number Diff line number Diff line
@@ -604,6 +604,28 @@ static uint getTableStructure(char *table, char* db)
    DBUG_RETURN(0);
  }

  /* Make an sql-file, if path was given iow. option -T was given */
  if (!tFlag)
  {
    if (path)
    {
      char filename[FN_REFLEN], tmp_path[FN_REFLEN];
      strmov(tmp_path,path);
      convert_dirname(tmp_path);
      sql_file= my_fopen(fn_format(filename, table, tmp_path, ".sql", 4),
			 O_WRONLY, MYF(MY_WME));
      if (!sql_file)			/* If file couldn't be opened */
      {
	safe_exit(EX_MYSQLERR);
	DBUG_RETURN(0);
      }
      write_heder(sql_file, db);
    }
    fprintf(sql_file, "\n#\n# Table structure for table '%s'\n#\n\n", table);
    if (opt_drop)
      fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n",table_name);
    fprintf(sql_file, "CREATE TABLE %s (\n", table_name);
  }
  if (cFlag)
    sprintf(insert_pat, "INSERT %sINTO %s (", delayed, table_name);
  else
@@ -619,18 +641,32 @@ static uint getTableStructure(char *table, char* db)
    ulong *lengths=mysql_fetch_lengths(tableRes);
    if (init)
    {
      if (!tFlag)
	fputs(",\n",sql_file);
      if (cFlag)
	strpos=strmov(strpos,", ");
    }
    init=1;
    if (cFlag)
      strpos=strmov(strpos,quote_name(row[SHOW_FIELDNAME],name_buff));
  }
  if (cFlag)
    if (!tFlag)
    {
    strpos=strmov(strpos,") VALUES ");
    if (!extended_insert)
      strpos=strmov(strpos,"(");
      if (opt_keywords)
	fprintf(sql_file, "  %s.%s %s", table_name,
		quote_name(row[SHOW_FIELDNAME],name_buff), row[SHOW_TYPE]);
      else
	fprintf(sql_file, "  %s %s", quote_name(row[SHOW_FIELDNAME],name_buff),
		row[SHOW_TYPE]);
      if (row[SHOW_DEFAULT])
      {
	fputs(" DEFAULT ", sql_file);
	unescape(sql_file,row[SHOW_DEFAULT],lengths[SHOW_DEFAULT]);
      }
      if (!row[SHOW_NULL][0])
	fputs(" NOT NULL", sql_file);
      if (row[SHOW_EXTRA][0])
	fprintf(sql_file, " %s",row[SHOW_EXTRA]);
    }
  }
  numFields = (uint) mysql_num_rows(tableRes);
  mysql_free_result(tableRes);
@@ -638,37 +674,102 @@ static uint getTableStructure(char *table, char* db)
  {
    /* Make an sql-file, if path was given iow. option -T was given */
    char buff[20+FN_REFLEN];

    sprintf(buff,"show create table %s",table_name);
    uint keynr,primary_key;
    sprintf(buff,"show keys from %s",table_name);
    if (mysql_query(sock, buff))
    {
      fprintf(stderr, "%s: Can't get CREATE TABLE for table '%s' (%s)\n",
      fprintf(stderr, "%s: Can't get keys for table '%s' (%s)\n",
	      my_progname, table, mysql_error(sock));
      if (sql_file != stdout)
	my_fclose(sql_file, MYF(MY_WME));
      safe_exit(EX_MYSQLERR);
      DBUG_RETURN(0);
    }

    if (path)
    tableRes=mysql_store_result(sock);
    /* Find first which key is primary key */
    keynr=0;
    primary_key=INT_MAX;
    while ((row=mysql_fetch_row(tableRes)))
    {
      char filename[FN_REFLEN], tmp_path[FN_REFLEN];
      strmov(tmp_path,path);
      convert_dirname(tmp_path);
      sql_file= my_fopen(fn_format(filename, table, tmp_path, ".sql", 4),
			 O_WRONLY, MYF(MY_WME));
      if (!sql_file)			/* If file couldn't be opened */
      if (atoi(row[3]) == 1)
      {
	safe_exit(EX_MYSQLERR);
	DBUG_RETURN(0);
	keynr++;
#ifdef FORCE_PRIMARY_KEY
	if (atoi(row[1]) == 0 && primary_key == INT_MAX)
	  primary_key=keynr;
#endif
	if (!strcmp(row[2],"PRIMARY"))
	{
	  primary_key=keynr;
	  break;
	}
      write_heder(sql_file, db);
      }
    fprintf(sql_file, "\n#\n# Table structure for table '%s'\n#\n\n", table);
    if (opt_drop)
      fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n",table_name);
    }
    mysql_data_seek(tableRes,0);
    keynr=0;
    while ((row=mysql_fetch_row(tableRes)))
    {
      if (atoi(row[3]) == 1)
      {
	if (keynr++)
	  putc(')', sql_file);
	if (atoi(row[1]))       /* Test if duplicate key */
	  /* Duplicate allowed */
	  fprintf(sql_file, ",\n  KEY %s (",quote_name(row[2],name_buff));
	else if (keynr == primary_key)
	  fputs(",\n  PRIMARY KEY (",sql_file); /* First UNIQUE is primary */
	else
	  fprintf(sql_file, ",\n  UNIQUE %s (",quote_name(row[2],name_buff));
      }
      else
	putc(',', sql_file);
      fputs(quote_name(row[4],name_buff), sql_file);
      if (row[7])
	fprintf(sql_file, "(%s)",row[7]);      /* Sub key */
    }
    if (keynr)
      putc(')', sql_file);
    fputs("\n)",sql_file);

    tableRes=mysql_store_result(sock);
    row=mysql_fetch_row(tableRes);
    fprintf(sql_file, "%s;\n", row[1]);
    /* Get MySQL specific create options */
    if (create_options)
    {
      sprintf(buff,"show table status like '%s'",table);
      if (mysql_query(sock, buff))
      {
	if (mysql_errno(sock) != ER_PARSE_ERROR)
	{					/* If old MySQL version */
	  if (verbose)
	    fprintf(stderr,
		    "# Warning: Couldn't get status information for table '%s' (%s)\n",
		    table,mysql_error(sock));
	}
      }
      else if (!(tableRes=mysql_store_result(sock)) ||
	       !(row=mysql_fetch_row(tableRes)))
      {
	fprintf(stderr,
		"Error: Couldn't read status information for table '%s' (%s)\n",
		table,mysql_error(sock));
      }
      else
      {
	fputs("/*!",sql_file);
	print_value(sql_file,tableRes,row,"type=","Type",0);
	print_value(sql_file,tableRes,row,"","Create_options",0);
	print_value(sql_file,tableRes,row,"comment=","Comment",1);
	fputs(" */",sql_file);
      }
      mysql_free_result(tableRes);		/* Is always safe to free */
    }
    fputs(";\n", sql_file);
  }
  if (cFlag)
  {
    strpos=strmov(strpos,") VALUES ");
    if (!extended_insert)
      strpos=strmov(strpos,"(");
  }
  DBUG_RETURN(numFields);
} /* getTableStructure */
@@ -841,7 +942,7 @@ static void dumpTable(uint numFields, char *table)
	  {
	    if (length)
	    {
	      if (!IS_NUM(field->type))
	      if (!IS_NUM_FIELD(field))
	      {
		if (dynstr_realloc(&extended_row,length * 2+2))
		{
@@ -873,7 +974,7 @@ static void dumpTable(uint numFields, char *table)
	    putchar(',');
	  if (row[i])
	  {
	    if (!IS_NUM(field->type))
	    if (!IS_NUM_FIELD(field))
	      unescape(stdout, row[i], lengths[i]);
	    else
	      fputs(row[i],stdout);
+2 −0
Original line number Diff line number Diff line
@@ -73,6 +73,8 @@ extern char *mysql_unix_port;
#define IS_NOT_NULL(n)	((n) & NOT_NULL_FLAG)
#define IS_BLOB(n)	((n) & BLOB_FLAG)
#define IS_NUM(t)	((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR)
#define IS_NUM_FIELD(f)	 ((f)->flags & NUM_FLAG)
#define INTERNAL_NUM_FIELD(f) (((f)->type <= FIELD_TYPE_INT24 && (f)->type != FIELD_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8) || (f)->type == FIELD_TYPE_YEAR)

typedef struct st_mysql_field {
  char *name;			/* Name of column */
+1 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ enum enum_server_command {COM_SLEEP,COM_QUIT,COM_INIT_DB,COM_QUERY,
#define AUTO_INCREMENT_FLAG 512		/* field is a autoincrement field */
#define TIMESTAMP_FLAG	1024		/* Field is a timestamp */
#define SET_FLAG	2048		/* field is a set */
#define NUM_FLAG	32768		/* Field is num (for clients) */
#define PART_KEY_FLAG	16384		/* Intern; Part of some key */
#define GROUP_FLAG	32768		/* Intern: Group field */
#define UNIQUE_FLAG	65536		/* Intern: Used by sql_yacc */
Loading