Commit 7553eece authored by Timothy Smith's avatar Timothy Smith
Browse files

Merge from upstream (my:5.0-bugteam)

parents 0632a93e 790edf00
Loading
Loading
Loading
Loading
+9 −33
Original line number Diff line number Diff line
@@ -1779,7 +1779,7 @@ static int read_and_execute(bool interactive)
        the very beginning of a text file when
        you save the file using "Unicode UTF-8" format.
      */
      if (!line_number &&
      if (line && !line_number &&
           (uchar) line[0] == 0xEF &&
           (uchar) line[1] == 0xBB &&
           (uchar) line[2] == 0xBF)
@@ -2081,37 +2081,6 @@ static bool add_line(String &buffer,char *line,char *in_string,
	continue;
      }
    }
    else if (!*ml_comment && !*in_string &&
             (end_of_line - pos) >= 10 &&
             !my_strnncoll(charset_info, (uchar*) pos, 10,
                           (const uchar*) "delimiter ", 10))
    {
      // Flush previously accepted characters
      if (out != line)
      {
        buffer.append(line, (uint32) (out - line));
        out= line;
      }

      // Flush possible comments in the buffer
      if (!buffer.is_empty())
      {
        if (com_go(&buffer, 0) > 0) // < 0 is not fatal
          DBUG_RETURN(1);
        buffer.length(0);
      }

      /*
        Delimiter wants the get rest of the given line as argument to
        allow one to change ';' to ';;' and back
      */
      buffer.append(pos);
      if (com_delimiter(&buffer, pos) > 0)
        DBUG_RETURN(1);

      buffer.length(0);
      break;
    }
    else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter))
    {
      // Found a statement. Continue parsing after the delimiter
@@ -2156,7 +2125,14 @@ static bool add_line(String &buffer,char *line,char *in_string,
    }
    else if (!*ml_comment && (!*in_string && (inchar == '#' ||
			      inchar == '-' && pos[1] == '-' &&
			      my_isspace(charset_info,pos[2]))))
                              /*
                                The third byte is either whitespace or is the
                                end of the line -- which would occur only
                                because of the user sending newline -- which is
                                itself whitespace and should also match.
                              */
			      (my_isspace(charset_info,pos[2]) ||
                               !pos[2]))))
    {
      // Flush previously accepted characters
      if (out != line)
+59 −0
Original line number Diff line number Diff line
# include/wait_condition.inc
#
# SUMMARY
#
#    Waits until the passed statement returns true, or the operation
#    times out.
#
# USAGE
#
#    let $wait_condition=
#      SELECT c = 3 FROM t;
#    --source include/wait_condition.inc
#
#   OR
#
#    let $wait_timeout= 60; # Override default 30 seconds with 60.
#    let $wait_condition=
#      SELECT c = 3 FROM t;
#    --source include/wait_condition.inc
#    --echo Executed the test condition $wait_condition_reps times
#
# EXAMPLE
#    events_bugs.test, events_time_zone.test
#

--disable_query_log

let $wait_counter= 300;
if ($wait_timeout)
{
  let $wait_counter= `SELECT $wait_timeout * 10`;
}
# Reset $wait_timeout so that its value won't be used on subsequent
# calls, and default will be used instead.
let $wait_timeout= 0;

# Keep track of how many times the wait condition is tested
# This is used by some tests (e.g., main.status)
let $wait_condition_reps= 0;
while ($wait_counter)
{
    let $success= `$wait_condition`;
    inc $wait_condition_reps;
    if ($success)
    {
        let $wait_counter= 0;
    }
    if (!$success)
    {
        real_sleep 0.1;
        dec $wait_counter;
    }
}
if (!$success)
{
  echo Timeout in wait_condition.inc for $wait_condition;
}

--enable_query_log
+2 −0
Original line number Diff line number Diff line
@@ -38,6 +38,8 @@ t2
t3
Tables_in_test
t1
delimiter
1
_
Test delimiter : from command line
a
+31 −0
Original line number Diff line number Diff line
@@ -78,3 +78,34 @@ alter table t1 modify a varchar(255);
select length(a) from t1;
length(a)
6
select 0b01000001;
0b01000001
A
select 0x41;
0x41
A
select b'01000001';
b'01000001'
A
select x'41', 0+x'41';
x'41'	0+x'41'
A	65
select N'abc', length(N'abc');
abc	length(N'abc')
abc	3
select N'', length(N'');
	length(N'')
	0
select '', length('');
	length('')
	0
select b'', 0+b'';
b''	0+b''
	0
select x'', 0+x'';
x''	0+x''
	0
select 0x;
ERROR 42S22: Unknown column '0x' in 'field list'
select 0b;
ERROR 42S22: Unknown column '0b' in 'field list'
+0 −1
Original line number Diff line number Diff line
@@ -84,4 +84,3 @@ SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
FROM information_schema.columns
$my_where
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
Loading