Commit 28d6b988 authored by bell@sanja.is.com.ua's avatar bell@sanja.is.com.ua
Browse files

Merge sanja.is.com.ua:/home/bell/mysql/mysql-4.0

into sanja.is.com.ua:/home/bell/mysql/work-qc-4.0
parents e89f7666 0c5c517d
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -16394,7 +16394,7 @@ to restart @code{mysqld} with @code{--skip-grant-tables} to run
* Privilege changes::           When Privilege Changes Take Effect
* Default privileges::          Setting Up the Initial MySQL Privileges
* Adding users::                Adding New Users to MySQL
* User resources::              
* User resources::              Limiting user resources
* Passwords::                   Setting Up Passwords
* Password security::           Keeping Your Password Secure
* Secure connections::          Using Secure Connections
@@ -19104,6 +19104,8 @@ memory. This command will not remove any queries from the cache, unlike
@item @code{TABLES WITH READ LOCK} @tab Closes all open tables and locks all tables for all databases with a read until one executes @code{UNLOCK TABLES}. This is very convenient way to get backups if you have a filesystem, like Veritas,that can take snapshots in time.
@item @code{STATUS} @tab Resets most status variables to zero. This is something one should only use when debugging a query.
@item @code{USER_RESOURCES} @tab Resets all user resources to zero. This will enalbe blocked users to login again. @xref{User resources}.
@end multitable
You can also access each of the commands shown above with the @code{mysqladmin}
@@ -49696,7 +49698,8 @@ Optimised queries of type:
@item
@code{LOAD DATA FROM MASTER} ``auto-magically'' sets up a slave.
@item
Renamed @code{safe_mysqld} to @code{mysqld_safe}.
Renamed @code{safe_mysqld} to @code{mysqld_safe} to make this name more
in line with other MySQL scripts/commands.
@item
Added support for symbolic links to @code{MyISAM} tables. Symlink handling is
now enabled by default for Windows.
+42 −2
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ static struct option long_options[] =
#ifndef DBUG_OFF
  {"debug", 	  optional_argument, 	0, '#'},
#endif
  {"database",    required_argument,    0, 'd'},
  {"help", 	  no_argument, 		0, '?'},
  {"host", 	  required_argument,	0, 'h'},
  {"offset", 	  required_argument,	0, 'o'},
@@ -59,6 +60,8 @@ static struct option long_options[] =

void sql_print_error(const char *format,...);

static bool one_database = 0;
static const char* database;
static bool short_form = 0;
static ulonglong offset = 0;
static const char* host = "localhost";
@@ -103,7 +106,7 @@ static void die(const char* fmt, ...)

static void print_version()
{
  printf("%s  Ver 1.8 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
  printf("%s  Ver 1.9 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
}


@@ -127,6 +130,7 @@ the mysql command line client\n\n");
-?, --help		Display this help and exit\n\
-s, --short-form	Just show the queries, no extra info\n\
-o, --offset=N		Skip the first N entries\n\
-d, --database=database List entries for just this database (local log only)\n\
-h, --host=server	Get the binlog from server\n\
-P, --port=port         Use port to connect to the remote server\n\
-u, --user=username     Connect to the remote server as username\n\
@@ -173,7 +177,7 @@ static int parse_args(int *argc, char*** argv)
  int c, opt_index = 0;

  result_file = stdout;
  while((c = getopt_long(*argc, *argv, "so:#::h:j:u:p:P:r:t:?V", long_options,
  while((c = getopt_long(*argc, *argv, "so:#::d:h:j:u:p:P:r:t:?V", long_options,
			 &opt_index)) != EOF)
  {
    switch(c)
@@ -183,6 +187,11 @@ static int parse_args(int *argc, char*** argv)
      DBUG_PUSH(optarg ? optarg : default_dbug_option);
      break;
#endif
    case 'd':
      one_database = 1;
      database = my_strdup(optarg, MYF(0));
      break;

    case 's':
      short_form = 1;
      break;
@@ -473,6 +482,37 @@ Could not read entry at offset %s : Error in log format or read error",
    }
    if (rec_count >= offset)
    {
      // see if we should skip this event (only care about queries for now)
      if (one_database)
      {
        if (ev->get_type_code() == QUERY_EVENT)
        {
          //const char * log_dbname = ev->get_db();
          const char * log_dbname = ((Query_log_event*)ev)->db;
          //printf("entry: %llu, database: %s\n", rec_count, log_dbname);

          if ((log_dbname != NULL) && (strcmp(log_dbname, database)))
          {
            //printf("skipping, %s is not %s\n", log_dbname, database);
            rec_count++;
            delete ev;
            continue; // next
          }
#ifndef DBUG_OFF
          else
          {
            printf("no skip\n");
          }
#endif
        }
#ifndef DBUG_OFF
        else
        {
          const char * query_type = ev->get_type_str();
          printf("not query -- %s\n", query_type);
        }
#endif
      }
      if (!short_form)
        fprintf(result_file, "# at %s\n",llstr(old_off,llbuff));

+6 −0
Original line number Diff line number Diff line
drop table if exists t1;
create table t1 (id int auto_increment primary key not null, mydate date not null);
insert into t1 values (0,"2002-05-01"),(0,"2002-05-01"),(0,"2002-05-01");
flush tables;
select * from t1 where isnull(to_days(mydate));
id	mydate
drop table t1;
+4 −0
Original line number Diff line number Diff line
@@ -115,6 +115,10 @@ d d
SELECT * from t1 WHERE t1.d IS NULL;
d
0000-00-00
SELECT * FROM t1 WHERE 1/0 IS NULL;
d
2001-08-01
0000-00-00
DROP TABLE t1,t2;
CREATE TABLE t1 (
Document_ID varchar(50) NOT NULL default '',
+25 −0
Original line number Diff line number Diff line
@@ -146,3 +146,28 @@ t1 CREATE TABLE `t1` (
  KEY `b` (`b`)
) TYPE=MyISAM
drop table t1;
create table t1 (a decimal(9,2), b decimal (9,0), e double(9,2), f double(5,0), h float(3,2), i float(3,0));
show columns from t1;
Field	Type	Null	Key	Default	Extra
a	decimal(9,2)	YES		NULL	
b	decimal(9,0)	YES		NULL	
e	double(9,2)	YES		NULL	
f	double(5,0)	YES		NULL	
h	float(3,2)	YES		NULL	
i	float(3,0)	YES		NULL	
drop table t1;
create table t1 (c decimal, d double, f float, r real);
show columns from t1;
Field	Type	Null	Key	Default	Extra
c	decimal(10,0)	YES		NULL	
d	double	YES		NULL	
f	float	YES		NULL	
r	double	YES		NULL	
drop table t1;
create table t1 (c decimal(3,3), d double(3,3), f float(3,3));
show columns from t1;
Field	Type	Null	Key	Default	Extra
c	decimal(4,3)	YES		NULL	
d	double(4,3)	YES		NULL	
f	float(4,3)	YES		NULL	
drop table t1;
Loading