Commit 7de63549 authored by Kristofer.Pettersson@naruto's avatar Kristofer.Pettersson@naruto

Merge kpettersson@bk-internal:/home/bk/mysql-5.0-maint

into  naruto.:C:/cpp/mysql-5.0-maint
parents 8ccb555b 160a3dce
......@@ -109,7 +109,11 @@ dist-hook:
tags:
support-files/build-tags
.PHONY: init-db bin-dist
.PHONY: init-db bin-dist \
test test-force test-full test-force-full test-force-mem \
test-pl test-force-pl test-full-pl test-force-full-pl test-force-pl-mem \
test-ps test-ns
# Target 'test' will run the regression test suite using the built server.
#
......@@ -119,21 +123,33 @@ tags:
# will then calculate the various port numbers it needs from this,
# making sure each user use different ports.
test:
test-ps:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl $(force) --ps-protocol
test-ns:
cd mysql-test ; \
./mysql-test-run && \
./mysql-test-run --ps-protocol
@PERL@ ./mysql-test-run.pl $(force)
test: test-ns test-ps
# To ease script-writing, although in 5.0 it is identical to 'test'
test-full: test
test-force:
cd mysql-test; \
./mysql-test-run --force && \
./mysql-test-run --ps-protocol --force
$(MAKE) force=--force test
test-force-mem:
cd mysql-test; \
./mysql-test-run --force --mem && \
./mysql-test-run --ps-protocol --force --mem
test-force-full:
$(MAKE) force=--force test-full
#used by autopush.pl to run memory based tests
test-force-mem:
$(MAKE) 'force=--force --mem' test
# Keep these for a while
test-pl: test
test-full-pl: test-full
test-force-pl: test-force
test-force-pl-mem: test-force-mem
test-force-full-pl: test-force-full
......@@ -1310,6 +1310,25 @@ static int dump_local_log_entries(const char* logname)
}
else // reading from stdin;
{
/*
Bug fix: #23735
Author: Chuck Bell
Description:
Windows opens stdin in text mode by default. Certain characters
such as CTRL-Z are interpeted as events and the read() method
will stop. CTRL-Z is the EOF marker in Windows. to get past this
you have to open stdin in binary mode. Setmode() is used to set
stdin in binary mode. Errors on setting this mode result in
halting the function and printing an error message to stderr.
*/
#if defined (__WIN__) || (_WIN64)
if (_setmode(fileno(stdin), O_BINARY) == -1)
{
fprintf(stderr, "Could not set binary mode on stdin.\n");
return 1;
}
#endif
if (init_io_cache(file, fileno(stdin), 0, READ_CACHE, (my_off_t) 0,
0, MYF(MY_WME | MY_NABP | MY_DONT_CHECK_FILESIZE)))
return 1;
......
......@@ -103,6 +103,7 @@ static my_bool disable_query_log= 0, disable_result_log= 0;
static my_bool disable_warnings= 0, disable_ps_warnings= 0;
static my_bool disable_info= 1;
static my_bool abort_on_error= 1;
static my_bool server_initialized= 0;
static char **default_argv;
static const char *load_default_groups[]= { "mysqltest", "client", 0 };
......@@ -770,13 +771,18 @@ void free_used_memory()
free_all_replace();
my_free(pass,MYF(MY_ALLOW_ZERO_PTR));
free_defaults(default_argv);
mysql_server_end();
free_re();
#ifdef __WIN__
free_tmp_sh_file();
free_win_path_patterns();
#endif
DBUG_VOID_RETURN;
/* Only call mysql_server_end if mysql_server_init has been called */
if (server_initialized)
mysql_server_end();
/* Don't use DBUG after mysql_server_end() */
return;
}
......@@ -1240,7 +1246,9 @@ void var_set(const char *var_name, const char *var_name_end,
v->int_dirty= 0;
v->str_val_len= strlen(v->str_val);
}
strxmov(buf, v->name, "=", v->str_val, NullS);
my_snprintf(buf, sizeof(buf), "%.*s=%.*s",
v->name_len, v->name,
v->str_val_len, v->str_val);
if (!(v->env_s= my_strdup(buf, MYF(MY_WME))))
die("Out of memory");
putenv(v->env_s);
......@@ -4679,10 +4687,9 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
}
/*
Store the result. If res is NULL, use mysql_field_count to
determine if that was expected
Store the result of the query if it will return any fields
*/
if (!(res= mysql_store_result(mysql)) && mysql_field_count(mysql))
if (mysql_field_count(mysql) && ((res= mysql_store_result(mysql)) == 0))
{
handle_error(command, mysql_errno(mysql), mysql_error(mysql),
mysql_sqlstate(mysql), ds);
......@@ -4734,7 +4741,10 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
}
if (res)
{
mysql_free_result(res);
res= 0;
}
counter++;
} while (!(err= mysql_next_result(mysql)));
if (err > 0)
......@@ -4801,7 +4811,7 @@ void handle_error(struct st_command *command,
err_errno, err_error);
/* Abort the run of this test, pass the failed query as reason */
abort_not_supported_test("Query '%s' failed, required functionality" \
abort_not_supported_test("Query '%s' failed, required functionality " \
"not supported", command->query);
}
......@@ -5621,6 +5631,7 @@ int main(int argc, char **argv)
embedded_server_args,
(char**) embedded_server_groups))
die("Can't initialize MySQL server");
server_initialized= 1;
if (cur_file == file_stack && cur_file->file == 0)
{
cur_file->file= stdin;
......
......@@ -65,9 +65,9 @@ typedef int my_socket;
#endif /* my_socket_defined */
#endif /* _global_h */
#include "mysql_version.h"
#include "mysql_com.h"
#include "mysql_time.h"
#include "mysql_version.h"
#include "typelib.h"
#include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */
......
......@@ -575,6 +575,7 @@ enum mysql_enum_shutdown_level
SHUTDOWN_WAIT_UPDATES = (unsigned char)((1 << 3)),
SHUTDOWN_WAIT_ALL_BUFFERS = ((unsigned char)((1 << 3)) << 1),
SHUTDOWN_WAIT_CRITICAL_BUFFERS = (((unsigned char)((1 << 3)) << 1) + 1),
KILL_QUERY = 254,
KILL_CONNECTION = 255,
};
# 154 "mysql.h"
......
......@@ -98,7 +98,7 @@ install-data-local:
$(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.pem $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.frm $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.MY* $(distdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.MY* $(DESTDIR)$(distdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/lib/init_db.sql $(DESTDIR)$(testdir)/lib
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib
......
......@@ -350,5 +350,9 @@ select some_id from t1 where some_id not in(-4,-1,3423534,2342342);
some_id
1
2
select some_id from t1 where some_id not in('-1', '0');
some_id
1
2
drop table t1;
End of 5.0 tests
......@@ -252,6 +252,13 @@ insert into t1 values (1),(2);
select some_id from t1 where some_id not in(2,-1);
select some_id from t1 where some_id not in(-4,-1,-4);
select some_id from t1 where some_id not in(-4,-1,3423534,2342342);
#
# BUG#24261: crash when WHERE contains NOT IN ('<negative value>') for unsigned column type
#
select some_id from t1 where some_id not in('-1', '0');
drop table t1;
......
......@@ -76,11 +76,14 @@ insert into t2 select id from t1;
create table t3 (kill_id int);
insert into t3 values(connection_id());
connect (conn2, localhost, root,,);
connection conn2;
connection conn1;
-- disable_result_log
send select id from t1 where id in (select distinct id from t2);
-- enable_result_log
connect (conn2, localhost, root,,);
connection conn2;
select ((@id := kill_id) - kill_id) from t3;
-- sleep 1
......
......@@ -15,7 +15,7 @@
database=db1
EOF
--replace_regex /\/.*mysqladmin/mysqladmin/
--replace_regex /.*mysqladmin.*: unknown/mysqladmin: unknown/
--error 7
--exec $MYSQLADMIN --defaults-file=$MYSQLTEST_VARDIR/tmp/bug10608.cnf -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1
......@@ -27,6 +27,6 @@ EOF
loose-database=db2
EOF
--replace_regex /Warning: .*mysqladmin/Warning: mysqladmin/
--replace_regex /Warning: .*mysqladmin.*: unknown/Warning: mysqladmin: unknown/
--exec $MYSQLADMIN --defaults-file=$MYSQLTEST_VARDIR/tmp/bug10608.cnf -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1
......@@ -70,6 +70,7 @@ static void default_reporter(enum loglevel level,
fprintf(stderr, "%s", "Info: ");
vfprintf(stderr, format, args);
va_end(args);
fflush(stderr);
}
/*
......
......@@ -245,7 +245,7 @@ $CP mysql-test/t/*.def $BASE/mysql-test/t
$CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \
mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \
mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \
mysql-test/std_data/*.cnf \
mysql-test/std_data/*.cnf mysql-test/std_data/*.MY* \
$BASE/mysql-test/std_data
$CP mysql-test/t/*.test mysql-test/t/*.imtest \
mysql-test/t/*.disabled mysql-test/t/*.opt \
......
......@@ -3703,7 +3703,8 @@ static SEL_TREE *get_func_mm_tree(PARAM *param, Item_func *cond_func,
for (uint idx= 0; idx < param->keys; idx++)
{
SEL_ARG *new_interval, *last_val;
if (((new_interval= tree2->keys[idx])) &&
if (((new_interval= tree2->keys[idx])) &&
(tree->keys[idx]) &&
((last_val= tree->keys[idx]->last())))
{
new_interval->min_value= last_val->max_value;
......
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