Commit 9d615368 authored by jan@hundin.mysql.fi's avatar jan@hundin.mysql.fi

Merge jlindstrom@build.mysql.com:/home/bk/mysql-4.1

into hundin.mysql.fi:/home/jan/mysql-4.1
parents 8be6dd7d 88f6267b
...@@ -183,8 +183,8 @@ dnl Auxiliary macro to check for zlib at given path ...@@ -183,8 +183,8 @@ dnl Auxiliary macro to check for zlib at given path
AC_DEFUN([MYSQL_CHECK_ZLIB_DIR], [ AC_DEFUN([MYSQL_CHECK_ZLIB_DIR], [
save_INCLUDES="$INCLUDES" save_INCLUDES="$INCLUDES"
save_LIBS="$LIBS" save_LIBS="$LIBS"
INCLUDES="$ZLIB_INCLUDES" INCLUDES="$INCLUDES $ZLIB_INCLUDES"
LIBS="$ZLIB_LIBS" LIBS="$LIBS $ZLIB_LIBS"
AC_CACHE_VAL([mysql_cv_compress], AC_CACHE_VAL([mysql_cv_compress],
[AC_TRY_LINK([#include <zlib.h>], [AC_TRY_LINK([#include <zlib.h>],
[int link_test() { return compress(0, (unsigned long*) 0, "", 0); }], [int link_test() { return compress(0, (unsigned long*) 0, "", 0); }],
......
...@@ -22,215 +22,218 @@ ...@@ -22,215 +22,218 @@
*/ */
/* these two are for uniformity */ /* these two are for uniformity */
#define mi_sint1korr(A) (int8)(*A) #define mi_sint1korr(A) ((int8)(*A))
#define mi_uint1korr(A) (uint8)(*A) #define mi_uint1korr(A) ((uint8)(*A))
#define mi_sint2korr(A) (int16) (((int16) ((uchar) (A)[1])) +\ #define mi_sint2korr(A) ((int16) (((int16) (((uchar*) (A))[1])) +\
((int16) ((int16) (A)[0]) << 8)) ((int16) ((int16) ((char*) (A))[0]) << 8)))
#define mi_sint3korr(A) ((int32) ((((uchar) (A)[0]) & 128) ? \ #define mi_sint3korr(A) ((int32) (((((uchar*) (A))[0]) & 128) ? \
(((uint32) 255L << 24) | \ (((uint32) 255L << 24) | \
(((uint32) (uchar) (A)[0]) << 16) |\ (((uint32) ((uchar*) (A))[0]) << 16) |\
(((uint32) (uchar) (A)[1]) << 8) | \ (((uint32) ((uchar*) (A))[1]) << 8) | \
((uint32) (uchar) (A)[2])) : \ ((uint32) ((uchar*) (A))[2])) : \
(((uint32) (uchar) (A)[0]) << 16) |\ (((uint32) ((uchar*) (A))[0]) << 16) |\
(((uint32) (uchar) (A)[1]) << 8) | \ (((uint32) ((uchar*) (A))[1]) << 8) | \
((uint32) (uchar) (A)[2]))) ((uint32) ((uchar*) (A))[2])))
#define mi_sint4korr(A) (int32) (((int32) ((uchar) (A)[3])) +\ #define mi_sint4korr(A) ((int32) (((int32) (((uchar*) (A))[3])) +\
(((int32) ((uchar) (A)[2]) << 8)) +\ ((int32) (((uchar*) (A))[2]) << 8) +\
(((int32) ((uchar) (A)[1]) << 16)) +\ ((int32) (((uchar*) (A))[1]) << 16) +\
(((int32) ((int16) (A)[0]) << 24))) ((int32) ((int16) ((char*) (A))[0]) << 24)))
#define mi_sint8korr(A) (longlong) mi_uint8korr(A) #define mi_sint8korr(A) ((longlong) mi_uint8korr(A))
#define mi_uint2korr(A) (uint16) (((uint16) ((uchar) (A)[1])) +\ #define mi_uint2korr(A) ((uint16) (((uint16) (((uchar*) (A))[1])) +\
((uint16) ((uchar) (A)[0]) << 8)) ((uint16) (((uchar*) (A))[0]) << 8)))
#define mi_uint3korr(A) (uint32) (((uint32) ((uchar) (A)[2])) +\ #define mi_uint3korr(A) ((uint32) (((uint32) (((uchar*) (A))[2])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\ (((uint32) (((uchar*) (A))[1])) << 8) +\
(((uint32) ((uchar) (A)[0])) << 16)) (((uint32) (((uchar*) (A))[0])) << 16)))
#define mi_uint4korr(A) (uint32) (((uint32) ((uchar) (A)[3])) +\ #define mi_uint4korr(A) ((uint32) (((uint32) (((uchar*) (A))[3])) +\
(((uint32) ((uchar) (A)[2])) << 8) +\ (((uint32) (((uchar*) (A))[2])) << 8) +\
(((uint32) ((uchar) (A)[1])) << 16) +\ (((uint32) (((uchar*) (A))[1])) << 16) +\
(((uint32) ((uchar) (A)[0])) << 24)) (((uint32) (((uchar*) (A))[0])) << 24)))
#define mi_uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[4])) +\ #define mi_uint5korr(A) ((ulonglong)(((uint32) (((uchar*) (A))[4])) +\
(((uint32) ((uchar) (A)[3])) << 8) +\ (((uint32) (((uchar*) (A))[3])) << 8) +\
(((uint32) ((uchar) (A)[2])) << 16) +\ (((uint32) (((uchar*) (A))[2])) << 16) +\
(((uint32) ((uchar) (A)[1])) << 24)) +\ (((uint32) (((uchar*) (A))[1])) << 24)) +\
(((ulonglong) ((uchar) (A)[0])) << 32)) (((ulonglong) (((uchar*) (A))[0])) << 32))
#define mi_uint6korr(A) ((ulonglong)(((uint32) ((uchar) (A)[5])) +\ #define mi_uint6korr(A) ((ulonglong)(((uint32) (((uchar*) (A))[5])) +\
(((uint32) ((uchar) (A)[4])) << 8) +\ (((uint32) (((uchar*) (A))[4])) << 8) +\
(((uint32) ((uchar) (A)[3])) << 16) +\ (((uint32) (((uchar*) (A))[3])) << 16) +\
(((uint32) ((uchar) (A)[2])) << 24)) +\ (((uint32) (((uchar*) (A))[2])) << 24)) +\
(((ulonglong) (((uint32) ((uchar) (A)[1])) +\ (((ulonglong) (((uint32) (((uchar*) (A))[1])) +\
(((uint32) ((uchar) (A)[0]) << 8)))) <<\ (((uint32) (((uchar*) (A))[0]) << 8)))) <<\
32)) 32))
#define mi_uint7korr(A) ((ulonglong)(((uint32) ((uchar) (A)[6])) +\ #define mi_uint7korr(A) ((ulonglong)(((uint32) (((uchar*) (A))[6])) +\
(((uint32) ((uchar) (A)[5])) << 8) +\ (((uint32) (((uchar*) (A))[5])) << 8) +\
(((uint32) ((uchar) (A)[4])) << 16) +\ (((uint32) (((uchar*) (A))[4])) << 16) +\
(((uint32) ((uchar) (A)[3])) << 24)) +\ (((uint32) (((uchar*) (A))[3])) << 24)) +\
(((ulonglong) (((uint32) ((uchar) (A)[2])) +\ (((ulonglong) (((uint32) (((uchar*) (A))[2])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\ (((uint32) (((uchar*) (A))[1])) << 8) +\
(((uint32) ((uchar) (A)[0])) << 16))) <<\ (((uint32) (((uchar*) (A))[0])) << 16))) <<\
32)) 32))
#define mi_uint8korr(A) ((ulonglong)(((uint32) ((uchar) (A)[7])) +\ #define mi_uint8korr(A) ((ulonglong)(((uint32) (((uchar*) (A))[7])) +\
(((uint32) ((uchar) (A)[6])) << 8) +\ (((uint32) (((uchar*) (A))[6])) << 8) +\
(((uint32) ((uchar) (A)[5])) << 16) +\ (((uint32) (((uchar*) (A))[5])) << 16) +\
(((uint32) ((uchar) (A)[4])) << 24)) +\ (((uint32) (((uchar*) (A))[4])) << 24)) +\
(((ulonglong) (((uint32) ((uchar) (A)[3])) +\ (((ulonglong) (((uint32) (((uchar*) (A))[3])) +\
(((uint32) ((uchar) (A)[2])) << 8) +\ (((uint32) (((uchar*) (A))[2])) << 8) +\
(((uint32) ((uchar) (A)[1])) << 16) +\ (((uint32) (((uchar*) (A))[1])) << 16) +\
(((uint32) ((uchar) (A)[0])) << 24))) <<\ (((uint32) (((uchar*) (A))[0])) << 24))) <<\
32)) 32))
/* This one is for uniformity */ /* This one is for uniformity */
#define mi_int1store(T,A) *((uchar*)(T))= (uchar) (A) #define mi_int1store(T,A) *((uchar*)(T))= (uchar) (A)
#define mi_int2store(T,A) { uint def_temp= (uint) (A) ;\ #define mi_int2store(T,A) { uint def_temp= (uint) (A) ;\
*((uchar*) ((T)+1))= (uchar)(def_temp); \ ((uchar*) (T))[1]= (uchar) (def_temp);\
*((uchar*) ((T)+0))= (uchar)(def_temp >> 8); } ((uchar*) (T))[0]= (uchar) (def_temp >> 8); }
#define mi_int3store(T,A) { /*lint -save -e734 */\ #define mi_int3store(T,A) { /*lint -save -e734 */\
ulong def_temp= (ulong) (A);\ ulong def_temp= (ulong) (A);\
*(((T)+2))=(char) (def_temp);\ ((uchar*) (T))[2]= (uchar) (def_temp);\
*((T)+1)= (char) (def_temp >> 8);\ ((uchar*) (T))[1]= (uchar) (def_temp >> 8);\
*((T)+0)= (char) (def_temp >> 16);\ ((uchar*) (T))[0]= (uchar) (def_temp >> 16);\
/*lint -restore */} /*lint -restore */}
#define mi_int4store(T,A) { ulong def_temp= (ulong) (A);\ #define mi_int4store(T,A) { ulong def_temp= (ulong) (A);\
*((T)+3)=(char) (def_temp);\ ((uchar*) (T))[3]= (uchar) (def_temp);\
*((T)+2)=(char) (def_temp >> 8);\ ((uchar*) (T))[2]= (uchar) (def_temp >> 8);\
*((T)+1)=(char) (def_temp >> 16);\ ((uchar*) (T))[1]= (uchar) (def_temp >> 16);\
*((T)+0)=(char) (def_temp >> 24); } ((uchar*) (T))[0]= (uchar) (def_temp >> 24); }
#define mi_int5store(T,A) { ulong def_temp= (ulong) (A),\ #define mi_int5store(T,A) { ulong def_temp= (ulong) (A),\
def_temp2= (ulong) ((A) >> 32);\ def_temp2= (ulong) ((A) >> 32);\
*((T)+4)=(char) (def_temp);\ ((uchar*) (T))[4]= (uchar) (def_temp);\
*((T)+3)=(char) (def_temp >> 8);\ ((uchar*) (T))[3]= (uchar) (def_temp >> 8);\
*((T)+2)=(char) (def_temp >> 16);\ ((uchar*) (T))[2]= (uchar) (def_temp >> 16);\
*((T)+1)=(char) (def_temp >> 24);\ ((uchar*) (T))[1]= (uchar) (def_temp >> 24);\
*((T)+0)=(char) (def_temp2); } ((uchar*) (T))[0]= (uchar) (def_temp2); }
#define mi_int6store(T,A) { ulong def_temp= (ulong) (A),\ #define mi_int6store(T,A) { ulong def_temp= (ulong) (A),\
def_temp2= (ulong) ((A) >> 32);\ def_temp2= (ulong) ((A) >> 32);\
*((T)+5)=(char) (def_temp);\ ((uchar*) (T))[5]= (uchar) (def_temp);\
*((T)+4)=(char) (def_temp >> 8);\ ((uchar*) (T))[4]= (uchar) (def_temp >> 8);\
*((T)+3)=(char) (def_temp >> 16);\ ((uchar*) (T))[3]= (uchar) (def_temp >> 16);\
*((T)+2)=(char) (def_temp >> 24);\ ((uchar*) (T))[2]= (uchar) (def_temp >> 24);\
*((T)+1)=(char) (def_temp2);\ ((uchar*) (T))[1]= (uchar) (def_temp2);\
*((T)+0)=(char) (def_temp2 >> 8); } ((uchar*) (T))[0]= (uchar) (def_temp2 >> 8); }
#define mi_int7store(T,A) { ulong def_temp= (ulong) (A),\ #define mi_int7store(T,A) { ulong def_temp= (ulong) (A),\
def_temp2= (ulong) ((A) >> 32);\ def_temp2= (ulong) ((A) >> 32);\
*((T)+6)=(char) (def_temp);\ ((uchar*) (T))[6]= (uchar) (def_temp);\
*((T)+5)=(char) (def_temp >> 8);\ ((uchar*) (T))[5]= (uchar) (def_temp >> 8);\
*((T)+4)=(char) (def_temp >> 16);\ ((uchar*) (T))[4]= (uchar) (def_temp >> 16);\
*((T)+3)=(char) (def_temp >> 24);\ ((uchar*) (T))[3]= (uchar) (def_temp >> 24);\
*((T)+2)=(char) (def_temp2);\ ((uchar*) (T))[2]= (uchar) (def_temp2);\
*((T)+1)=(char) (def_temp2 >> 8);\ ((uchar*) (T))[1]= (uchar) (def_temp2 >> 8);\
*((T)+0)=(char) (def_temp2 >> 16); } ((uchar*) (T))[0]= (uchar) (def_temp2 >> 16); }
#define mi_int8store(T,A) { ulong def_temp3= (ulong) (A), \ #define mi_int8store(T,A) { ulong def_temp3= (ulong) (A),\
def_temp4= (ulong) ((A) >> 32); \ def_temp4= (ulong) ((A) >> 32);\
mi_int4store((T),def_temp4); \ mi_int4store((uchar*) (T) + 0, def_temp4);\
mi_int4store((T+4),def_temp3); \ mi_int4store((uchar*) (T) + 4, def_temp3); }
}
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
#define mi_float4store(T,A) { *(T)= ((byte *) &A)[0];\ #define mi_float4store(T,A) { ((uchar*) (T))[0]= ((uchar*) &A)[0];\
*((T)+1)=(char) ((byte *) &A)[1];\ ((uchar*) (T))[1]= ((uchar*) &A)[1];\
*((T)+2)=(char) ((byte *) &A)[2];\ ((uchar*) (T))[2]= ((uchar*) &A)[2];\
*((T)+3)=(char) ((byte *) &A)[3]; } ((uchar*) (T))[3]= ((uchar*) &A)[3]; }
#define mi_float4get(V,M) { float def_temp;\ #define mi_float4get(V,M) { float def_temp;\
((byte*) &def_temp)[0]=(M)[0];\ ((uchar*) &def_temp)[0]= ((uchar*) (M))[0];\
((byte*) &def_temp)[1]=(M)[1];\ ((uchar*) &def_temp)[1]= ((uchar*) (M))[1];\
((byte*) &def_temp)[2]=(M)[2];\ ((uchar*) &def_temp)[2]= ((uchar*) (M))[2];\
((byte*) &def_temp)[3]=(M)[3];\ ((uchar*) &def_temp)[3]= ((uchar*) (M))[3];\
(V)=def_temp; } (V)= def_temp; }
#define mi_float8store(T,V) { *(T)= ((byte *) &V)[0];\ #define mi_float8store(T,V) { ((uchar*) (T))[0]= ((uchar*) &V)[0];\
*((T)+1)=(char) ((byte *) &V)[1];\ ((uchar*) (T))[1]= ((uchar*) &V)[1];\
*((T)+2)=(char) ((byte *) &V)[2];\ ((uchar*) (T))[2]= ((uchar*) &V)[2];\
*((T)+3)=(char) ((byte *) &V)[3];\ ((uchar*) (T))[3]= ((uchar*) &V)[3];\
*((T)+4)=(char) ((byte *) &V)[4];\ ((uchar*) (T))[4]= ((uchar*) &V)[4];\
*((T)+5)=(char) ((byte *) &V)[5];\ ((uchar*) (T))[5]= ((uchar*) &V)[5];\
*((T)+6)=(char) ((byte *) &V)[6];\ ((uchar*) (T))[6]= ((uchar*) &V)[6];\
*((T)+7)=(char) ((byte *) &V)[7]; } ((uchar*) (T))[7]= ((uchar*) &V)[7]; }
#define mi_float8get(V,M) { double def_temp;\ #define mi_float8get(V,M) { double def_temp;\
((byte*) &def_temp)[0]=(M)[0];\ ((uchar*) &def_temp)[0]= ((uchar*) (M))[0];\
((byte*) &def_temp)[1]=(M)[1];\ ((uchar*) &def_temp)[1]= ((uchar*) (M))[1];\
((byte*) &def_temp)[2]=(M)[2];\ ((uchar*) &def_temp)[2]= ((uchar*) (M))[2];\
((byte*) &def_temp)[3]=(M)[3];\ ((uchar*) &def_temp)[3]= ((uchar*) (M))[3];\
((byte*) &def_temp)[4]=(M)[4];\ ((uchar*) &def_temp)[4]= ((uchar*) (M))[4];\
((byte*) &def_temp)[5]=(M)[5];\ ((uchar*) &def_temp)[5]= ((uchar*) (M))[5];\
((byte*) &def_temp)[6]=(M)[6];\ ((uchar*) &def_temp)[6]= ((uchar*) (M))[6];\
((byte*) &def_temp)[7]=(M)[7]; \ ((uchar*) &def_temp)[7]= ((uchar*) (M))[7]; \
(V)=def_temp; } (V)= def_temp; }
#else #else
#define mi_float4store(T,A) { *(T)= ((byte *) &A)[3];\ #define mi_float4store(T,A) { ((uchar*) (T))[0]= ((uchar*) &A)[3];\
*((T)+1)=(char) ((byte *) &A)[2];\ ((uchar*) (T))[1]= ((uchar*) &A)[2];\
*((T)+2)=(char) ((byte *) &A)[1];\ ((uchar*) (T))[2]= ((uchar*) &A)[1];\
*((T)+3)=(char) ((byte *) &A)[0]; } ((uchar*) (T))[3]= ((uchar*) &A)[0]; }
#define mi_float4get(V,M) { float def_temp;\ #define mi_float4get(V,M) { float def_temp;\
((byte*) &def_temp)[0]=(M)[3];\ ((uchar*) &def_temp)[0]= ((uchar*) (M))[3];\
((byte*) &def_temp)[1]=(M)[2];\ ((uchar*) &def_temp)[1]= ((uchar*) (M))[2];\
((byte*) &def_temp)[2]=(M)[1];\ ((uchar*) &def_temp)[2]= ((uchar*) (M))[1];\
((byte*) &def_temp)[3]=(M)[0];\ ((uchar*) &def_temp)[3]= ((uchar*) (M))[0];\
(V)=def_temp; } (V)= def_temp; }
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) #if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
#define mi_float8store(T,V) { *(T)= ((byte *) &V)[3];\ #define mi_float8store(T,V) { ((uchar*) (T))[0]= ((uchar*) &V)[3];\
*((T)+1)=(char) ((byte *) &V)[2];\ ((uchar*) (T))[1]= ((uchar*) &V)[2];\
*((T)+2)=(char) ((byte *) &V)[1];\ ((uchar*) (T))[2]= ((uchar*) &V)[1];\
*((T)+3)=(char) ((byte *) &V)[0];\ ((uchar*) (T))[3]= ((uchar*) &V)[0];\
*((T)+4)=(char) ((byte *) &V)[7];\ ((uchar*) (T))[4]= ((uchar*) &V)[7];\
*((T)+5)=(char) ((byte *) &V)[6];\ ((uchar*) (T))[5]= ((uchar*) &V)[6];\
*((T)+6)=(char) ((byte *) &V)[5];\ ((uchar*) (T))[6]= ((uchar*) &V)[5];\
*((T)+7)=(char) ((byte *) &V)[4];} ((uchar*) (T))[7]= ((uchar*) &V)[4];}
#define mi_float8get(V,M) { double def_temp;\ #define mi_float8get(V,M) { double def_temp;\
((byte*) &def_temp)[0]=(M)[3];\ ((uchar*) &def_temp)[0]= ((uchar*) (M))[3];\
((byte*) &def_temp)[1]=(M)[2];\ ((uchar*) &def_temp)[1]= ((uchar*) (M))[2];\
((byte*) &def_temp)[2]=(M)[1];\ ((uchar*) &def_temp)[2]= ((uchar*) (M))[1];\
((byte*) &def_temp)[3]=(M)[0];\ ((uchar*) &def_temp)[3]= ((uchar*) (M))[0];\
((byte*) &def_temp)[4]=(M)[7];\ ((uchar*) &def_temp)[4]= ((uchar*) (M))[7];\
((byte*) &def_temp)[5]=(M)[6];\ ((uchar*) &def_temp)[5]= ((uchar*) (M))[6];\
((byte*) &def_temp)[6]=(M)[5];\ ((uchar*) &def_temp)[6]= ((uchar*) (M))[5];\
((byte*) &def_temp)[7]=(M)[4];\ ((uchar*) &def_temp)[7]= ((uchar*) (M))[4];\
(V)=def_temp; } (V)= def_temp; }
#else #else
#define mi_float8store(T,V) { *(T)= ((byte *) &V)[7];\ #define mi_float8store(T,V) { ((uchar*) (T))[0]= ((uchar*) &V)[7];\
*((T)+1)=(char) ((byte *) &V)[6];\ ((uchar*) (T))[1]= ((uchar*) &V)[6];\
*((T)+2)=(char) ((byte *) &V)[5];\ ((uchar*) (T))[2]= ((uchar*) &V)[5];\
*((T)+3)=(char) ((byte *) &V)[4];\ ((uchar*) (T))[3]= ((uchar*) &V)[4];\
*((T)+4)=(char) ((byte *) &V)[3];\ ((uchar*) (T))[4]= ((uchar*) &V)[3];\
*((T)+5)=(char) ((byte *) &V)[2];\ ((uchar*) (T))[5]= ((uchar*) &V)[2];\
*((T)+6)=(char) ((byte *) &V)[1];\ ((uchar*) (T))[6]= ((uchar*) &V)[1];\
*((T)+7)=(char) ((byte *) &V)[0];} ((uchar*) (T))[7]= ((uchar*) &V)[0];}
#define mi_float8get(V,M) { double def_temp;\ #define mi_float8get(V,M) { double def_temp;\
((byte*) &def_temp)[0]=(M)[7];\ ((uchar*) &def_temp)[0]= ((uchar*) (M))[7];\
((byte*) &def_temp)[1]=(M)[6];\ ((uchar*) &def_temp)[1]= ((uchar*) (M))[6];\
((byte*) &def_temp)[2]=(M)[5];\ ((uchar*) &def_temp)[2]= ((uchar*) (M))[5];\
((byte*) &def_temp)[3]=(M)[4];\ ((uchar*) &def_temp)[3]= ((uchar*) (M))[4];\
((byte*) &def_temp)[4]=(M)[3];\ ((uchar*) &def_temp)[4]= ((uchar*) (M))[3];\
((byte*) &def_temp)[5]=(M)[2];\ ((uchar*) &def_temp)[5]= ((uchar*) (M))[2];\
((byte*) &def_temp)[6]=(M)[1];\ ((uchar*) &def_temp)[6]= ((uchar*) (M))[1];\
((byte*) &def_temp)[7]=(M)[0];\ ((uchar*) &def_temp)[7]= ((uchar*) (M))[0];\
(V)=def_temp; } (V)= def_temp; }
#endif /* __FLOAT_WORD_ORDER */ #endif /* __FLOAT_WORD_ORDER */
#endif /* WORDS_BIGENDIAN */ #endif /* WORDS_BIGENDIAN */
/* Fix to avoid warnings when sizeof(ha_rows) == sizeof(long) */ /* Fix to avoid warnings when sizeof(ha_rows) == sizeof(long) */
#ifdef BIG_TABLES #ifdef BIG_TABLES
#define mi_rowstore(T,A) mi_int8store(T,A) #define mi_rowstore(T,A) mi_int8store(T, A)
#define mi_rowkorr(T) mi_uint8korr(T) #define mi_rowkorr(T) mi_uint8korr(T)
#else #else
#define mi_rowstore(T,A) { mi_int4store(T,0); mi_int4store(((T)+4),A); } #define mi_rowstore(T,A) { mi_int4store(T, 0);\
#define mi_rowkorr(T) mi_uint4korr((T)+4) mi_int4store(((uchar*) (T) + 4), A); }
#define mi_rowkorr(T) mi_uint4korr((uchar*) (T) + 4)
#endif #endif
#if SIZEOF_OFF_T > 4 #if SIZEOF_OFF_T > 4
#define mi_sizestore(T,A) mi_int8store(T,A) #define mi_sizestore(T,A) mi_int8store(T, A)
#define mi_sizekorr(T) mi_uint8korr(T) #define mi_sizekorr(T) mi_uint8korr(T)
#else #else
#define mi_sizestore(T,A) { if ((A) == HA_OFFSET_ERROR) bfill((char*) (T),8,255); else { mi_int4store((T),0); mi_int4store(((T)+4),A); }} #define mi_sizestore(T,A) { if ((A) == HA_OFFSET_ERROR)\
#define mi_sizekorr(T) mi_uint4korr((T)+4) bfill((char*) (T), 8, 255);\
else { mi_int4store((T), 0);\
mi_int4store(((T) + 4), A); }}
#define mi_sizekorr(T) mi_uint4korr((uchar*) (T) + 4)
#endif #endif
...@@ -24,15 +24,15 @@ pk1 attr1 attr2 attr3 ...@@ -24,15 +24,15 @@ pk1 attr1 attr2 attr3
9410 1 NULL 9412 9410 1 NULL 9412
9411 9413 17 9413 9411 9413 17 9413
UPDATE t1 SET pk1=2 WHERE attr1=1; UPDATE t1 SET pk1=2 WHERE attr1=1;
SELECT * FROM t1; SELECT * FROM t1 ORDER BY pk1;
pk1 attr1 attr2 attr3 pk1 attr1 attr2 attr3
2 1 NULL 9412 2 1 NULL 9412
9411 9413 17 9413 9411 9413 17 9413
UPDATE t1 SET pk1=pk1 + 1; UPDATE t1 SET pk1=pk1 + 1;
SELECT * FROM t1; SELECT * FROM t1 ORDER BY pk1;
pk1 attr1 attr2 attr3 pk1 attr1 attr2 attr3
9412 9413 17 9413
3 1 NULL 9412 3 1 NULL 9412
9412 9413 17 9413
DELETE FROM t1; DELETE FROM t1;
SELECT * FROM t1; SELECT * FROM t1;
pk1 attr1 attr2 attr3 pk1 attr1 attr2 attr3
......
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
create table t1 (x integer not null primary key, y varchar(32)) engine = ndb; create table t1 (x integer not null primary key, y varchar(32)) engine = ndb;
insert into t1 values (1,'one'), (2,'two'); insert into t1 values (1,'one'), (2,'two');
select * from t1; select * from t1 order by x;
x y x y
2 two
1 one 1 one
select * from t1;
x y
2 two 2 two
select * from t1 order by x;
x y
1 one 1 one
2 two
start transaction; start transaction;
insert into t1 values (3,'three'); insert into t1 values (3,'three');
start transaction; start transaction;
select * from t1; select * from t1 order by x;
x y x y
2 two
1 one 1 one
2 two
commit; commit;
select * from t1; select * from t1 order by x;
x y x y
1 one
2 two 2 two
3 three 3 three
1 one
commit; commit;
...@@ -31,9 +31,9 @@ SELECT * FROM t1; ...@@ -31,9 +31,9 @@ SELECT * FROM t1;
# Update primary key # Update primary key
UPDATE t1 SET pk1=2 WHERE attr1=1; UPDATE t1 SET pk1=2 WHERE attr1=1;
SELECT * FROM t1; SELECT * FROM t1 ORDER BY pk1;
UPDATE t1 SET pk1=pk1 + 1; UPDATE t1 SET pk1=pk1 + 1;
SELECT * FROM t1; SELECT * FROM t1 ORDER BY pk1;
# Delete the record # Delete the record
DELETE FROM t1; DELETE FROM t1;
......
...@@ -19,20 +19,20 @@ DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; ...@@ -19,20 +19,20 @@ DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
connection con1; connection con1;
create table t1 (x integer not null primary key, y varchar(32)) engine = ndb; create table t1 (x integer not null primary key, y varchar(32)) engine = ndb;
insert into t1 values (1,'one'), (2,'two'); insert into t1 values (1,'one'), (2,'two');
select * from t1; select * from t1 order by x;
connection con2; connection con2;
select * from t1; select * from t1 order by x;
connection con1; connection con1;
start transaction; insert into t1 values (3,'three'); start transaction; insert into t1 values (3,'three');
connection con2; connection con2;
start transaction; select * from t1; start transaction; select * from t1 order by x;
connection con1; connection con1;
commit; commit;
connection con2; connection con2;
select * from t1; select * from t1 order by x;
commit; commit;
...@@ -261,9 +261,9 @@ directory(Uint32 sz){ ...@@ -261,9 +261,9 @@ directory(Uint32 sz){
ConfigValuesFactory::ConfigValuesFactory(Uint32 keys, Uint32 data){ ConfigValuesFactory::ConfigValuesFactory(Uint32 keys, Uint32 data){
m_sectionCounter = (1 << KP_SECTION_SHIFT); m_sectionCounter = (1 << KP_SECTION_SHIFT);
m_freeKeys = directory(keys); m_freeKeys = directory(keys);
m_freeData = data; m_freeData = (data + 7) & ~7;
m_currentSection = 0; m_currentSection = 0;
m_cfg = create(m_freeKeys, data); m_cfg = create(m_freeKeys, m_freeData);
} }
ConfigValuesFactory::ConfigValuesFactory(ConfigValues * cfg){ ConfigValuesFactory::ConfigValuesFactory(ConfigValues * cfg){
...@@ -316,7 +316,8 @@ ConfigValuesFactory::expand(Uint32 fk, Uint32 fs){ ...@@ -316,7 +316,8 @@ ConfigValuesFactory::expand(Uint32 fk, Uint32 fs){
m_freeKeys = (m_freeKeys >= fk ? m_cfg->m_size : fk + m_cfg->m_size); m_freeKeys = (m_freeKeys >= fk ? m_cfg->m_size : fk + m_cfg->m_size);
m_freeData = (m_freeData >= fs ? m_cfg->m_dataSize : fs + m_cfg->m_dataSize); m_freeData = (m_freeData >= fs ? m_cfg->m_dataSize : fs + m_cfg->m_dataSize);
m_freeKeys = directory(m_freeKeys); m_freeKeys = directory(m_freeKeys);
m_freeData = (m_freeData + 7) & ~7;
ConfigValues * m_tmp = m_cfg; ConfigValues * m_tmp = m_cfg;
m_cfg = create(m_freeKeys, m_freeData); m_cfg = create(m_freeKeys, m_freeData);
put(* m_tmp); put(* m_tmp);
...@@ -333,6 +334,7 @@ ConfigValuesFactory::shrink(){ ...@@ -333,6 +334,7 @@ ConfigValuesFactory::shrink(){
m_freeKeys = m_cfg->m_size - m_freeKeys; m_freeKeys = m_cfg->m_size - m_freeKeys;
m_freeData = m_cfg->m_dataSize - m_freeData; m_freeData = m_cfg->m_dataSize - m_freeData;
m_freeKeys = directory(m_freeKeys); m_freeKeys = directory(m_freeKeys);
m_freeData = (m_freeData + 7) & ~7;
ConfigValues * m_tmp = m_cfg; ConfigValues * m_tmp = m_cfg;
m_cfg = create(m_freeKeys, m_freeData); m_cfg = create(m_freeKeys, m_freeData);
......
...@@ -68,6 +68,9 @@ public: ...@@ -68,6 +68,9 @@ public:
virtual void println_statistics(const BaseString &s) = 0; virtual void println_statistics(const BaseString &s) = 0;
}; };
// some compilers need all of this
class Allocated_resources;
friend class Allocated_resources;
class Allocated_resources { class Allocated_resources {
public: public:
Allocated_resources(class MgmtSrvr &m); Allocated_resources(class MgmtSrvr &m);
......
...@@ -5061,6 +5061,8 @@ struct show_var_st status_vars[]= { ...@@ -5061,6 +5061,8 @@ struct show_var_st status_vars[]= {
{"Com_create_function", (char*) (com_stat+(uint) SQLCOM_CREATE_FUNCTION),SHOW_LONG}, {"Com_create_function", (char*) (com_stat+(uint) SQLCOM_CREATE_FUNCTION),SHOW_LONG},
{"Com_create_index", (char*) (com_stat+(uint) SQLCOM_CREATE_INDEX),SHOW_LONG}, {"Com_create_index", (char*) (com_stat+(uint) SQLCOM_CREATE_INDEX),SHOW_LONG},
{"Com_create_table", (char*) (com_stat+(uint) SQLCOM_CREATE_TABLE),SHOW_LONG}, {"Com_create_table", (char*) (com_stat+(uint) SQLCOM_CREATE_TABLE),SHOW_LONG},
{"Com_dealloc_sql", (char*) (com_stat+(uint)
SQLCOM_DEALLOCATE_PREPARE), SHOW_LONG},
{"Com_delete", (char*) (com_stat+(uint) SQLCOM_DELETE),SHOW_LONG}, {"Com_delete", (char*) (com_stat+(uint) SQLCOM_DELETE),SHOW_LONG},
{"Com_delete_multi", (char*) (com_stat+(uint) SQLCOM_DELETE_MULTI),SHOW_LONG}, {"Com_delete_multi", (char*) (com_stat+(uint) SQLCOM_DELETE_MULTI),SHOW_LONG},
{"Com_do", (char*) (com_stat+(uint) SQLCOM_DO),SHOW_LONG}, {"Com_do", (char*) (com_stat+(uint) SQLCOM_DO),SHOW_LONG},
...@@ -5069,6 +5071,8 @@ struct show_var_st status_vars[]= { ...@@ -5069,6 +5071,8 @@ struct show_var_st status_vars[]= {
{"Com_drop_index", (char*) (com_stat+(uint) SQLCOM_DROP_INDEX),SHOW_LONG}, {"Com_drop_index", (char*) (com_stat+(uint) SQLCOM_DROP_INDEX),SHOW_LONG},
{"Com_drop_table", (char*) (com_stat+(uint) SQLCOM_DROP_TABLE),SHOW_LONG}, {"Com_drop_table", (char*) (com_stat+(uint) SQLCOM_DROP_TABLE),SHOW_LONG},
{"Com_drop_user", (char*) (com_stat+(uint) SQLCOM_DROP_USER),SHOW_LONG}, {"Com_drop_user", (char*) (com_stat+(uint) SQLCOM_DROP_USER),SHOW_LONG},
{"Com_execute_sql", (char*) (com_stat+(uint) SQLCOM_EXECUTE),
SHOW_LONG},
{"Com_flush", (char*) (com_stat+(uint) SQLCOM_FLUSH),SHOW_LONG}, {"Com_flush", (char*) (com_stat+(uint) SQLCOM_FLUSH),SHOW_LONG},
{"Com_grant", (char*) (com_stat+(uint) SQLCOM_GRANT),SHOW_LONG}, {"Com_grant", (char*) (com_stat+(uint) SQLCOM_GRANT),SHOW_LONG},
{"Com_ha_close", (char*) (com_stat+(uint) SQLCOM_HA_CLOSE),SHOW_LONG}, {"Com_ha_close", (char*) (com_stat+(uint) SQLCOM_HA_CLOSE),SHOW_LONG},
...@@ -5084,6 +5088,8 @@ struct show_var_st status_vars[]= { ...@@ -5084,6 +5088,8 @@ struct show_var_st status_vars[]= {
{"Com_lock_tables", (char*) (com_stat+(uint) SQLCOM_LOCK_TABLES),SHOW_LONG}, {"Com_lock_tables", (char*) (com_stat+(uint) SQLCOM_LOCK_TABLES),SHOW_LONG},
{"Com_optimize", (char*) (com_stat+(uint) SQLCOM_OPTIMIZE),SHOW_LONG}, {"Com_optimize", (char*) (com_stat+(uint) SQLCOM_OPTIMIZE),SHOW_LONG},
{"Com_preload_keys", (char*) (com_stat+(uint) SQLCOM_PRELOAD_KEYS),SHOW_LONG}, {"Com_preload_keys", (char*) (com_stat+(uint) SQLCOM_PRELOAD_KEYS),SHOW_LONG},
{"Com_prepare_sql", (char*) (com_stat+(uint) SQLCOM_PREPARE),
SHOW_LONG},
{"Com_purge", (char*) (com_stat+(uint) SQLCOM_PURGE),SHOW_LONG}, {"Com_purge", (char*) (com_stat+(uint) SQLCOM_PURGE),SHOW_LONG},
{"Com_purge_before_date", (char*) (com_stat+(uint) SQLCOM_PURGE_BEFORE),SHOW_LONG}, {"Com_purge_before_date", (char*) (com_stat+(uint) SQLCOM_PURGE_BEFORE),SHOW_LONG},
{"Com_rename_table", (char*) (com_stat+(uint) SQLCOM_RENAME_TABLE),SHOW_LONG}, {"Com_rename_table", (char*) (com_stat+(uint) SQLCOM_RENAME_TABLE),SHOW_LONG},
...@@ -5130,12 +5136,6 @@ struct show_var_st status_vars[]= { ...@@ -5130,12 +5136,6 @@ struct show_var_st status_vars[]= {
{"Com_unlock_tables", (char*) (com_stat+(uint) SQLCOM_UNLOCK_TABLES),SHOW_LONG}, {"Com_unlock_tables", (char*) (com_stat+(uint) SQLCOM_UNLOCK_TABLES),SHOW_LONG},
{"Com_update", (char*) (com_stat+(uint) SQLCOM_UPDATE),SHOW_LONG}, {"Com_update", (char*) (com_stat+(uint) SQLCOM_UPDATE),SHOW_LONG},
{"Com_update_multi", (char*) (com_stat+(uint) SQLCOM_UPDATE_MULTI),SHOW_LONG}, {"Com_update_multi", (char*) (com_stat+(uint) SQLCOM_UPDATE_MULTI),SHOW_LONG},
{"Com_prepare_sql", (char*) (com_stat+(uint) SQLCOM_PREPARE),
SHOW_LONG},
{"Com_execute_sql", (char*) (com_stat+(uint) SQLCOM_EXECUTE),
SHOW_LONG},
{"Com_dealloc_sql", (char*) (com_stat+(uint)
SQLCOM_DEALLOCATE_PREPARE), SHOW_LONG},
{"Connections", (char*) &thread_id, SHOW_LONG_CONST}, {"Connections", (char*) &thread_id, SHOW_LONG_CONST},
{"Created_tmp_disk_tables", (char*) &created_tmp_disk_tables,SHOW_LONG}, {"Created_tmp_disk_tables", (char*) &created_tmp_disk_tables,SHOW_LONG},
{"Created_tmp_files", (char*) &my_tmp_file_created, SHOW_LONG}, {"Created_tmp_files", (char*) &my_tmp_file_created, SHOW_LONG},
...@@ -5146,6 +5146,7 @@ struct show_var_st status_vars[]= { ...@@ -5146,6 +5146,7 @@ struct show_var_st status_vars[]= {
{"Flush_commands", (char*) &refresh_version, SHOW_LONG_CONST}, {"Flush_commands", (char*) &refresh_version, SHOW_LONG_CONST},
{"Handler_commit", (char*) &ha_commit_count, SHOW_LONG}, {"Handler_commit", (char*) &ha_commit_count, SHOW_LONG},
{"Handler_delete", (char*) &ha_delete_count, SHOW_LONG}, {"Handler_delete", (char*) &ha_delete_count, SHOW_LONG},
{"Handler_discover", (char*) &ha_discover_count, SHOW_LONG},
{"Handler_read_first", (char*) &ha_read_first_count, SHOW_LONG}, {"Handler_read_first", (char*) &ha_read_first_count, SHOW_LONG},
{"Handler_read_key", (char*) &ha_read_key_count, SHOW_LONG}, {"Handler_read_key", (char*) &ha_read_key_count, SHOW_LONG},
{"Handler_read_next", (char*) &ha_read_next_count, SHOW_LONG}, {"Handler_read_next", (char*) &ha_read_next_count, SHOW_LONG},
...@@ -5155,13 +5156,12 @@ struct show_var_st status_vars[]= { ...@@ -5155,13 +5156,12 @@ struct show_var_st status_vars[]= {
{"Handler_rollback", (char*) &ha_rollback_count, SHOW_LONG}, {"Handler_rollback", (char*) &ha_rollback_count, SHOW_LONG},
{"Handler_update", (char*) &ha_update_count, SHOW_LONG}, {"Handler_update", (char*) &ha_update_count, SHOW_LONG},
{"Handler_write", (char*) &ha_write_count, SHOW_LONG}, {"Handler_write", (char*) &ha_write_count, SHOW_LONG},
{"Handler_discover", (char*) &ha_discover_count, SHOW_LONG},
{"Key_blocks_not_flushed", (char*) &dflt_key_cache_var.global_blocks_changed, {"Key_blocks_not_flushed", (char*) &dflt_key_cache_var.global_blocks_changed,
SHOW_KEY_CACHE_LONG}, SHOW_KEY_CACHE_LONG},
{"Key_blocks_used", (char*) &dflt_key_cache_var.blocks_used,
SHOW_KEY_CACHE_CONST_LONG},
{"Key_blocks_unused", (char*) &dflt_key_cache_var.blocks_unused, {"Key_blocks_unused", (char*) &dflt_key_cache_var.blocks_unused,
SHOW_KEY_CACHE_CONST_LONG}, SHOW_KEY_CACHE_CONST_LONG},
{"Key_blocks_used", (char*) &dflt_key_cache_var.blocks_used,
SHOW_KEY_CACHE_CONST_LONG},
{"Key_read_requests", (char*) &dflt_key_cache_var.global_cache_r_requests, {"Key_read_requests", (char*) &dflt_key_cache_var.global_cache_r_requests,
SHOW_KEY_CACHE_LONG}, SHOW_KEY_CACHE_LONG},
{"Key_reads", (char*) &dflt_key_cache_var.global_cache_read, {"Key_reads", (char*) &dflt_key_cache_var.global_cache_read,
......
...@@ -611,8 +611,8 @@ struct show_var_st init_vars[]= { ...@@ -611,8 +611,8 @@ struct show_var_st init_vars[]= {
#ifdef HAVE_BERKELEY_DB #ifdef HAVE_BERKELEY_DB
{"bdb_cache_size", (char*) &berkeley_cache_size, SHOW_LONG}, {"bdb_cache_size", (char*) &berkeley_cache_size, SHOW_LONG},
{"bdb_home", (char*) &berkeley_home, SHOW_CHAR_PTR}, {"bdb_home", (char*) &berkeley_home, SHOW_CHAR_PTR},
{"bdb_logdir", (char*) &berkeley_logdir, SHOW_CHAR_PTR},
{"bdb_log_buffer_size", (char*) &berkeley_log_buffer_size, SHOW_LONG}, {"bdb_log_buffer_size", (char*) &berkeley_log_buffer_size, SHOW_LONG},
{"bdb_logdir", (char*) &berkeley_logdir, SHOW_CHAR_PTR},
{"bdb_max_lock", (char*) &berkeley_max_lock, SHOW_LONG}, {"bdb_max_lock", (char*) &berkeley_max_lock, SHOW_LONG},
{"bdb_shared_data", (char*) &berkeley_shared_data, SHOW_BOOL}, {"bdb_shared_data", (char*) &berkeley_shared_data, SHOW_BOOL},
{"bdb_tmpdir", (char*) &berkeley_tmpdir, SHOW_CHAR_PTR}, {"bdb_tmpdir", (char*) &berkeley_tmpdir, SHOW_CHAR_PTR},
...@@ -652,9 +652,9 @@ struct show_var_st init_vars[]= { ...@@ -652,9 +652,9 @@ struct show_var_st init_vars[]= {
{"have_bdb", (char*) &have_berkeley_db, SHOW_HAVE}, {"have_bdb", (char*) &have_berkeley_db, SHOW_HAVE},
{"have_compress", (char*) &have_compress, SHOW_HAVE}, {"have_compress", (char*) &have_compress, SHOW_HAVE},
{"have_crypt", (char*) &have_crypt, SHOW_HAVE}, {"have_crypt", (char*) &have_crypt, SHOW_HAVE},
{"have_geometry", (char*) &have_geometry, SHOW_HAVE},
{"have_innodb", (char*) &have_innodb, SHOW_HAVE}, {"have_innodb", (char*) &have_innodb, SHOW_HAVE},
{"have_isam", (char*) &have_isam, SHOW_HAVE}, {"have_isam", (char*) &have_isam, SHOW_HAVE},
{"have_geometry", (char*) &have_geometry, SHOW_HAVE},
{"have_ndbcluster", (char*) &have_ndbcluster, SHOW_HAVE}, {"have_ndbcluster", (char*) &have_ndbcluster, SHOW_HAVE},
{"have_openssl", (char*) &have_openssl, SHOW_HAVE}, {"have_openssl", (char*) &have_openssl, SHOW_HAVE},
{"have_query_cache", (char*) &have_query_cache, SHOW_HAVE}, {"have_query_cache", (char*) &have_query_cache, SHOW_HAVE},
......
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