Commit edfc33be authored by unknown's avatar unknown

Merge mysql.com:/home/my/mysql-5.0

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


mysql-test/lib/mtr_report.pl:
  Auto merged
mysql-test/mysql-test-run.sh:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_test.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_lex.cc:
  manual merge
parents 80d86948 afe47152
......@@ -157,6 +157,7 @@ sub mtr_report_stats ($) {
my $tot_passed= 0;
my $tot_failed= 0;
my $tot_tests= 0;
my $found_problems= 0; # Some warnings are errors...
foreach my $tinfo (@$tests)
{
......@@ -214,8 +215,6 @@ sub mtr_report_stats ($) {
}
else
{
my $found_problems= 0; # Some warnings are errors...
# We report different types of problems in order
foreach my $pattern ( "^Warning:", "^Error:", "^==.* at 0x",
"InnoDB: Warning", "missing DBUG_RETURN",
......@@ -268,6 +267,9 @@ sub mtr_report_stats ($) {
}
}
print "\n";
}
if ( $tot_failed != 0 || $found_problems)
{
mtr_error("there where failing test cases");
}
}
......
......@@ -205,6 +205,7 @@ TOT_SKIP=0
TOT_PASS=0
TOT_FAIL=0
TOT_TEST=0
GOT_WARNINGS=0
USERT=0
SYST=0
REALT=0
......@@ -1077,17 +1078,16 @@ report_stats () {
| $SED -e 's!Warning: Table:.* on rename!!g' \
> $MY_LOG_DIR/warnings.tmp
found_error=0
# Find errors
for i in "^Warning:" "^Error:" "^==.* at 0x" "InnoDB: Warning" "missing DBUG_RETURN" "mysqld: Warning"
do
if $GREP "$i" $MY_LOG_DIR/warnings.tmp >> $MY_LOG_DIR/warnings
then
found_error=1
GOT_WARNINGS=1
fi
done
$RM -f $MY_LOG_DIR/warnings.tmp
if [ $found_error = "1" ]
if [ $GOT_WARNINGS = "1" ]
then
echo "WARNING: Got errors/warnings while running tests. Please examine"
echo "$MY_LOG_DIR/warnings for details."
......@@ -2300,6 +2300,8 @@ if [ $TOT_FAIL -ne 0 ]; then
$ECHO "mysql-test-run in $TEST_MODE mode: *** Failing the test(s):$FAILED_CASES"
$ECHO
exit 1
else
exit 0
fi
if [ $GOT_WARNINGS -ne 0 ]; then
exit 1
fi
exit 0
......@@ -186,8 +186,8 @@ a b a b a b
explain select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
1 SIMPLE t2 index PRIMARY PRIMARY 8 NULL 3 Using where; Using index
1 SIMPLE t3 index PRIMARY PRIMARY 8 NULL 3 Using where; Using index
1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a 1 Using index
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 8 test.t2.b,test.t1.b 1 Using index
delete t2.*,t3.* from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
select * from t3;
a b
......
......@@ -3390,3 +3390,24 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using where
DROP TABLE t1,t2;
CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL);
INSERT t1 SET i = 0;
UPDATE t1 SET i = -1;
Warnings:
Warning 1264 Out of range value adjusted for column 'i' at row 1
SELECT * FROM t1;
i
0
UPDATE t1 SET i = CAST(i - 1 AS SIGNED);
Warnings:
Warning 1264 Out of range value adjusted for column 'i' at row 1
SELECT * FROM t1;
i
0
UPDATE t1 SET i = i - 1;
Warnings:
Warning 1264 Out of range value adjusted for column 'i' at row 1
SELECT * FROM t1;
i
255
DROP TABLE t1;
......@@ -1354,10 +1354,10 @@ a
explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index
2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 Using index
2 DEPENDENT SUBQUERY t1 ref a a 10 func,test.t3.a 1167 Using where; Using index
2 DEPENDENT SUBQUERY t1 ref a a 5 func 1001 Using where; Using index
2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 Using where; Using index
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t1` join `test`.`t3` where ((`test`.`t1`.`b` = `test`.`t3`.`a`) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t1` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
insert into t1 values (3,31);
select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
a
......
......@@ -2871,3 +2871,18 @@ SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr
DROP TABLE t1,t2;
#
# Bug#18712: Truncation problem (needs just documenting and test
# cases to prevent fixing this accidently. It is intended behaviour)
#
CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL);
INSERT t1 SET i = 0;
UPDATE t1 SET i = -1;
SELECT * FROM t1;
UPDATE t1 SET i = CAST(i - 1 AS SIGNED);
SELECT * FROM t1;
UPDATE t1 SET i = i - 1;
SELECT * FROM t1;
DROP TABLE t1;
......@@ -1365,8 +1365,8 @@ bool mysql_manager_submit(void (*action)());
void print_where(COND *cond,const char *info);
void print_cached_tables(void);
void TEST_filesort(SORT_FIELD *sortorder,uint s_length);
void print_plan(JOIN* join, double read_time, double record_count,
uint idx, const char *info);
void print_plan(JOIN* join,uint idx, double record_count, double read_time,
double current_read_time, const char *info);
#endif
void mysql_print_status();
/* key.cc */
......
......@@ -196,6 +196,7 @@ void lex_start(THD *thd, const uchar *buf, uint length)
void lex_end(LEX *lex)
{
DBUG_ENTER("lex_end");
DBUG_PRINT("enter", ("lex: 0x%lx", (long) lex));
if (lex->yacc_yyss)
{
my_free(lex->yacc_yyss, MYF(0));
......
This diff is collapsed.
......@@ -230,8 +230,8 @@ TEST_join(JOIN *join)
*/
void
print_plan(JOIN* join, double read_time, double record_count,
uint idx, const char *info)
print_plan(JOIN* join, uint idx, double record_count, double read_time,
double current_read_time, const char *info)
{
uint i;
POSITION pos;
......@@ -245,13 +245,15 @@ print_plan(JOIN* join, double read_time, double record_count,
DBUG_LOCK_FILE;
if (join->best_read == DBL_MAX)
{
fprintf(DBUG_FILE,"%s; idx:%u, best: DBL_MAX, current:%g\n",
info, idx, read_time);
fprintf(DBUG_FILE,
"%s; idx:%u, best: DBL_MAX, atime: %g, itime: %g, count: %g\n",
info, idx, current_read_time, read_time, record_count);
}
else
{
fprintf(DBUG_FILE,"%s; idx: %u, best: %g, current: %g\n",
info, idx, join->best_read, read_time);
fprintf(DBUG_FILE,
"%s; idx:%u, best: %g, accumulated: %g, increment: %g, count: %g\n",
info, idx, join->best_read, current_read_time, read_time, record_count);
}
/* Print the tables in JOIN->positions */
......@@ -270,9 +272,9 @@ print_plan(JOIN* join, double read_time, double record_count,
Print the tables in JOIN->best_positions only if at least one complete plan
has been found. An indicator for this is the value of 'join->best_read'.
*/
fputs("BEST_POSITIONS: ", DBUG_FILE);
if (join->best_read < DBL_MAX)
{
fputs("BEST_POSITIONS: ", DBUG_FILE);
for (i= 0; i < idx ; i++)
{
pos= join->best_positions[i];
......
......@@ -943,7 +943,6 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table)
goto err;
}
if (!(table->view_tables=
(List<TABLE_LIST>*) new(thd->mem_root) List<TABLE_LIST>))
goto err;
......@@ -1194,6 +1193,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table)
old_lex->time_zone_tables_used= thd->lex->time_zone_tables_used;
result= !table->prelocking_placeholder && table->prepare_security(thd);
lex_end(thd->lex);
end:
if (arena)
thd->restore_active_arena(arena, &backup);
......@@ -1202,6 +1202,8 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table)
DBUG_RETURN(result);
err:
DBUG_ASSERT(thd->lex == table->view);
lex_end(thd->lex);
delete table->view;
table->view= 0; // now it is not VIEW placeholder
result= 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment