Commit 7788b06a authored by unknown's avatar unknown
Browse files

Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maint

into  qualinost.(none):/home/mtaylor/src/mysql-5.1-maint

parents 9416fe5c e0a63c81
Loading
Loading
Loading
Loading
+8 −13
Original line number Diff line number Diff line
@@ -76,19 +76,20 @@ typedef void * (__cdecl *pthread_handler)(void *);
  __int64 i64;
 };
struct timespec {
  union ft64 start;
  union ft64 tv;
  /* The max timeout value in millisecond for pthread_cond_timedwait */
  long timeout_msec;
  long max_timeout_msec;
};
#define set_timespec(ABSTIME,SEC) { \
  GetSystemTimeAsFileTime(&((ABSTIME).start.ft)); \
  (ABSTIME).timeout_msec= (long)((SEC)*1000); \
  GetSystemTimeAsFileTime(&((ABSTIME).tv.ft)); \
  (ABSTIME).tv.i64+= (__int64)(SEC)*10000000; \
  (ABSTIME).max_timeout_msec= (long)((SEC)*1000); \
}
#define set_timespec_nsec(ABSTIME,NSEC) { \
  GetSystemTimeAsFileTime(&((ABSTIME).start.ft)); \
  (ABSTIME).timeout_msec= (long)((NSEC)/1000000); \
  GetSystemTimeAsFileTime(&((ABSTIME).tv.ft)); \
  (ABSTIME).tv.i64+= (__int64)(NSEC)/100; \
  (ABSTIME).max_timeout_msec= (long)((NSEC)/1000000); \
}
#define get_timespec_sec(ABSTIME) ((((ABSTIME).start.i64 / 10000) + (ABSTIME).timeout_msec ) / 1000)

void win_pthread_init(void);
int win_pthread_setspecific(void *A,void *B,uint length);
@@ -410,9 +411,6 @@ int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
  (ABSTIME).ts_nsec= (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
}
#endif /* !set_timespec_nsec */
#ifndef get_timespec_sec
#define get_timespec_sec(ABSTIME) (ABSTIME).ts_sec
#endif /* !get_timespec_sec */
#else
#ifndef set_timespec
#define set_timespec(ABSTIME,SEC) \
@@ -431,9 +429,6 @@ int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
  (ABSTIME).tv_nsec= (long) (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
}
#endif /* !set_timespec_nsec */
#ifndef get_timespec_sec
#define get_timespec_sec(ABSTIME) (ABSTIME).tv_sec
#endif /* !get_timespec_sec */
#endif /* HAVE_TIMESPEC_TS_SEC */

	/* safe_mutex adds checking to mutex for easier debugging */
+3 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@
#ifndef _typelib_h
#define _typelib_h

#include "my_alloc.h"

typedef struct st_typelib {	/* Different types saved here */
  unsigned int count;		/* How many types */
  const char *name;		/* Name of typelib */
@@ -28,6 +30,7 @@ typedef struct st_typelib { /* Different types saved here */
extern int find_type(char *x,TYPELIB *typelib,unsigned int full_name);
extern void make_type(char *to,unsigned int nr,TYPELIB *typelib);
extern const char *get_type(TYPELIB *typelib,unsigned int nr);
extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from);

extern TYPELIB sql_protocol_typelib;

+16 −0
Original line number Diff line number Diff line
@@ -5816,4 +5816,20 @@ DROP TABLE bug23760, bug23760_log|
DROP PROCEDURE bug23760_update_log|
DROP PROCEDURE bug23760_test_row_count|
DROP FUNCTION bug23760_rc_test|
DROP PROCEDURE IF EXISTS bug24117|
DROP TABLE IF EXISTS t3|
CREATE TABLE t3(c1 ENUM('abc'))|
INSERT INTO t3 VALUES('abc')|
CREATE PROCEDURE bug24117()
BEGIN
DECLARE t3c1 ENUM('abc');
DECLARE mycursor CURSOR FOR SELECT c1 FROM t3;
OPEN mycursor;
FLUSH TABLES;
FETCH mycursor INTO t3c1;
CLOSE mycursor;
END|
CALL bug24117()|
DROP PROCEDURE bug24117|
DROP TABLE t3|
drop table t1,t2;
+4 −4
Original line number Diff line number Diff line
@@ -114,13 +114,13 @@ drop table t1;
show create table t1;
Table	Create Table
t1	CREATE TEMPORARY TABLE `t1` (
  `a` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TEST_DIR/var/log/'
  `a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/log/'
show create table t1;
Table	Create Table
t1	CREATE TEMPORARY TABLE `t1` (
  `a` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TEST_DIR/var/log/'
  `a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/log/'
create table t1 (a int) engine=myisam select 42 a;
select * from t1;
a
+24 −0
Original line number Diff line number Diff line
@@ -6778,6 +6778,30 @@ DROP PROCEDURE bug23760_update_log|
DROP PROCEDURE bug23760_test_row_count|
DROP FUNCTION bug23760_rc_test|

#
# BUG#24117: server crash on a FETCH with a cursor on a table which is not in
#            the table cache
#

--disable_warnings
DROP PROCEDURE IF EXISTS bug24117|
DROP TABLE IF EXISTS t3|
--enable_warnings
CREATE TABLE t3(c1 ENUM('abc'))|
INSERT INTO t3 VALUES('abc')|
CREATE PROCEDURE bug24117()
BEGIN
  DECLARE t3c1 ENUM('abc');
  DECLARE mycursor CURSOR FOR SELECT c1 FROM t3;
  OPEN mycursor;
  FLUSH TABLES;
  FETCH mycursor INTO t3c1;
  CLOSE mycursor;
END|
CALL bug24117()|
DROP PROCEDURE bug24117|
DROP TABLE t3|

#
# NOTE: The delimiter is `|`, and not `;`. It is changed to `;`
#       at the end of the file!
Loading