Commit c95ce34e authored by unknown's avatar unknown
Browse files

Merge bk-internal.mysql.com:/home/bk/mysql-4.1

into mysql.com:/home/my/mysql-4.1

parents 3d0f9d96 8ecae2e6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1008,6 +1008,7 @@ static void usage(void)
  print_defaults("my",load_default_groups);
  puts("\nWhere command is a one or more of: (Commands may be shortened)\n\
  create databasename	Create a new database\n\
  debug			Instruct server to write debug information to log\n\
  drop databasename	Delete a database and all its tables\n\
  extended-status       Gives an extended status message from the server\n\
  flush-hosts           Flush all cached hosts\n\
+13 −6
Original line number Diff line number Diff line
@@ -325,6 +325,19 @@ trim(trailing 'foo' from 'foo')
select trim(leading 'foo' from 'foo');
trim(leading 'foo' from 'foo')

select quote(ltrim(concat('    ', 'a')));
quote(ltrim(concat('    ', 'a')))
'a'
select quote(trim(concat('    ', 'a')));
quote(trim(concat('    ', 'a')))
'a'
CREATE TABLE t1 SELECT 1 UNION SELECT 2 UNION SELECT 3;
SELECT QUOTE('A') FROM t1;
QUOTE('A')
'A'
'A'
'A'
DROP TABLE t1;
select 1=_latin1'1';
1=_latin1'1'
1
@@ -691,12 +704,6 @@ select count(*) as total, left(c,10) as reg from t1 group by reg order by reg de
total	reg
10	2004-12-10
drop table t1;
select quote(ltrim(concat('    ', 'a')));
quote(ltrim(concat('    ', 'a')))
'a'
select quote(trim(concat('    ', 'a')));
quote(trim(concat('    ', 'a')))
'a'
select trim(null from 'kate') as "must_be_null";
must_be_null
NULL
+12 −6
Original line number Diff line number Diff line
@@ -195,6 +195,18 @@ select trim(trailing 'foo' from 'foo');
select trim(leading 'foo' from 'foo');

#
# crashing bug with QUOTE() and LTRIM() or TRIM() fixed
# Bug #7495
#

select quote(ltrim(concat('    ', 'a')));
select quote(trim(concat('    ', 'a')));

# Bad results from QUOTE(). Bug #8248
CREATE TABLE t1 SELECT 1 UNION SELECT 2 UNION SELECT 3;
SELECT QUOTE('A') FROM t1;
DROP TABLE t1;

# Test collation and coercibility
#

@@ -429,12 +441,6 @@ create table t1 (a int not null primary key, b varchar(40), c datetime);
insert into t1 (a,b,c) values (1,'Tom','2004-12-10 12:13:14'),(2,'ball games','2004-12-10 12:13:14'), (3,'Basil','2004-12-10 12:13:14'), (4,'Dean','2004-12-10 12:13:14'),(5,'Ellis','2004-12-10 12:13:14'), (6,'Serg','2004-12-10 12:13:14'), (7,'Sergei','2004-12-10 12:13:14'),(8,'Georg','2004-12-10 12:13:14'),(9,'Salle','2004-12-10 12:13:14'),(10,'Sinisa','2004-12-10 12:13:14'); 
select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12;
drop table t1;
# crashing bug with QUOTE() and LTRIM() or TRIM() fixed
# Bug #7495
#

select quote(ltrim(concat('    ', 'a')));
select quote(trim(concat('    ', 'a')));

#
# Bug#7455 unexpected result: TRIM(<NULL> FROM <whatever>) gives NOT NULL
+8 −4
Original line number Diff line number Diff line
@@ -107,7 +107,10 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \
  client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \
  client/mysqldump$BS client/mysqlimport$BS \
  client/mysqltest$BS client/mysqlcheck$BS \
  client/mysqlbinlog$BS 
  client/mysqlbinlog$BS \
  tests/mysql_client_test$BS \
  libmysqld/examples/mysql_client_test_embedded$BS \
  libmysqld/examples/mysqltest_embedded$BS \
  ";

# Platform-specific bin dir files:
@@ -127,8 +130,9 @@ else
    client/.libs/mysqltest client/.libs/mysqlcheck \
    client/.libs/mysqlbinlog client/.libs/mysqlmanagerc \
    client/.libs/mysqlmanager-pwgen tools/.libs/mysqlmanager \
    tests/.libs/mysql_client_test libmysqld/examples/mysql_client_test_embedded \
    libmysqld/examples/mysqltest_embedded \
    tests/.libs/mysql_client_test \
    libmysqld/examples/.libs/mysql_client_test_embedded \
    libmysqld/examples/.libs/mysqltest_embedded \
  ";
fi

+6 −11
Original line number Diff line number Diff line
@@ -2614,18 +2614,13 @@ String *Item_func_quote::val_str(String *str)
  for (from= (char*) arg->ptr(), end= from + arg_length; from < end; from++)
    new_length+= get_esc_bit(escmask, (uchar) *from);

  /*
    We have to use realloc() instead of alloc() as we want to keep the
    old result in arg
  */
  if (arg->realloc(new_length))
  if (tmp_value.alloc(new_length))
    goto null;

  /*
    As 'arg' and 'str' may be the same string, we must replace characters
    from the end to the beginning
    We replace characters from the end to the beginning
  */
  to= (char*) arg->ptr() + new_length - 1;
  to= (char*) tmp_value.ptr() + new_length - 1;
  *to--= '\'';
  for (start= (char*) arg->ptr(),end= start + arg_length; end-- != start; to--)
  {
@@ -2653,10 +2648,10 @@ String *Item_func_quote::val_str(String *str)
    }
  }
  *to= '\'';
  arg->length(new_length);
  str->set_charset(collation.collation);
  tmp_value.length(new_length);
  tmp_value.set_charset(collation.collation);
  null_value= 0;
  return arg;
  return &tmp_value;

null:
  null_value= 1;
Loading