summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BUILD/FINISH.sh5
-rw-r--r--Docs/manual.texi8
-rw-r--r--acconfig.h8
-rw-r--r--configure.in9
-rw-r--r--include/my_pthread.h18
-rw-r--r--mysql-test/r/func_str.result3
-rw-r--r--mysql-test/r/func_timestamp.result3
-rw-r--r--mysql-test/t/func_str.test9
-rw-r--r--mysql-test/t/func_timestamp.test12
-rw-r--r--mysql-test/t/order_by.test2
-rw-r--r--mysys/my_pthread.c4
-rw-r--r--sql/sql_parse.cc2
12 files changed, 46 insertions, 37 deletions
diff --git a/BUILD/FINISH.sh b/BUILD/FINISH.sh
index 089ff19a7be..decfe5021b4 100644
--- a/BUILD/FINISH.sh
+++ b/BUILD/FINISH.sh
@@ -14,7 +14,8 @@ fi
$make $AM_MAKEFLAGS
if [ "x$strip" = "xyes" ]; then
- nm --numeric-sort sql/mysqld > mysqld.sym
- objdump -d sql/mysqld > mysqld.S
+ mkdir -p tmp
+ nm --numeric-sort sql/mysqld > tmp/mysqld.sym
+ objdump -d sql/mysqld > tmp/mysqld.S
strip sql/mysqld
fi
diff --git a/Docs/manual.texi b/Docs/manual.texi
index 52b53097747..34b78598089 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -18274,6 +18274,9 @@ exist.
@code{RESTRICT} and @code{CASCADE} are allowed to make porting easier.
For the moment they don't do anything.
+@strong{NOTE}: @code{DROP TABLE} is not transaction safe and will
+automaticly commit any active transactions.
+
@cindex tables, defragment
@cindex tables, fragmentation
@findex OPTIMIZE TABLE
@@ -21276,6 +21279,9 @@ You can also lock all tables in all databases with read locks with the
convinient way to get backups if you have a file system, like Veritas,
that can take snapshots in time.
+@strong{NOTE}: @code{LOCK TABLES} is not transaction safe and will
+automaticly commit any active transactions before attempting to lock the
+tables.
@findex SET OPTION
@node SET OPTION, GRANT, LOCK TABLES, Reference
@@ -40018,6 +40024,8 @@ though, so Version 3.23 is not released as a stable version yet.
@appendixsubsec Changes in release 3.23.30
@itemize @bullet
@item
+@code{LOCK TABLES} will now automaticly start a new transaction.
+@item
Changed BDB tables to not use internal subtransactions and reuse open files to
get more speed.
@item
diff --git a/acconfig.h b/acconfig.h
index b0b6a3aae64..f56627efdc9 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -68,12 +68,12 @@
/* READLINE: */
#undef HAVE_GETPW_DECLS
-/* In OSF 4.0f the 3'd argument to gethostname_r is hostent_data * */
-#undef HAVE_GETHOSTBYNAME_R_WITH_HOSTENT_DATA
-
/* Solaris define gethostbyname_r with 5 arguments. glibc2 defines
this with 6 arguments */
-#undef HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R
+#undef HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE
+
+/* In OSF 4.0f the 3'd argument to gethostname_r is hostent_data * */
+#undef HAVE_GETHOSTBYNAME_R_RETURN_INT
/* Define if int8, int16 and int32 types exist */
#undef HAVE_INT_8_16_32
diff --git a/configure.in b/configure.in
index bb39772af1b..4a0acd2ab0b 100644
--- a/configure.in
+++ b/configure.in
@@ -728,11 +728,6 @@ case $SYSTEM_TYPE in
fi
CXXFLAGS="-D_BOOL"
;;
- *dec-osf4*)
- echo "Adding fix to not use gethostbyname_r"
- CFLAGS="$CFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R"
- CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R"
- ;;
*aix4.3*)
echo "Adding defines for AIX"
CFLAGS="$CFLAGS -Wa,-many -DUNDEF_HAVE_INITGROUPS"
@@ -1341,7 +1336,7 @@ AC_LANG_RESTORE
CXXFLAGS="$ac_save_CXXFLAGS"
if test "$mysql_cv_gethostname_style" = "glibc2"
then
- AC_DEFINE(HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R)
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE)
fi
# Check 3rd argument of getthostbyname_r
@@ -1371,7 +1366,7 @@ AC_LANG_RESTORE
CXXFLAGS="$ac_save_CXXFLAGS"
if test "$mysql_cv_gethostname_arg" = "hostent_data"
then
- AC_DEFINE(HAVE_GETHOSTBYNAME_R_WITH_HOSTENT_DATA)
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_RETURN_INT)
fi
diff --git a/include/my_pthread.h b/include/my_pthread.h
index e5d827f2332..da4e104064e 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -234,7 +234,7 @@ extern int my_pthread_create_detached;
#define HAVE_LOCALTIME_R
#undef HAVE_PTHREAD_ATTR_SETSCOPE
#define HAVE_PTHREAD_ATTR_SETSCOPE
-#undef HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R /* If we are running linux */
+#undef HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE /* If we are running linux */
#undef HAVE_RWLOCK_T
#undef HAVE_RWLOCK_INIT
#undef HAVE_PTHREAD_RWLOCK_RDLOCK
@@ -378,28 +378,30 @@ struct tm *localtime_r(const time_t *clock, struct tm *res);
#define HAVE_PTHREAD_KILL
#endif
-#if defined(HAVE_PTHREAD_ATTR_CREATE) || defined(_AIX) || defined(HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R)
+#if defined(HAVE_PTHREAD_ATTR_CREATE) || defined(_AIX) || defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE)
#if !defined(HPUX)
struct hostent;
#endif /* HPUX */
struct hostent *my_gethostbyname_r(const char *name,
struct hostent *result, char *buffer,
int buflen, int *h_errnop);
-#if defined(HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R)
+#if defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE)
#define GETHOSTBYNAME_BUFF_SIZE 2048
#else
#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data)
-#endif /* defined(HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R) */
+#endif /* defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) */
#else
-#ifdef HAVE_GETHOSTBYNAME_R_WITH_HOSTENT_DATA
+#ifdef HAVE_GETHOSTBYNAME_R_RETURN_INT
#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data)
-#define my_gethostbyname_r(A,B,C,D,E) gethostbyname_r((A),(B),(struct hostent_data*) (C))
+struct hostent *my_gethostbyname_r(const char *name,
+ struct hostent *result, char *buffer,
+ int buflen, int *h_errnop);
#else
#define GETHOSTBYNAME_BUFF_SIZE 2048
#define my_gethostbyname_r(A,B,C,D,E) gethostbyname_r((A),(B),(C),(D),(E))
-#endif /* HAVE_GETHOSTBYNAME_R_WITH_HOSTENT_DATA */
-#endif /* defined(HAVE_PTHREAD_ATTR_CREATE) || defined(_AIX) || defined(HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R) */
+#endif /* HAVE_GETHOSTBYNAME_R_RETURN_INT */
+#endif /* defined(HAVE_PTHREAD_ATTR_CREATE) || defined(_AIX) || defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) */
#endif /* defined(__WIN__) */
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index fbf3aad6636..aac051d00fa 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -90,9 +90,6 @@ length(repeat("a",65500)) length(concat(repeat("a",32000),repeat("a",32000))) le
65500 64000 50000 60000
length(repeat("a",1000000)) length(concat(repeat("a",32000),repeat("a",32000),repeat("a",32000))) length(replace("aaaaa","a",concat(repeat("a",32000)))) length(insert(repeat("a",48000),1,1000,repeat("a",48000)))
1000000 96000 160000 95000
-Date Unix
-1998-9-16 09:26:00 905927160
-1998-9-16 09:26:00 905927160
domain
hello.de
domain
diff --git a/mysql-test/r/func_timestamp.result b/mysql-test/r/func_timestamp.result
new file mode 100644
index 00000000000..4d4a5b541ac
--- /dev/null
+++ b/mysql-test/r/func_timestamp.result
@@ -0,0 +1,3 @@
+Date Unix
+1998-9-16 09:26:00 905927160
+1998-9-16 09:26:00 905927160
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index e5ca1bd1d74..51af2766dae 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -64,15 +64,6 @@ select length(repeat("a",1000000)),length(concat(repeat("a",32000),repeat("a",32
# Problem med concat
#
-drop table if exists t1;
-create table t1 (Zeit time, Tag tinyint not null, Monat tinyint not null, Jahr smallint not null, index(Tag), index(Monat), index(Jahr) );
-insert into t1 values ("09:26:00",16,9,1998);
-insert into t1 values ("09:26:00",16,9,1998);
-SELECT CONCAT(Jahr,'-',Monat,'-',Tag,' ',Zeit) AS Date,
- UNIX_TIMESTAMP(CONCAT(Jahr,'-',Monat,'-',Tag,' ',Zeit)) AS Unix
-FROM t1;
-drop table t1;
-
create table t1 ( domain char(50) );
insert into t1 VALUES ("hello.de" ), ("test.de" );
select domain from t1 where concat('@', trim(leading '.' from concat('.', domain))) = '@hello.de';
diff --git a/mysql-test/t/func_timestamp.test b/mysql-test/t/func_timestamp.test
new file mode 100644
index 00000000000..74e541f782d
--- /dev/null
+++ b/mysql-test/t/func_timestamp.test
@@ -0,0 +1,12 @@
+#
+# Tests that depend on the timestamp and the TZ variable
+#
+
+drop table if exists t1;
+create table t1 (Zeit time, Tag tinyint not null, Monat tinyint not null,
+Jahr smallint not null, index(Tag), index(Monat), index(Jahr) );
+insert into t1 values ("09:26:00",16,9,1998),("09:26:00",16,9,1998);
+SELECT CONCAT(Jahr,'-',Monat,'-',Tag,' ',Zeit) AS Date,
+ UNIX_TIMESTAMP(CONCAT(Jahr,'-',Monat,'-',Tag,' ',Zeit)) AS Unix
+FROM t1;
+drop table t1;
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index 9e878b21f93..86d66e6b540 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -74,7 +74,7 @@ select distinct i from t1;
select distinct i from t1 order by rand(5);
select distinct i from t1 order by i desc;
select distinct i from t1 order by 1-i;
-select distinct i from t1 order by mod(i,2);
+select distinct i from t1 order by mod(i,2),i;
drop table t1;
#
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c
index f54e11eae8b..b450bba473d 100644
--- a/mysys/my_pthread.c
+++ b/mysys/my_pthread.c
@@ -417,7 +417,7 @@ int my_pthread_cond_init(pthread_cond_t *mp, const pthread_condattr_t *attr)
#if !defined(my_gethostbyname_r) && defined(HAVE_GETHOSTBYNAME_R)
-#if defined(HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R)
+#if defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE)
struct hostent *my_gethostbyname_r(const char *name,
struct hostent *result, char *buffer,
@@ -430,7 +430,7 @@ struct hostent *my_gethostbyname_r(const char *name,
return hp;
}
-#elif defined(_HPUX_SOURCE) || (defined(_AIX) && !defined(_AIX32_THREADS))
+#elif defined(HAVE_GETHOSTBYNAME_R_RETURN_INT)
struct hostent *my_gethostbyname_r(const char *name,
struct hostent *result, char *buffer,
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 85ef7d24d67..c1c27ec3192 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1652,7 +1652,7 @@ mysql_execute_command(void)
thd->locked_tables=0; // Will be automaticly closed
close_thread_tables(thd);
}
- if (check_db_used(thd,tables))
+ if (check_db_used(thd,tables) || end_active_trans(thd))
goto error;
thd->in_lock_tables=1;
if (!(res=open_and_lock_tables(thd,tables)))