Commit 11e295ad authored by unknown's avatar unknown

Merge bk-internal:/home/bk/mysql-5.1-new

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

parents 58faa569 fea723f9
......@@ -32,7 +32,7 @@
#include <my_net.h>
#include <my_getopt.h>
#if !defined(_AIX) && !defined(HAVE_UNIXWARE7_THREADS) && !defined(HAVE_UNIXWARE7_POSIX) && !defined(h_errno)
#if !defined(_AIX) && !defined(h_errno)
extern int h_errno;
#endif
......
......@@ -34,19 +34,6 @@
/* need by my_vsnprintf */
#include <stdarg.h>
/* Correct some things for UNIXWARE7 */
#ifdef HAVE_UNIXWARE7_THREADS
#undef HAVE_STRINGS_H
#undef HAVE_MEMORY_H
#define HAVE_MEMCPY
#ifndef HAVE_MEMMOVE
#define HAVE_MEMMOVE
#endif
#undef HAVE_BCMP
#undef bcopy
#undef bcmp
#undef bzero
#endif /* HAVE_UNIXWARE7_THREADS */
#ifdef _AIX
#undef HAVE_BCMP
#endif
......
......@@ -208,7 +208,6 @@
#undef THREAD
#undef HAVE_LINUXTHREADS
#undef HAVE_NPTL
#undef HAVE_UNIXWARE7_THREADS
#endif
#ifdef HAVE_THREADS_WITHOUT_SOCKETS
......@@ -264,9 +263,6 @@
#if !defined(_THREAD_SAFE) && !defined(_AIX)
#define _THREAD_SAFE /* Required for OSF1 */
#endif
#ifdef HAVE_UNIXWARE7_THREADS
#include <thread.h>
#else
#if defined(HPUX10) || defined(HPUX11)
C_MODE_START /* HPUX needs this, signal.h bug */
#include <pthread.h>
......@@ -274,7 +270,6 @@ C_MODE_END
#else
#include <pthread.h> /* AIX must have this included first */
#endif
#endif /* HAVE_UNIXWARE7_THREADS */
#if !defined(SCO) && !defined(_REENTRANT)
#define _REENTRANT 1 /* Threads requires reentrant code */
#endif
......
......@@ -27,10 +27,6 @@
Case in point: 'mf_keycache.c'
*/
#if defined(__WIN__)
#elif defined(HAVE_UNIXWARE7_THREADS)
/* #include <thread.h> Currently, not relevant. Enable if needed. */
#else /* Normal threads */
#include <pthread.h>
......
......@@ -142,68 +142,6 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
/*#define my_pthread_getprio(pthread_t thread_id) pthread_dummy(0) */
#define my_pthread_getprio(thread_id) pthread_dummy(0)
#elif defined(HAVE_UNIXWARE7_THREADS)
#include <thread.h>
#include <synch.h>
#ifndef _REENTRANT
#define _REENTRANT
#endif
#define HAVE_NONPOSIX_SIGWAIT
#define pthread_t thread_t
#define pthread_cond_t cond_t
#define pthread_mutex_t mutex_t
#define pthread_key_t thread_key_t
typedef int pthread_attr_t; /* Needed by Unixware 7.0.0 */
#define pthread_key_create(A,B) thr_keycreate((A),(B))
#define pthread_key_delete(A) thr_keydelete(A)
#define pthread_handler_t EXTERNC void *
#define pthread_key(T,V) pthread_key_t V
void * my_pthread_getspecific_imp(pthread_key_t key);
#define my_pthread_getspecific(A,B) ((A) my_pthread_getspecific_imp(B))
#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,V)
#define pthread_setspecific(A,B) thr_setspecific(A,B)
#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,V)
#define pthread_create(A,B,C,D) thr_create(NULL,65536L,(C),(D),THR_DETACHED,(A))
#define pthread_cond_init(a,b) cond_init((a),USYNC_THREAD,NULL)
#define pthread_cond_destroy(a) cond_destroy(a)
#define pthread_cond_signal(a) cond_signal(a)
#define pthread_cond_wait(a,b) cond_wait((a),(b))
#define pthread_cond_timedwait(a,b,c) cond_timedwait((a),(b),(c))
#define pthread_cond_broadcast(a) cond_broadcast(a)
#define pthread_mutex_init(a,b) mutex_init((a),USYNC_THREAD,NULL)
#define pthread_mutex_lock(a) mutex_lock(a)
#define pthread_mutex_unlock(a) mutex_unlock(a)
#define pthread_mutex_destroy(a) mutex_destroy(a)
#define pthread_self() thr_self()
#define pthread_exit(A) thr_exit(A)
#define pthread_equal(A,B) (((A) == (B)) ? 1 : 0)
#define pthread_kill(A,B) thr_kill((A),(B))
#define HAVE_PTHREAD_KILL
#define pthread_sigmask(A,B,C) thr_sigsetmask((A),(B),(C))
extern int my_sigwait(const sigset_t *set,int *sig);
#define pthread_detach_this_thread() pthread_dummy(0)
#define pthread_attr_init(A) pthread_dummy(0)
#define pthread_attr_destroy(A) pthread_dummy(0)
#define pthread_attr_setscope(A,B) pthread_dummy(0)
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
#define my_pthread_setprio(A,B) pthread_dummy (0)
#define my_pthread_getprio(A) pthread_dummy (0)
#define my_pthread_attr_setprio(A,B) pthread_dummy(0)
#else /* Normal threads */
#ifdef HAVE_rts_threads
......
drop table if exists t1;
create table t1 (
a mediumint not null,
b text not null,
c int not null,
d longblob,
primary key using hash (a,c),
unique key (c)
)
engine=ndb
partition by range (c)
partitions 3
( partition p1 values less than (200),
partition p2 values less than (300),
partition p3 values less than (400));
insert into t1 values (1, @v1, 101, @v2);
insert into t1 values (1, @v2, 102, @v3);
insert into t1 values (1, @v3, 103, @v4);
insert into t1 values (2, @v4, 201, @v5);
insert into t1 values (2, @v5, 202, @v6);
insert into t1 values (2, @v6, 203, @v7);
insert into t1 values (3, @v7, 301, @v8);
insert into t1 values (3, @v8, 302, @v9);
insert into t1 values (3, @v9, 303, @v1);
select a, sha1(b), c, sha1(d) from t1 order by a;
a sha1(b) c sha1(d)
1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6
1 10d3c783026b310218d10b7188da96a2401648c6 102 a33549d9844092289a58ac348dd59f09fc28406a
1 a33549d9844092289a58ac348dd59f09fc28406a 103 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c
2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d
2 70fc9a7d08beebc522258bfb02000a30c77a8f1d 202 090565c580809efed3d369481a4bbb168b20713e
2 090565c580809efed3d369481a4bbb168b20713e 203 1e0070bec426871a46291de27b9bd6e4255ab4e5
3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e
3 acbaba01bc2e682f015f40e79d9cbe475db3002e 302 9ee30d99162574f79c66ae95cdf132dcf9cbc259
3 9ee30d99162574f79c66ae95cdf132dcf9cbc259 303 1d42dd9090cf78314a06665d4ea938c35cc760f4
select a, sha1(b), c, sha1(d) from t1 where a = 1 and c = 101;
a sha1(b) c sha1(d)
1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6
select a, sha1(b), c, sha1(d) from t1 where a = 2 and c = 201;
a sha1(b) c sha1(d)
2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d
select a, sha1(b), c, sha1(d) from t1 where a = 3 and c = 301;
a sha1(b) c sha1(d)
3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e
update t1 set b = @v3, d = @v4 where a = 1 and c = 102;
update t1 set b = @v6, d = @v7 where a = 2 and c = 202;
update t1 set b = @v9, d = @v1 where a = 3 and c = 302;
select a, sha1(b), c, sha1(d) from t1 order by a;
a sha1(b) c sha1(d)
1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6
1 a33549d9844092289a58ac348dd59f09fc28406a 102 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c
1 a33549d9844092289a58ac348dd59f09fc28406a 103 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c
2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d
2 090565c580809efed3d369481a4bbb168b20713e 202 1e0070bec426871a46291de27b9bd6e4255ab4e5
2 090565c580809efed3d369481a4bbb168b20713e 203 1e0070bec426871a46291de27b9bd6e4255ab4e5
3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e
3 9ee30d99162574f79c66ae95cdf132dcf9cbc259 302 1d42dd9090cf78314a06665d4ea938c35cc760f4
3 9ee30d99162574f79c66ae95cdf132dcf9cbc259 303 1d42dd9090cf78314a06665d4ea938c35cc760f4
update t1 set b = @v4, d = @v5 where c = 103;
update t1 set b = @v7, d = @v8 where c = 203;
update t1 set b = @v1, d = @v2 where c = 303;
select a, sha1(b), c, sha1(d) from t1 order by a;
a sha1(b) c sha1(d)
1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6
1 a33549d9844092289a58ac348dd59f09fc28406a 102 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c
1 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 103 70fc9a7d08beebc522258bfb02000a30c77a8f1d
2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d
2 090565c580809efed3d369481a4bbb168b20713e 202 1e0070bec426871a46291de27b9bd6e4255ab4e5
2 1e0070bec426871a46291de27b9bd6e4255ab4e5 203 acbaba01bc2e682f015f40e79d9cbe475db3002e
3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e
3 9ee30d99162574f79c66ae95cdf132dcf9cbc259 302 1d42dd9090cf78314a06665d4ea938c35cc760f4
3 1d42dd9090cf78314a06665d4ea938c35cc760f4 303 10d3c783026b310218d10b7188da96a2401648c6
update t1 set b = @v5, d = @v6;
select a, sha1(b), c, sha1(d) from t1 order by a;
a sha1(b) c sha1(d)
1 70fc9a7d08beebc522258bfb02000a30c77a8f1d 101 090565c580809efed3d369481a4bbb168b20713e
1 70fc9a7d08beebc522258bfb02000a30c77a8f1d 102 090565c580809efed3d369481a4bbb168b20713e
1 70fc9a7d08beebc522258bfb02000a30c77a8f1d 103 090565c580809efed3d369481a4bbb168b20713e
2 70fc9a7d08beebc522258bfb02000a30c77a8f1d 201 090565c580809efed3d369481a4bbb168b20713e
2 70fc9a7d08beebc522258bfb02000a30c77a8f1d 202 090565c580809efed3d369481a4bbb168b20713e
2 70fc9a7d08beebc522258bfb02000a30c77a8f1d 203 090565c580809efed3d369481a4bbb168b20713e
3 70fc9a7d08beebc522258bfb02000a30c77a8f1d 301 090565c580809efed3d369481a4bbb168b20713e
3 70fc9a7d08beebc522258bfb02000a30c77a8f1d 302 090565c580809efed3d369481a4bbb168b20713e
3 70fc9a7d08beebc522258bfb02000a30c77a8f1d 303 090565c580809efed3d369481a4bbb168b20713e
update t1 set b = @v1, d = @v2 where 100 < c and c < 200;
update t1 set b = @v4, d = @v5 where 200 < c and c < 300;
update t1 set b = @v7, d = @v8 where 300 < c and c < 400;
select a, sha1(b), c, sha1(d) from t1 order by a;
a sha1(b) c sha1(d)
1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6
1 1d42dd9090cf78314a06665d4ea938c35cc760f4 102 10d3c783026b310218d10b7188da96a2401648c6
1 1d42dd9090cf78314a06665d4ea938c35cc760f4 103 10d3c783026b310218d10b7188da96a2401648c6
2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d
2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 202 70fc9a7d08beebc522258bfb02000a30c77a8f1d
2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 203 70fc9a7d08beebc522258bfb02000a30c77a8f1d
3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e
3 1e0070bec426871a46291de27b9bd6e4255ab4e5 302 acbaba01bc2e682f015f40e79d9cbe475db3002e
3 1e0070bec426871a46291de27b9bd6e4255ab4e5 303 acbaba01bc2e682f015f40e79d9cbe475db3002e
delete from t1 where a = 1 and c = 101;
delete from t1 where c = 102;
delete from t1;
select a, sha1(b), c, sha1(d) from t1 order by a;
a sha1(b) c sha1(d)
drop table t1;
......@@ -839,19 +839,6 @@ SHOW TABLE STATUS;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MyISAM 10 Dynamic 0 0 0 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
DROP TABLE t1;
CREATE TABLE t1 (a int)
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (NULL));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (NULL) ENGINE = MyISAM)
DROP TABLE t1;
CREATE TABLE t1 (a int)
PARTITION BY RANGE(a)
(PARTITION p0 VALUES LESS THAN (NULL));
ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '))' at line 3
create table t1 (a int)
partition by list (a)
(partition `s1 s2` values in (0));
......@@ -878,7 +865,10 @@ t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (NULL) ENGINE = MyISAM)
DROP TABLE t1;
>>>>>>>
CREATE TABLE t1 (a int)
PARTITION BY RANGE(a)
(PARTITION p0 VALUES LESS THAN (NULL));
ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '))' at line 3
create table t1 (s1 int auto_increment primary key)
partition by list (s1)
(partition p1 values in (1),
......
--source include/have_ndb.inc
-- source include/not_embedded.inc
--disable_warnings
drop table if exists t1;
--enable_warnings
#
# Minimal NDB blobs test with range partitions.
#
create table t1 (
a mediumint not null,
b text not null,
c int not null,
d longblob,
primary key using hash (a,c),
unique key (c)
)
engine=ndb
partition by range (c)
partitions 3
( partition p1 values less than (200),
partition p2 values less than (300),
partition p3 values less than (400));
--disable_query_log
sleep 1;
# length 61
set @s0 = 'rggurloniukyehuxdbfkkyzlceixzrehqhvxvxbpwizzvjzpucqmzrhzxzfau';
set @s1 = 'ykyymbzqgqlcjhlhmyqelfoaaohvtbekvifukdtnvcrrjveevfakxarxexomz';
set @s2 = 'dbnfqyzgtqxalcrwtfsqabknvtfcbpoonxsjiqvmhnfikxxhcgoexlkoezvah';
set @v1 = repeat(@s0, 100); -- 1d42dd9090cf78314a06665d4ea938c35cc760f4
set @v2 = repeat(@s1, 200); -- 10d3c783026b310218d10b7188da96a2401648c6
set @v3 = repeat(@s2, 300); -- a33549d9844092289a58ac348dd59f09fc28406a
set @v4 = repeat(@s0, 400); -- daa61c6de36a0526f0d47dc29d6b9de7e6d2630c
set @v5 = repeat(@s1, 500); -- 70fc9a7d08beebc522258bfb02000a30c77a8f1d
set @v6 = repeat(@s2, 600); -- 090565c580809efed3d369481a4bbb168b20713e
set @v7 = repeat(@s0, 700); -- 1e0070bec426871a46291de27b9bd6e4255ab4e5
set @v8 = repeat(@s1, 800); -- acbaba01bc2e682f015f40e79d9cbe475db3002e
set @v9 = repeat(@s2, 900); -- 9ee30d99162574f79c66ae95cdf132dcf9cbc259
--enable_query_log
# -- insert --
insert into t1 values (1, @v1, 101, @v2);
insert into t1 values (1, @v2, 102, @v3);
insert into t1 values (1, @v3, 103, @v4);
insert into t1 values (2, @v4, 201, @v5);
insert into t1 values (2, @v5, 202, @v6);
insert into t1 values (2, @v6, 203, @v7);
insert into t1 values (3, @v7, 301, @v8);
insert into t1 values (3, @v8, 302, @v9);
insert into t1 values (3, @v9, 303, @v1);
select a, sha1(b), c, sha1(d) from t1 order by a;
# -- pk read --
select a, sha1(b), c, sha1(d) from t1 where a = 1 and c = 101;
select a, sha1(b), c, sha1(d) from t1 where a = 2 and c = 201;
select a, sha1(b), c, sha1(d) from t1 where a = 3 and c = 301;
# -- pk update --
update t1 set b = @v3, d = @v4 where a = 1 and c = 102;
update t1 set b = @v6, d = @v7 where a = 2 and c = 202;
update t1 set b = @v9, d = @v1 where a = 3 and c = 302;
select a, sha1(b), c, sha1(d) from t1 order by a;
# -- hash index update --
update t1 set b = @v4, d = @v5 where c = 103;
update t1 set b = @v7, d = @v8 where c = 203;
update t1 set b = @v1, d = @v2 where c = 303;
select a, sha1(b), c, sha1(d) from t1 order by a;
# -- full scan update --
update t1 set b = @v5, d = @v6;
select a, sha1(b), c, sha1(d) from t1 order by a;
# -- range scan update
update t1 set b = @v1, d = @v2 where 100 < c and c < 200;
update t1 set b = @v4, d = @v5 where 200 < c and c < 300;
update t1 set b = @v7, d = @v8 where 300 < c and c < 400;
select a, sha1(b), c, sha1(d) from t1 order by a;
# -- delete --
delete from t1 where a = 1 and c = 101;
delete from t1 where c = 102;
# delete from t1 where c < 300; # XXX coredump
delete from t1;
select a, sha1(b), c, sha1(d) from t1 order by a;
# -- clean up --
drop table t1;
......@@ -91,9 +91,6 @@ my_bool my_init(void)
sigfillset(&my_signals); /* signals blocked by mf_brkhant */
#endif
#endif /* THREAD */
#ifdef UNIXWARE_7
(void) isatty(0); /* Go around connect() bug in UW7 */
#endif
{
DBUG_ENTER("my_init");
DBUG_PROCESS((char*) (my_progname ? my_progname : "unknown"));
......
......@@ -76,9 +76,6 @@ void my_pthread_attr_setprio(pthread_attr_t *attr, int priority)
#ifdef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC
#undef pthread_getspecific
#ifdef HAVE_UNIXWARE7_THREADS
#define pthread_getspecific thr_getspecific
#endif
void *my_pthread_getspecific_imp(pthread_key_t key)
{
......@@ -429,7 +426,7 @@ int sigwait(sigset_t *setp, int *sigp)
** Patches for AIX and DEC OSF/1 3.2
*****************************************************************************/
#if (defined(HAVE_NONPOSIX_PTHREAD_MUTEX_INIT) && !defined(HAVE_UNIXWARE7_THREADS)) || defined(HAVE_DEC_3_2_THREADS)
#if defined(HAVE_NONPOSIX_PTHREAD_MUTEX_INIT)
#include <netdb.h>
......
......@@ -535,6 +535,8 @@ NdbBlob::setTableKeyValue(NdbOperation* anOp)
pos += (len + 3) / 4;
}
}
if (theNdbOp->theDistrKeyIndicator_)
anOp->setPartitionId(theNdbOp->getPartitionId());
assert(pos == theKeyBuf.size / 4);
DBUG_RETURN(0);
}
......
......@@ -640,10 +640,14 @@ NdbOperation::setPartitionId(Uint32 value)
{
theDistributionKey = value;
theDistrKeyIndicator_ = 1;
DBUG_PRINT("info", ("NdbOperation::setPartitionId: %u",
theDistributionKey));
}
Uint32
NdbOperation::getPartitionId() const
{
DBUG_PRINT("info", ("NdbOperation::getPartitionId: %u ind=%d",
theDistributionKey, theDistrKeyIndicator_));
return theDistributionKey;
}
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