From c0941e427888b43460c85e58ab91b423844bb679 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Aug 2005 10:22:48 -0700 Subject: [PATCH 001/225] Import zlib-1.2.3 library zlib/ChangeLog: Import zlib-1.2.3 zlib/FAQ: Import zlib-1.2.3 zlib/README: Import zlib-1.2.3 zlib/adler32.c: Import zlib-1.2.3 zlib/compress.c: Import zlib-1.2.3 zlib/crc32.c: Import zlib-1.2.3 zlib/deflate.c: Import zlib-1.2.3 zlib/deflate.h: Import zlib-1.2.3 zlib/gzio.c: Import zlib-1.2.3 zlib/infback.c: Import zlib-1.2.3 zlib/inffast.c: Import zlib-1.2.3 zlib/inflate.c: Import zlib-1.2.3 zlib/inflate.h: Import zlib-1.2.3 zlib/inftrees.c: Import zlib-1.2.3 zlib/inftrees.h: Import zlib-1.2.3 zlib/trees.c: Import zlib-1.2.3 zlib/zconf.h: Import zlib-1.2.3 zlib/zlib.3: Import zlib-1.2.3 zlib/zlib.h: Import zlib-1.2.3 zlib/zutil.c: Import zlib-1.2.3 zlib/zutil.h: Import zlib-1.2.3 zlib/README.MySQL: Import zlib-1.2.3 --- zlib/ChangeLog | 98 +++++++++++++++- zlib/FAQ | 26 +++-- zlib/README | 9 +- zlib/README.MySQL | 7 ++ zlib/adler32.c | 111 +++++++++++++++--- zlib/compress.c | 2 +- zlib/crc32.c | 102 ++++++++++++++++- zlib/deflate.c | 282 ++++++++++++++++++++++++++++++++++++++++++---- zlib/deflate.h | 10 +- zlib/gzio.c | 51 ++++++--- zlib/infback.c | 11 +- zlib/inffast.c | 13 +++ zlib/inflate.c | 126 ++++++++++++++++++--- zlib/inflate.h | 8 +- zlib/inftrees.c | 9 +- zlib/inftrees.h | 10 +- zlib/trees.c | 36 +++--- zlib/zconf.h | 12 +- zlib/zlib.3 | 6 +- zlib/zlib.h | 229 +++++++++++++++++++++++++++++++------ zlib/zutil.c | 33 +++--- zlib/zutil.h | 30 +++-- 22 files changed, 1008 insertions(+), 213 deletions(-) create mode 100644 zlib/README.MySQL diff --git a/zlib/ChangeLog b/zlib/ChangeLog index 1af7633d668..7f6869d3235 100644 --- a/zlib/ChangeLog +++ b/zlib/ChangeLog @@ -1,10 +1,96 @@ ChangeLog file for zlib -Changes in port for MySQL (19 July 2004) -- removed contrib, nt, os2, amiga, directories and some other files not used -in MySQL distribution. If you are working on porting MySQL to one of rare -platforms, you might find worth looking at the original zlib distribution -and using appropriate Makefiles/project files from it. + +Changes in 1.2.3 (18 July 2005) +- Apply security vulnerability fixes to contrib/infback9 as well +- Clean up some text files (carriage returns, trailing space) +- Update testzlib, vstudio, masmx64, and masmx86 in contrib [Vollant] + +Changes in 1.2.2.4 (11 July 2005) +- Add inflatePrime() function for starting inflation at bit boundary +- Avoid some Visual C warnings in deflate.c +- Avoid more silly Visual C warnings in inflate.c and inftrees.c for 64-bit + compile +- Fix some spelling errors in comments [Betts] +- Correct inflateInit2() error return documentation in zlib.h +- Added zran.c example of compressed data random access to examples + directory, shows use of inflatePrime() +- Fix cast for assignments to strm->state in inflate.c and infback.c +- Fix zlibCompileFlags() in zutil.c to use 1L for long shifts [Oberhumer] +- Move declarations of gf2 functions to right place in crc32.c [Oberhumer] +- Add cast in trees.c t avoid a warning [Oberhumer] +- Avoid some warnings in fitblk.c, gun.c, gzjoin.c in examples [Oberhumer] +- Update make_vms.com [Zinser] +- Initialize state->write in inflateReset() since copied in inflate_fast() +- Be more strict on incomplete code sets in inflate_table() and increase + ENOUGH and MAXD -- this repairs a possible security vulnerability for + invalid inflate input. Thanks to Tavis Ormandy and Markus Oberhumer for + discovering the vulnerability and providing test cases. +- Add ia64 support to configure for HP-UX [Smith] +- Add error return to gzread() for format or i/o error [Levin] +- Use malloc.h for OS/2 [Necasek] + +Changes in 1.2.2.3 (27 May 2005) +- Replace 1U constants in inflate.c and inftrees.c for 64-bit compile +- Typecast fread() return values in gzio.c [Vollant] +- Remove trailing space in minigzip.c outmode (VC++ can't deal with it) +- Fix crc check bug in gzread() after gzungetc() [Heiner] +- Add the deflateTune() function to adjust internal compression parameters +- Add a fast gzip decompressor, gun.c, to examples (use of inflateBack) +- Remove an incorrect assertion in examples/zpipe.c +- Add C++ wrapper in infback9.h [Donais] +- Fix bug in inflateCopy() when decoding fixed codes +- Note in zlib.h how much deflateSetDictionary() actually uses +- Remove USE_DICT_HEAD in deflate.c (would mess up inflate if used) +- Add _WIN32_WCE to define WIN32 in zconf.in.h [Spencer] +- Don't include stderr.h or errno.h for _WIN32_WCE in zutil.h [Spencer] +- Add gzdirect() function to indicate transparent reads +- Update contrib/minizip [Vollant] +- Fix compilation of deflate.c when both ASMV and FASTEST [Oberhumer] +- Add casts in crc32.c to avoid warnings [Oberhumer] +- Add contrib/masmx64 [Vollant] +- Update contrib/asm586, asm686, masmx86, testzlib, vstudio [Vollant] + +Changes in 1.2.2.2 (30 December 2004) +- Replace structure assignments in deflate.c and inflate.c with zmemcpy to + avoid implicit memcpy calls (portability for no-library compilation) +- Increase sprintf() buffer size in gzdopen() to allow for large numbers +- Add INFLATE_STRICT to check distances against zlib header +- Improve WinCE errno handling and comments [Chang] +- Remove comment about no gzip header processing in FAQ +- Add Z_FIXED strategy option to deflateInit2() to force fixed trees +- Add updated make_vms.com [Coghlan], update README +- Create a new "examples" directory, move gzappend.c there, add zpipe.c, + fitblk.c, gzlog.[ch], gzjoin.c, and zlib_how.html. +- Add FAQ entry and comments in deflate.c on uninitialized memory access +- Add Solaris 9 make options in configure [Gilbert] +- Allow strerror() usage in gzio.c for STDC +- Fix DecompressBuf in contrib/delphi/ZLib.pas [ManChesTer] +- Update contrib/masmx86/inffas32.asm and gvmat32.asm [Vollant] +- Use z_off_t for adler32_combine() and crc32_combine() lengths +- Make adler32() much faster for small len +- Use OS_CODE in deflate() default gzip header + +Changes in 1.2.2.1 (31 October 2004) +- Allow inflateSetDictionary() call for raw inflate +- Fix inflate header crc check bug for file names and comments +- Add deflateSetHeader() and gz_header structure for custom gzip headers +- Add inflateGetheader() to retrieve gzip headers +- Add crc32_combine() and adler32_combine() functions +- Add alloc_func, free_func, in_func, out_func to Z_PREFIX list +- Use zstreamp consistently in zlib.h (inflate_back functions) +- Remove GUNZIP condition from definition of inflate_mode in inflate.h + and in contrib/inflate86/inffast.S [Truta, Anderson] +- Add support for AMD64 in contrib/inflate86/inffas86.c [Anderson] +- Update projects/README.projects and projects/visualc6 [Truta] +- Update win32/DLL_FAQ.txt [Truta] +- Avoid warning under NO_GZCOMPRESS in gzio.c; fix typo [Truta] +- Deprecate Z_ASCII; use Z_TEXT instead [Truta] +- Use a new algorithm for setting strm->data_type in trees.c [Truta] +- Do not define an exit() prototype in zutil.c unless DEBUG defined +- Remove prototype of exit() from zutil.c, example.c, minigzip.c [Truta] +- Add comment in zlib.h for Z_NO_FLUSH parameter to deflate() +- Fix Darwin build version identification [Peterson] Changes in 1.2.2 (3 October 2004) - Update zlib.h comments on gzip in-memory processing @@ -454,7 +540,7 @@ Changes in 1.0.7 (20 Jan 1998) Changes in 1.0.6 (19 Jan 1998) - add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code) -- Fix a deflate bug occuring only with compression level 0 (thanks to +- Fix a deflate bug occurring only with compression level 0 (thanks to Andy Buckler for finding this one). - In minigzip, pass transparently also the first byte for .Z files. - return Z_BUF_ERROR instead of Z_OK if output buffer full in uncompress() diff --git a/zlib/FAQ b/zlib/FAQ index 4f61f1094e6..441d910daa1 100644 --- a/zlib/FAQ +++ b/zlib/FAQ @@ -148,13 +148,6 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html format using deflateInit2(). You can also request that inflate decode the gzip format using inflateInit2(). Read zlib.h for more details. - Note that you cannot specify special gzip header contents (e.g. a file - name or modification date), nor will inflate tell you what was in the - gzip header. If you need to customize the header or see what's in it, - you can use the raw deflate and inflate operations and the crc32() - function and roll your own gzip encoding and decoding. Read the gzip - RFC 1952 for details of the header and trailer format. - 21. Is zlib thread-safe? Yes. However any library routines that zlib uses and any application- @@ -295,20 +288,29 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html were downright silly. So now, we simply make sure that the code always works. -36. Will zlib read the (insert any ancient or arcane format here) compressed +36. Valgrind (or some similar memory access checker) says that deflate is + performing a conditional jump that depends on an uninitialized value. + Isn't that a bug? + + No. That is intentional for performance reasons, and the output of + deflate is not affected. This only started showing up recently since + zlib 1.2.x uses malloc() by default for allocations, whereas earlier + versions used calloc(), which zeros out the allocated memory. + +37. Will zlib read the (insert any ancient or arcane format here) compressed data format? Probably not. Look in the comp.compression FAQ for pointers to various formats and associated software. -37. How can I encrypt/decrypt zip files with zlib? +38. How can I encrypt/decrypt zip files with zlib? zlib doesn't support encryption. The original PKZIP encryption is very weak and can be broken with freely available programs. To get strong encryption, use GnuPG, http://www.gnupg.org/ , which already includes zlib compression. For PKZIP compatible "encryption", look at http://www.info-zip.org/ -38. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings? +39. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings? "gzip" is the gzip format, and "deflate" is the zlib format. They should probably have called the second one "zlib" instead to avoid confusion @@ -324,14 +326,14 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html Bottom line: use the gzip format for HTTP 1.1 encoding. -39. Does zlib support the new "Deflate64" format introduced by PKWare? +40. Does zlib support the new "Deflate64" format introduced by PKWare? No. PKWare has apparently decided to keep that format proprietary, since they have not documented it as they have previous compression formats. In any case, the compression improvements are so modest compared to other more modern approaches, that it's not worth the effort to implement. -40. Can you please sign these lengthy legal documents and fax them back to us +41. Can you please sign these lengthy legal documents and fax them back to us so that we can use your software in our product? No. Go away. Shoo. diff --git a/zlib/README b/zlib/README index df95ae13f54..758cc50020d 100644 --- a/zlib/README +++ b/zlib/README @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.2 is a general purpose data compression library. All the code is +zlib 1.2.3 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) @@ -16,9 +16,8 @@ minigzip.c. To compile all files and run the test program, follow the instructions given at the top of Makefile. In short "make test; make install" should work for most -machines. For Unix: "./configure; make test; make install" For MSDOS, use one -of the special makefiles such as Makefile.msc. For VMS, use Make_vms.com or -descrip.mms. +machines. For Unix: "./configure; make test; make install". For MSDOS, use one +of the special makefiles such as Makefile.msc. For VMS, use make_vms.com. Questions about zlib should be sent to , or to Gilles Vollant for the Windows DLL version. The zlib home page is @@ -34,7 +33,7 @@ Mark Nelson wrote an article about zlib for the Jan. 1997 issue of Dr. Dobb's Journal; a copy of the article is available in http://dogma.net/markn/articles/zlibtool/zlibtool.htm -The changes made in version 1.2.2 are documented in the file ChangeLog. +The changes made in version 1.2.3 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory "contrib". diff --git a/zlib/README.MySQL b/zlib/README.MySQL new file mode 100644 index 00000000000..355dfb62d71 --- /dev/null +++ b/zlib/README.MySQL @@ -0,0 +1,7 @@ +This an incomplete version of the zlib library -- it excludes some of the +platform-specific project files, contributed code, and examples from the +original zlib distribution. You can find the original distribution at + + http://www.gzip.org/zlib/ + or + http://www.zlib.net/ diff --git a/zlib/adler32.c b/zlib/adler32.c index 624a1696eb0..007ba26277c 100644 --- a/zlib/adler32.c +++ b/zlib/adler32.c @@ -1,5 +1,5 @@ /* adler32.c -- compute the Adler-32 checksum of a data stream - * Copyright (C) 1995-2003 Mark Adler + * Copyright (C) 1995-2004 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -12,12 +12,13 @@ #define NMAX 5552 /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ -#define DO1(buf,i) {s1 += buf[i]; s2 += s1;} +#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;} #define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); #define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); #define DO16(buf) DO8(buf,0); DO8(buf,8); +/* use NO_DIVIDE if your processor does not do division in hardware */ #ifdef NO_DIVIDE # define MOD(a) \ do { \ @@ -39,8 +40,17 @@ if (a >= (BASE << 1)) a -= (BASE << 1); \ if (a >= BASE) a -= BASE; \ } while (0) +# define MOD4(a) \ + do { \ + if (a >= (BASE << 4)) a -= (BASE << 4); \ + if (a >= (BASE << 3)) a -= (BASE << 3); \ + if (a >= (BASE << 2)) a -= (BASE << 2); \ + if (a >= (BASE << 1)) a -= (BASE << 1); \ + if (a >= BASE) a -= BASE; \ + } while (0) #else # define MOD(a) a %= BASE +# define MOD4(a) a %= BASE #endif /* ========================================================================= */ @@ -49,26 +59,91 @@ uLong ZEXPORT adler32(adler, buf, len) const Bytef *buf; uInt len; { - unsigned long s1 = adler & 0xffff; - unsigned long s2 = (adler >> 16) & 0xffff; - int k; + unsigned long sum2; + unsigned n; - if (buf == Z_NULL) return 1L; + /* split Adler-32 into component sums */ + sum2 = (adler >> 16) & 0xffff; + adler &= 0xffff; - while (len > 0) { - k = len < NMAX ? (int)len : NMAX; - len -= k; - while (k >= 16) { + /* in case user likes doing a byte at a time, keep it fast */ + if (len == 1) { + adler += buf[0]; + if (adler >= BASE) + adler -= BASE; + sum2 += adler; + if (sum2 >= BASE) + sum2 -= BASE; + return adler | (sum2 << 16); + } + + /* initial Adler-32 value (deferred check for len == 1 speed) */ + if (buf == Z_NULL) + return 1L; + + /* in case short lengths are provided, keep it somewhat fast */ + if (len < 16) { + while (len--) { + adler += *buf++; + sum2 += adler; + } + if (adler >= BASE) + adler -= BASE; + MOD4(sum2); /* only added so many BASE's */ + return adler | (sum2 << 16); + } + + /* do length NMAX blocks -- requires just one modulo operation */ + while (len >= NMAX) { + len -= NMAX; + n = NMAX / 16; /* NMAX is divisible by 16 */ + do { + DO16(buf); /* 16 sums unrolled */ + buf += 16; + } while (--n); + MOD(adler); + MOD(sum2); + } + + /* do remaining bytes (less than NMAX, still just one modulo) */ + if (len) { /* avoid modulos if none remaining */ + while (len >= 16) { + len -= 16; DO16(buf); buf += 16; - k -= 16; } - if (k != 0) do { - s1 += *buf++; - s2 += s1; - } while (--k); - MOD(s1); - MOD(s2); + while (len--) { + adler += *buf++; + sum2 += adler; + } + MOD(adler); + MOD(sum2); } - return (s2 << 16) | s1; + + /* return recombined sums */ + return adler | (sum2 << 16); +} + +/* ========================================================================= */ +uLong ZEXPORT adler32_combine(adler1, adler2, len2) + uLong adler1; + uLong adler2; + z_off_t len2; +{ + unsigned long sum1; + unsigned long sum2; + unsigned rem; + + /* the derivation of this formula is left as an exercise for the reader */ + rem = (unsigned)(len2 % BASE); + sum1 = adler1 & 0xffff; + sum2 = rem * sum1; + MOD(sum2); + sum1 += (adler2 & 0xffff) + BASE - 1; + sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem; + if (sum1 > BASE) sum1 -= BASE; + if (sum1 > BASE) sum1 -= BASE; + if (sum2 > (BASE << 1)) sum2 -= (BASE << 1); + if (sum2 > BASE) sum2 -= BASE; + return sum1 | (sum2 << 16); } diff --git a/zlib/compress.c b/zlib/compress.c index 24ef0291911..df04f0148e6 100644 --- a/zlib/compress.c +++ b/zlib/compress.c @@ -1,5 +1,5 @@ /* compress.c -- compress a memory buffer - * Copyright (C) 1995-2002 Jean-loup Gailly. + * Copyright (C) 1995-2003 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ diff --git a/zlib/crc32.c b/zlib/crc32.c index b39c7e1253e..f658a9ef55e 100644 --- a/zlib/crc32.c +++ b/zlib/crc32.c @@ -1,12 +1,12 @@ /* crc32.c -- compute the CRC-32 of a data stream - * Copyright (C) 1995-2003 Mark Adler + * Copyright (C) 1995-2005 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h * * Thanks to Rodney Brown for his contribution of faster * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing * tables for updating the shift register in one step with three exclusive-ors - * instead of four steps with four exclusive-ors. This results about a factor - * of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3. + * instead of four steps with four exclusive-ors. This results in about a + * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3. */ /* @(#) $Id$ */ @@ -64,6 +64,11 @@ # define TBLS 1 #endif /* BYFOUR */ +/* Local functions for crc concatenation */ +local unsigned long gf2_matrix_times OF((unsigned long *mat, + unsigned long vec)); +local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat)); + #ifdef DYNAMIC_CRC_TABLE local volatile int crc_table_empty = 1; @@ -72,7 +77,6 @@ local void make_crc_table OF((void)); #ifdef MAKECRCH local void write_table OF((FILE *, const unsigned long FAR *)); #endif /* MAKECRCH */ - /* Generate tables for a byte-wise 32-bit CRC calculation on the polynomial: x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. @@ -270,7 +274,7 @@ local unsigned long crc32_little(crc, buf, len) len--; } - buf4 = (const u4 FAR *)buf; + buf4 = (const u4 FAR *)(const void FAR *)buf; while (len >= 32) { DOLIT32; len -= 32; @@ -310,7 +314,7 @@ local unsigned long crc32_big(crc, buf, len) len--; } - buf4 = (const u4 FAR *)buf; + buf4 = (const u4 FAR *)(const void FAR *)buf; buf4--; while (len >= 32) { DOBIG32; @@ -331,3 +335,89 @@ local unsigned long crc32_big(crc, buf, len) } #endif /* BYFOUR */ + +#define GF2_DIM 32 /* dimension of GF(2) vectors (length of CRC) */ + +/* ========================================================================= */ +local unsigned long gf2_matrix_times(mat, vec) + unsigned long *mat; + unsigned long vec; +{ + unsigned long sum; + + sum = 0; + while (vec) { + if (vec & 1) + sum ^= *mat; + vec >>= 1; + mat++; + } + return sum; +} + +/* ========================================================================= */ +local void gf2_matrix_square(square, mat) + unsigned long *square; + unsigned long *mat; +{ + int n; + + for (n = 0; n < GF2_DIM; n++) + square[n] = gf2_matrix_times(mat, mat[n]); +} + +/* ========================================================================= */ +uLong ZEXPORT crc32_combine(crc1, crc2, len2) + uLong crc1; + uLong crc2; + z_off_t len2; +{ + int n; + unsigned long row; + unsigned long even[GF2_DIM]; /* even-power-of-two zeros operator */ + unsigned long odd[GF2_DIM]; /* odd-power-of-two zeros operator */ + + /* degenerate case */ + if (len2 == 0) + return crc1; + + /* put operator for one zero bit in odd */ + odd[0] = 0xedb88320L; /* CRC-32 polynomial */ + row = 1; + for (n = 1; n < GF2_DIM; n++) { + odd[n] = row; + row <<= 1; + } + + /* put operator for two zero bits in even */ + gf2_matrix_square(even, odd); + + /* put operator for four zero bits in odd */ + gf2_matrix_square(odd, even); + + /* apply len2 zeros to crc1 (first square will put the operator for one + zero byte, eight zero bits, in even) */ + do { + /* apply zeros operator for this bit of len2 */ + gf2_matrix_square(even, odd); + if (len2 & 1) + crc1 = gf2_matrix_times(even, crc1); + len2 >>= 1; + + /* if no more bits set, then done */ + if (len2 == 0) + break; + + /* another iteration of the loop with odd and even swapped */ + gf2_matrix_square(odd, even); + if (len2 & 1) + crc1 = gf2_matrix_times(odd, crc1); + len2 >>= 1; + + /* if no more bits set, then done */ + } while (len2 != 0); + + /* return combined crc */ + crc1 ^= crc2; + return crc1; +} diff --git a/zlib/deflate.c b/zlib/deflate.c index 0fc53bc1e82..29ce1f64a57 100644 --- a/zlib/deflate.c +++ b/zlib/deflate.c @@ -1,5 +1,5 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2004 Jean-loup Gailly. + * Copyright (C) 1995-2005 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.2 Copyright 1995-2004 Jean-loup Gailly "; + " deflate 1.2.3 Copyright 1995-2005 Jean-loup Gailly "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -264,7 +264,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, #endif if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_RLE) { + strategy < 0 || strategy > Z_FIXED) { return Z_STREAM_ERROR; } if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */ @@ -274,6 +274,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, s->strm = strm; s->wrap = wrap; + s->gzhead = Z_NULL; s->w_bits = windowBits; s->w_size = 1 << s->w_bits; s->w_mask = s->w_size - 1; @@ -333,9 +334,7 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) if (length < MIN_MATCH) return Z_OK; if (length > MAX_DIST(s)) { length = MAX_DIST(s); -#ifndef USE_DICT_HEAD dictionary += dictLength - length; /* use the tail of the dictionary */ -#endif } zmemcpy(s->window, dictionary, length); s->strstart = length; @@ -390,6 +389,17 @@ int ZEXPORT deflateReset (strm) return Z_OK; } +/* ========================================================================= */ +int ZEXPORT deflateSetHeader (strm, head) + z_streamp strm; + gz_headerp head; +{ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (strm->state->wrap != 2) return Z_STREAM_ERROR; + strm->state->gzhead = head; + return Z_OK; +} + /* ========================================================================= */ int ZEXPORT deflatePrime (strm, bits, value) z_streamp strm; @@ -420,7 +430,7 @@ int ZEXPORT deflateParams(strm, level, strategy) #else if (level == Z_DEFAULT_COMPRESSION) level = 6; #endif - if (level < 0 || level > 9 || strategy < 0 || strategy > Z_RLE) { + if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) { return Z_STREAM_ERROR; } func = configuration_table[s->level].func; @@ -440,6 +450,25 @@ int ZEXPORT deflateParams(strm, level, strategy) return err; } +/* ========================================================================= */ +int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) + z_streamp strm; + int good_length; + int max_lazy; + int nice_length; + int max_chain; +{ + deflate_state *s; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + s = strm->state; + s->good_match = good_length; + s->max_lazy_match = max_lazy; + s->nice_match = nice_length; + s->max_chain_length = max_chain; + return Z_OK; +} + /* ========================================================================= * For the default windowBits of 15 and memLevel of 8, this function returns * a close to exact, as well as small, upper bound on the compressed size. @@ -548,20 +577,47 @@ int ZEXPORT deflate (strm, flush) if (s->status == INIT_STATE) { #ifdef GZIP if (s->wrap == 2) { + strm->adler = crc32(0L, Z_NULL, 0); put_byte(s, 31); put_byte(s, 139); put_byte(s, 8); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, s->level == 9 ? 2 : - (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? - 4 : 0)); - put_byte(s, 255); - s->status = BUSY_STATE; - strm->adler = crc32(0L, Z_NULL, 0); + if (s->gzhead == NULL) { + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, s->level == 9 ? 2 : + (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? + 4 : 0)); + put_byte(s, OS_CODE); + s->status = BUSY_STATE; + } + else { + put_byte(s, (s->gzhead->text ? 1 : 0) + + (s->gzhead->hcrc ? 2 : 0) + + (s->gzhead->extra == Z_NULL ? 0 : 4) + + (s->gzhead->name == Z_NULL ? 0 : 8) + + (s->gzhead->comment == Z_NULL ? 0 : 16) + ); + put_byte(s, (Byte)(s->gzhead->time & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff)); + put_byte(s, s->level == 9 ? 2 : + (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? + 4 : 0)); + put_byte(s, s->gzhead->os & 0xff); + if (s->gzhead->extra != NULL) { + put_byte(s, s->gzhead->extra_len & 0xff); + put_byte(s, (s->gzhead->extra_len >> 8) & 0xff); + } + if (s->gzhead->hcrc) + strm->adler = crc32(strm->adler, s->pending_buf, + s->pending); + s->gzindex = 0; + s->status = EXTRA_STATE; + } } else #endif @@ -592,6 +648,110 @@ int ZEXPORT deflate (strm, flush) strm->adler = adler32(0L, Z_NULL, 0); } } +#ifdef GZIP + if (s->status == EXTRA_STATE) { + if (s->gzhead->extra != NULL) { + uInt beg = s->pending; /* start of bytes to update crc */ + + while (s->gzindex < (s->gzhead->extra_len & 0xffff)) { + if (s->pending == s->pending_buf_size) { + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + flush_pending(strm); + beg = s->pending; + if (s->pending == s->pending_buf_size) + break; + } + put_byte(s, s->gzhead->extra[s->gzindex]); + s->gzindex++; + } + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + if (s->gzindex == s->gzhead->extra_len) { + s->gzindex = 0; + s->status = NAME_STATE; + } + } + else + s->status = NAME_STATE; + } + if (s->status == NAME_STATE) { + if (s->gzhead->name != NULL) { + uInt beg = s->pending; /* start of bytes to update crc */ + int val; + + do { + if (s->pending == s->pending_buf_size) { + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + flush_pending(strm); + beg = s->pending; + if (s->pending == s->pending_buf_size) { + val = 1; + break; + } + } + val = s->gzhead->name[s->gzindex++]; + put_byte(s, val); + } while (val != 0); + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + if (val == 0) { + s->gzindex = 0; + s->status = COMMENT_STATE; + } + } + else + s->status = COMMENT_STATE; + } + if (s->status == COMMENT_STATE) { + if (s->gzhead->comment != NULL) { + uInt beg = s->pending; /* start of bytes to update crc */ + int val; + + do { + if (s->pending == s->pending_buf_size) { + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + flush_pending(strm); + beg = s->pending; + if (s->pending == s->pending_buf_size) { + val = 1; + break; + } + } + val = s->gzhead->comment[s->gzindex++]; + put_byte(s, val); + } while (val != 0); + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + if (val == 0) + s->status = HCRC_STATE; + } + else + s->status = HCRC_STATE; + } + if (s->status == HCRC_STATE) { + if (s->gzhead->hcrc) { + if (s->pending + 2 > s->pending_buf_size) + flush_pending(strm); + if (s->pending + 2 <= s->pending_buf_size) { + put_byte(s, (Byte)(strm->adler & 0xff)); + put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); + strm->adler = crc32(0L, Z_NULL, 0); + s->status = BUSY_STATE; + } + } + else + s->status = BUSY_STATE; + } +#endif /* Flush as much pending output as possible */ if (s->pending != 0) { @@ -704,7 +864,12 @@ int ZEXPORT deflateEnd (strm) if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; status = strm->state->status; - if (status != INIT_STATE && status != BUSY_STATE && + if (status != INIT_STATE && + status != EXTRA_STATE && + status != NAME_STATE && + status != COMMENT_STATE && + status != HCRC_STATE && + status != BUSY_STATE && status != FINISH_STATE) { return Z_STREAM_ERROR; } @@ -744,12 +909,12 @@ int ZEXPORT deflateCopy (dest, source) ss = source->state; - *dest = *source; + zmemcpy(dest, source, sizeof(z_stream)); ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state)); if (ds == Z_NULL) return Z_MEM_ERROR; dest->state = (struct internal_state FAR *) ds; - *ds = *ss; + zmemcpy(ds, ss, sizeof(deflate_state)); ds->strm = dest; ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); @@ -838,9 +1003,11 @@ local void lm_init (s) s->match_length = s->prev_length = MIN_MATCH-1; s->match_available = 0; s->ins_h = 0; +#ifndef FASTEST #ifdef ASMV match_init(); /* initialize the asm code */ #endif +#endif } #ifndef FASTEST @@ -909,7 +1076,12 @@ local uInt longest_match(s, cur_match) match = s->window + cur_match; /* Skip to next match if the match length cannot increase - * or if the match length is less than 2: + * or if the match length is less than 2. Note that the checks below + * for insufficient lookahead only occur occasionally for performance + * reasons. Therefore uninitialized memory will be accessed, and + * conditional jumps will be made that depend on those values. + * However the length of the match is limited to the lookahead, so + * the output of deflate is not affected by the uninitialized values. */ #if (defined(UNALIGNED_OK) && MAX_MATCH == 258) /* This code assumes sizeof(unsigned short) == 2. Do not use @@ -1131,6 +1303,7 @@ local void fill_window(s) later. (Using level 0 permanently is not an optimal usage of zlib, so we don't care about this pathological case.) */ + /* %%% avoid this when Z_RLE */ n = s->hash_size; p = &s->head[n]; do { @@ -1309,12 +1482,12 @@ local block_state deflate_fast(s, flush) * of the string with itself at the start of the input file). */ #ifdef FASTEST - if ((s->strategy < Z_HUFFMAN_ONLY) || + if ((s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) || (s->strategy == Z_RLE && s->strstart - hash_head == 1)) { s->match_length = longest_match_fast (s, hash_head); } #else - if (s->strategy < Z_HUFFMAN_ONLY) { + if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) { s->match_length = longest_match (s, hash_head); } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) { s->match_length = longest_match_fast (s, hash_head); @@ -1418,7 +1591,7 @@ local block_state deflate_slow(s, flush) * of window index 0 (in particular we have to avoid a match * of the string with itself at the start of the input file). */ - if (s->strategy < Z_HUFFMAN_ONLY) { + if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) { s->match_length = longest_match (s, hash_head); } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) { s->match_length = longest_match_fast (s, hash_head); @@ -1500,3 +1673,64 @@ local block_state deflate_slow(s, flush) return flush == Z_FINISH ? finish_done : block_done; } #endif /* FASTEST */ + +#if 0 +/* =========================================================================== + * For Z_RLE, simply look for runs of bytes, generate matches only of distance + * one. Do not maintain a hash table. (It will be regenerated if this run of + * deflate switches away from Z_RLE.) + */ +local block_state deflate_rle(s, flush) + deflate_state *s; + int flush; +{ + int bflush; /* set if current block must be flushed */ + uInt run; /* length of run */ + uInt max; /* maximum length of run */ + uInt prev; /* byte at distance one to match */ + Bytef *scan; /* scan for end of run */ + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the longest encodable run. + */ + if (s->lookahead < MAX_MATCH) { + fill_window(s); + if (s->lookahead < MAX_MATCH && flush == Z_NO_FLUSH) { + return need_more; + } + if (s->lookahead == 0) break; /* flush the current block */ + } + + /* See how many times the previous byte repeats */ + run = 0; + if (s->strstart > 0) { /* if there is a previous byte, that is */ + max = s->lookahead < MAX_MATCH ? s->lookahead : MAX_MATCH; + scan = s->window + s->strstart - 1; + prev = *scan++; + do { + if (*scan++ != prev) + break; + } while (++run < max); + } + + /* Emit match if have run of MIN_MATCH or longer, else emit literal */ + if (run >= MIN_MATCH) { + check_match(s, s->strstart, s->strstart - 1, run); + _tr_tally_dist(s, 1, run - MIN_MATCH, bflush); + s->lookahead -= run; + s->strstart += run; + } else { + /* No match, output a literal byte */ + Tracevv((stderr,"%c", s->window[s->strstart])); + _tr_tally_lit (s, s->window[s->strstart], bflush); + s->lookahead--; + s->strstart++; + } + if (bflush) FLUSH_BLOCK(s, 0); + } + FLUSH_BLOCK(s, flush == Z_FINISH); + return flush == Z_FINISH ? finish_done : block_done; +} +#endif diff --git a/zlib/deflate.h b/zlib/deflate.h index 410681d18a4..05a5ab3a2c1 100644 --- a/zlib/deflate.h +++ b/zlib/deflate.h @@ -1,5 +1,5 @@ /* deflate.h -- internal compression state - * Copyright (C) 1995-2002 Jean-loup Gailly + * Copyright (C) 1995-2004 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -49,6 +49,10 @@ /* All codes must not exceed MAX_BITS bits */ #define INIT_STATE 42 +#define EXTRA_STATE 69 +#define NAME_STATE 73 +#define COMMENT_STATE 91 +#define HCRC_STATE 103 #define BUSY_STATE 113 #define FINISH_STATE 666 /* Stream status */ @@ -93,8 +97,10 @@ typedef struct internal_state { Bytef *pending_buf; /* output still pending */ ulg pending_buf_size; /* size of pending_buf */ Bytef *pending_out; /* next pending byte to output to the stream */ - int pending; /* nb of bytes in the pending buffer */ + uInt pending; /* nb of bytes in the pending buffer */ int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ + gz_headerp gzhead; /* gzip header information to write */ + uInt gzindex; /* where in extra, name, or comment */ Byte method; /* STORED (for zip only) or DEFLATED */ int last_flush; /* value of flush param for previous deflate call */ diff --git a/zlib/gzio.c b/zlib/gzio.c index 5e71b0ab3ae..7e90f4928fc 100644 --- a/zlib/gzio.c +++ b/zlib/gzio.c @@ -1,5 +1,5 @@ /* gzio.c -- IO on .gz files - * Copyright (C) 1995-2003 Jean-loup Gailly. + * Copyright (C) 1995-2005 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h * * Compile this file with -DNO_GZCOMPRESS to avoid the compression code. @@ -11,7 +11,7 @@ #include "zutil.h" -#ifdef NO_DEFLATE /* for compatiblity with old definition */ +#ifdef NO_DEFLATE /* for compatibility with old definition */ # define NO_GZCOMPRESS #endif @@ -220,7 +220,7 @@ gzFile ZEXPORT gzdopen (fd, mode) int fd; const char *mode; { - char name[20]; + char name[46]; /* allow for up to 128-bit integers */ if (fd < 0) return (gzFile)Z_NULL; sprintf(name, "", fd); /* for debugging */ @@ -264,7 +264,7 @@ local int get_byte(s) if (s->z_eof) return EOF; if (s->stream.avail_in == 0) { errno = 0; - s->stream.avail_in = fread(s->inbuf, 1, Z_BUFSIZE, s->file); + s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file); if (s->stream.avail_in == 0) { s->z_eof = 1; if (ferror(s->file)) s->z_err = Z_ERRNO; @@ -300,7 +300,7 @@ local void check_header(s) if (len < 2) { if (len) s->inbuf[0] = s->stream.next_in[0]; errno = 0; - len = fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file); + len = (uInt)fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file); if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO; s->stream.avail_in += len; s->stream.next_in = s->inbuf; @@ -415,6 +415,7 @@ int ZEXPORT gzread (file, buf, len) s->stream.avail_out--; s->back = EOF; s->out++; + start++; if (s->last) { s->z_err = Z_STREAM_END; return 1; @@ -436,8 +437,8 @@ int ZEXPORT gzread (file, buf, len) s->stream.avail_in -= n; } if (s->stream.avail_out > 0) { - s->stream.avail_out -= fread(next_out, 1, s->stream.avail_out, - s->file); + s->stream.avail_out -= + (uInt)fread(next_out, 1, s->stream.avail_out, s->file); } len -= s->stream.avail_out; s->in += len; @@ -448,17 +449,13 @@ int ZEXPORT gzread (file, buf, len) if (s->stream.avail_in == 0 && !s->z_eof) { errno = 0; - s->stream.avail_in = fread(s->inbuf, 1, Z_BUFSIZE, s->file); + s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file); if (s->stream.avail_in == 0) { s->z_eof = 1; if (ferror(s->file)) { s->z_err = Z_ERRNO; break; } - if (feof(s->file)) { /* avoid error for empty file */ - s->z_err = Z_STREAM_END; - break; - } } s->stream.next_in = s->inbuf; } @@ -492,6 +489,9 @@ int ZEXPORT gzread (file, buf, len) } s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); + if (len == s->stream.avail_out && + (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO)) + return -1; return (int)(len - s->stream.avail_out); } @@ -902,6 +902,18 @@ int ZEXPORT gzeof (file) return s->z_err == Z_STREAM_END; } +/* =========================================================================== + Returns 1 if reading and doing so transparently, otherwise zero. +*/ +int ZEXPORT gzdirect (file) + gzFile file; +{ + gz_stream *s = (gz_stream*)file; + + if (s == NULL || s->mode != 'r') return 0; + return s->transparent; +} + /* =========================================================================== Outputs a long in LSB order to the given file */ @@ -941,7 +953,6 @@ local uLong getLong (s) int ZEXPORT gzclose (file) gzFile file; { - int err; gz_stream *s = (gz_stream*)file; if (s == NULL) return Z_STREAM_ERROR; @@ -950,8 +961,8 @@ int ZEXPORT gzclose (file) #ifdef NO_GZCOMPRESS return Z_STREAM_ERROR; #else - err = do_flush (file, Z_FINISH); - if (err != Z_OK) return destroy((gz_stream*)file); + if (do_flush (file, Z_FINISH) != Z_OK) + return destroy((gz_stream*)file); putLong (s->file, s->crc); putLong (s->file, (uLong)(s->in & 0xffffffff)); @@ -960,10 +971,16 @@ int ZEXPORT gzclose (file) return destroy((gz_stream*)file); } +#ifdef STDC +# define zstrerror(errnum) strerror(errnum) +#else +# define zstrerror(errnum) "" +#endif + /* =========================================================================== - Returns the error message for the last error which occured on the + Returns the error message for the last error which occurred on the given compressed file. errnum is set to zlib error number. If an - error occured in the file system and not in the compression library, + error occurred in the file system and not in the compression library, errnum is set to Z_ERRNO and the application may consult errno to get the exact error code. */ diff --git a/zlib/infback.c b/zlib/infback.c index 262f97c73ac..455dbc9ee84 100644 --- a/zlib/infback.c +++ b/zlib/infback.c @@ -1,5 +1,5 @@ /* infback.c -- inflate using a call-back interface - * Copyright (C) 1995-2003 Mark Adler + * Copyright (C) 1995-2005 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -26,7 +26,7 @@ local void fixedtables OF((struct inflate_state FAR *state)); window and output buffer that is 2**windowBits bytes. */ int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size) -z_stream FAR *strm; +z_streamp strm; int windowBits; unsigned char FAR *window; const char *version; @@ -50,7 +50,8 @@ int stream_size; sizeof(struct inflate_state)); if (state == Z_NULL) return Z_MEM_ERROR; Tracev((stderr, "inflate: allocated\n")); - strm->state = (voidpf)state; + strm->state = (struct internal_state FAR *)state; + state->dmax = 32768U; state->wbits = windowBits; state->wsize = 1U << windowBits; state->window = window; @@ -238,7 +239,7 @@ struct inflate_state FAR *state; are not correct, i.e. strm is Z_NULL or the state was not initialized. */ int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc) -z_stream FAR *strm; +z_streamp strm; in_func in; void FAR *in_desc; out_func out; @@ -611,7 +612,7 @@ void FAR *out_desc; } int ZEXPORT inflateBackEnd(strm) -z_stream FAR *strm; +z_streamp strm; { if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) return Z_STREAM_ERROR; diff --git a/zlib/inffast.c b/zlib/inffast.c index 8c02a178d04..bbee92ed1e6 100644 --- a/zlib/inffast.c +++ b/zlib/inffast.c @@ -74,6 +74,9 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ unsigned char FAR *out; /* local strm->next_out */ unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ unsigned char FAR *end; /* while out < end, enough space available */ +#ifdef INFLATE_STRICT + unsigned dmax; /* maximum distance from zlib header */ +#endif unsigned wsize; /* window size or zero if not using window */ unsigned whave; /* valid bytes in the window */ unsigned write; /* window write index */ @@ -98,6 +101,9 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ out = strm->next_out - OFF; beg = out - (start - strm->avail_out); end = out + (strm->avail_out - 257); +#ifdef INFLATE_STRICT + dmax = state->dmax; +#endif wsize = state->wsize; whave = state->whave; write = state->write; @@ -167,6 +173,13 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ } } dist += (unsigned)hold & ((1U << op) - 1); +#ifdef INFLATE_STRICT + if (dist > dmax) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } +#endif hold >>= op; bits -= op; Tracevv((stderr, "inflate: distance %u\n", dist)); diff --git a/zlib/inflate.c b/zlib/inflate.c index c6d38266d07..792fdee8e9c 100644 --- a/zlib/inflate.c +++ b/zlib/inflate.c @@ -1,5 +1,5 @@ /* inflate.c -- zlib decompression - * Copyright (C) 1995-2003 Mark Adler + * Copyright (C) 1995-2005 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -113,8 +113,11 @@ z_streamp strm; state->mode = HEAD; state->last = 0; state->havedict = 0; + state->dmax = 32768U; + state->head = Z_NULL; state->wsize = 0; state->whave = 0; + state->write = 0; state->hold = 0; state->bits = 0; state->lencode = state->distcode = state->next = state->codes; @@ -122,6 +125,22 @@ z_streamp strm; return Z_OK; } +int ZEXPORT inflatePrime(strm, bits, value) +z_streamp strm; +int bits; +int value; +{ + struct inflate_state FAR *state; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR; + value &= (1L << bits) - 1; + state->hold += value << state->bits; + state->bits += bits; + return Z_OK; +} + int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) z_streamp strm; int windowBits; @@ -144,7 +163,7 @@ int stream_size; ZALLOC(strm, 1, sizeof(struct inflate_state)); if (state == Z_NULL) return Z_MEM_ERROR; Tracev((stderr, "inflate: allocated\n")); - strm->state = (voidpf)state; + strm->state = (struct internal_state FAR *)state; if (windowBits < 0) { state->wrap = 0; windowBits = -windowBits; @@ -582,6 +601,8 @@ int flush; break; } state->flags = 0; /* expect zlib header */ + if (state->head != Z_NULL) + state->head->done = -1; if (!(state->wrap & 1) || /* check if zlib header allowed */ #else if ( @@ -597,11 +618,13 @@ int flush; break; } DROPBITS(4); - if (BITS(4) + 8 > state->wbits) { + len = BITS(4) + 8; + if (len > state->wbits) { strm->msg = (char *)"invalid window size"; state->mode = BAD; break; } + state->dmax = 1U << len; Tracev((stderr, "inflate: zlib header ok\n")); strm->adler = state->check = adler32(0L, Z_NULL, 0); state->mode = hold & 0x200 ? DICTID : TYPE; @@ -621,16 +644,24 @@ int flush; state->mode = BAD; break; } + if (state->head != Z_NULL) + state->head->text = (int)((hold >> 8) & 1); if (state->flags & 0x0200) CRC2(state->check, hold); INITBITS(); state->mode = TIME; case TIME: NEEDBITS(32); + if (state->head != Z_NULL) + state->head->time = hold; if (state->flags & 0x0200) CRC4(state->check, hold); INITBITS(); state->mode = OS; case OS: NEEDBITS(16); + if (state->head != Z_NULL) { + state->head->xflags = (int)(hold & 0xff); + state->head->os = (int)(hold >> 8); + } if (state->flags & 0x0200) CRC2(state->check, hold); INITBITS(); state->mode = EXLEN; @@ -638,15 +669,26 @@ int flush; if (state->flags & 0x0400) { NEEDBITS(16); state->length = (unsigned)(hold); + if (state->head != Z_NULL) + state->head->extra_len = (unsigned)hold; if (state->flags & 0x0200) CRC2(state->check, hold); INITBITS(); } + else if (state->head != Z_NULL) + state->head->extra = Z_NULL; state->mode = EXTRA; case EXTRA: if (state->flags & 0x0400) { copy = state->length; if (copy > have) copy = have; if (copy) { + if (state->head != Z_NULL && + state->head->extra != Z_NULL) { + len = state->head->extra_len - state->length; + zmemcpy(state->head->extra + len, next, + len + copy > state->head->extra_max ? + state->head->extra_max - len : copy); + } if (state->flags & 0x0200) state->check = crc32(state->check, next, copy); have -= copy; @@ -655,6 +697,7 @@ int flush; } if (state->length) goto inf_leave; } + state->length = 0; state->mode = NAME; case NAME: if (state->flags & 0x0800) { @@ -662,13 +705,20 @@ int flush; copy = 0; do { len = (unsigned)(next[copy++]); + if (state->head != Z_NULL && + state->head->name != Z_NULL && + state->length < state->head->name_max) + state->head->name[state->length++] = len; } while (len && copy < have); - if (state->flags & 0x02000) + if (state->flags & 0x0200) state->check = crc32(state->check, next, copy); have -= copy; next += copy; if (len) goto inf_leave; } + else if (state->head != Z_NULL) + state->head->name = Z_NULL; + state->length = 0; state->mode = COMMENT; case COMMENT: if (state->flags & 0x1000) { @@ -676,13 +726,19 @@ int flush; copy = 0; do { len = (unsigned)(next[copy++]); + if (state->head != Z_NULL && + state->head->comment != Z_NULL && + state->length < state->head->comm_max) + state->head->comment[state->length++] = len; } while (len && copy < have); - if (state->flags & 0x02000) + if (state->flags & 0x0200) state->check = crc32(state->check, next, copy); have -= copy; next += copy; if (len) goto inf_leave; } + else if (state->head != Z_NULL) + state->head->comment = Z_NULL; state->mode = HCRC; case HCRC: if (state->flags & 0x0200) { @@ -694,6 +750,10 @@ int flush; } INITBITS(); } + if (state->head != Z_NULL) { + state->head->hcrc = (int)((state->flags >> 9) & 1); + state->head->done = 1; + } strm->adler = state->check = crc32(0L, Z_NULL, 0); state->mode = TYPE; break; @@ -969,6 +1029,13 @@ int flush; state->offset += BITS(state->extra); DROPBITS(state->extra); } +#ifdef INFLATE_STRICT + if (state->offset > state->dmax) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } +#endif if (state->offset > state->whave + out - left) { strm->msg = (char *)"invalid distance too far back"; state->mode = BAD; @@ -1110,12 +1177,16 @@ uInt dictLength; /* check state */ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; - if (state->mode != DICT) return Z_STREAM_ERROR; + if (state->wrap != 0 && state->mode != DICT) + return Z_STREAM_ERROR; /* check for correct dictionary id */ - id = adler32(0L, Z_NULL, 0); - id = adler32(id, dictionary, dictLength); - if (id != state->check) return Z_DATA_ERROR; + if (state->mode == DICT) { + id = adler32(0L, Z_NULL, 0); + id = adler32(id, dictionary, dictLength); + if (id != state->check) + return Z_DATA_ERROR; + } /* copy dictionary to window */ if (updatewindow(strm, strm->avail_out)) { @@ -1137,6 +1208,23 @@ uInt dictLength; return Z_OK; } +int ZEXPORT inflateGetHeader(strm, head) +z_streamp strm; +gz_headerp head; +{ + struct inflate_state FAR *state; + + /* check state */ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if ((state->wrap & 2) == 0) return Z_STREAM_ERROR; + + /* save header structure */ + state->head = head; + head->done = 0; + return Z_OK; +} + /* Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff. Return when found or when out of input. When called, *have is the number of pattern bytes @@ -1239,6 +1327,7 @@ z_streamp source; struct inflate_state FAR *state; struct inflate_state FAR *copy; unsigned char FAR *window; + unsigned wsize; /* check input */ if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL || @@ -1261,14 +1350,19 @@ z_streamp source; } /* copy state */ - *dest = *source; - *copy = *state; - copy->lencode = copy->codes + (state->lencode - state->codes); - copy->distcode = copy->codes + (state->distcode - state->codes); + zmemcpy(dest, source, sizeof(z_stream)); + zmemcpy(copy, state, sizeof(struct inflate_state)); + if (state->lencode >= state->codes && + state->lencode <= state->codes + ENOUGH - 1) { + copy->lencode = copy->codes + (state->lencode - state->codes); + copy->distcode = copy->codes + (state->distcode - state->codes); + } copy->next = copy->codes + (state->next - state->codes); - if (window != Z_NULL) - zmemcpy(window, state->window, 1U << state->wbits); + if (window != Z_NULL) { + wsize = 1U << state->wbits; + zmemcpy(window, state->window, wsize); + } copy->window = window; - dest->state = (voidpf)copy; + dest->state = (struct internal_state FAR *)copy; return Z_OK; } diff --git a/zlib/inflate.h b/zlib/inflate.h index 9a12c8fd296..07bd3e78a7c 100644 --- a/zlib/inflate.h +++ b/zlib/inflate.h @@ -1,5 +1,5 @@ /* inflate.h -- internal inflate state definition - * Copyright (C) 1995-2003 Mark Adler + * Copyright (C) 1995-2004 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -19,7 +19,6 @@ /* Possible inflate modes between inflate() calls */ typedef enum { HEAD, /* i: waiting for magic header */ -#ifdef GUNZIP FLAGS, /* i: waiting for method and flags (gzip) */ TIME, /* i: waiting for modification time (gzip) */ OS, /* i: waiting for extra flags and operating system (gzip) */ @@ -28,7 +27,6 @@ typedef enum { NAME, /* i: waiting for end of file name (gzip) */ COMMENT, /* i: waiting for end of comment (gzip) */ HCRC, /* i: waiting for header crc (gzip) */ -#endif DICTID, /* i: waiting for dictionary check value */ DICT, /* waiting for inflateSetDictionary() call */ TYPE, /* i: waiting for type bits, including last-flag bit */ @@ -45,9 +43,7 @@ typedef enum { MATCH, /* o: waiting for output space to copy string */ LIT, /* o: waiting for output space to write literal */ CHECK, /* i: waiting for 32-bit check value */ -#ifdef GUNZIP LENGTH, /* i: waiting for 32-bit length (gzip) */ -#endif DONE, /* finished check, done -- remain here until reset */ BAD, /* got a data error -- remain here until reset */ MEM, /* got an inflate() memory error -- remain here until reset */ @@ -84,8 +80,10 @@ struct inflate_state { int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ int havedict; /* true if dictionary provided */ int flags; /* gzip header method and flags (0 if zlib) */ + unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ unsigned long check; /* protected copy of check value */ unsigned long total; /* protected copy of output count */ + gz_headerp head; /* where to save gzip header information */ /* sliding window */ unsigned wbits; /* log base 2 of requested window size */ unsigned wsize; /* window size or zero if not using window */ diff --git a/zlib/inftrees.c b/zlib/inftrees.c index 509461d9273..8a9c13ff03d 100644 --- a/zlib/inftrees.c +++ b/zlib/inftrees.c @@ -1,5 +1,5 @@ /* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2004 Mark Adler + * Copyright (C) 1995-2005 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.2.2 Copyright 1995-2004 Mark Adler "; + " inflate 1.2.3 Copyright 1995-2005 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -62,7 +62,7 @@ unsigned short FAR *work; 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 199, 198}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, @@ -232,6 +232,7 @@ unsigned short FAR *work; /* replicate for those indices with low len bits equal to huff */ incr = 1U << (len - drop); fill = 1U << curr; + min = fill; /* save offset to next table */ do { fill -= incr; next[(huff >> drop) + fill] = this; @@ -262,7 +263,7 @@ unsigned short FAR *work; drop = root; /* increment past last table */ - next += 1U << curr; + next += min; /* here min is 1 << curr */ /* determine length of next table */ curr = len - drop; diff --git a/zlib/inftrees.h b/zlib/inftrees.h index 82d365a7e90..b1104c87e76 100644 --- a/zlib/inftrees.h +++ b/zlib/inftrees.h @@ -1,5 +1,5 @@ /* inftrees.h -- header to use inftrees.c - * Copyright (C) 1995-2003 Mark Adler + * Copyright (C) 1995-2005 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -36,12 +36,12 @@ typedef struct { */ /* Maximum size of dynamic tree. The maximum found in a long but non- - exhaustive search was 1004 code structures (850 for length/literals - and 154 for distances, the latter actually the result of an + exhaustive search was 1444 code structures (852 for length/literals + and 592 for distances, the latter actually the result of an exhaustive search). The true maximum is not known, but the value below is more than safe. */ -#define ENOUGH 1440 -#define MAXD 154 +#define ENOUGH 2048 +#define MAXD 592 /* Type of code to build for inftable() */ typedef enum { diff --git a/zlib/trees.c b/zlib/trees.c index 52c820fa2e9..395e4e16814 100644 --- a/zlib/trees.c +++ b/zlib/trees.c @@ -1,5 +1,5 @@ /* trees.c -- output deflated data using Huffman coding - * Copyright (C) 1995-2003 Jean-loup Gailly + * Copyright (C) 1995-2005 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -555,7 +555,7 @@ local void gen_bitlen(s, desc) while (n != 0) { m = s->heap[--h]; if (m > max_code) continue; - if (tree[m].Len != (unsigned) bits) { + if ((unsigned) tree[m].Len != (unsigned) bits) { Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); s->opt_len += ((long)bits - (long)tree[m].Len) *(long)tree[m].Freq; @@ -930,8 +930,9 @@ void _tr_flush_block(s, buf, stored_len, eof) /* Build the Huffman trees unless a stored block is forced */ if (s->level > 0) { - /* Check if the file is ascii or binary */ - if (s->strm->data_type == Z_UNKNOWN) set_data_type(s); + /* Check if the file is binary or text */ + if (stored_len > 0 && s->strm->data_type == Z_UNKNOWN) + set_data_type(s); /* Construct the literal and distance trees */ build_tree(s, (tree_desc *)(&(s->l_desc))); @@ -982,7 +983,7 @@ void _tr_flush_block(s, buf, stored_len, eof) #ifdef FORCE_STATIC } else if (static_lenb >= 0) { /* force static trees */ #else - } else if (static_lenb == opt_lenb) { + } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) { #endif send_bits(s, (STATIC_TREES<<1)+eof, 3); compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree); @@ -1117,21 +1118,24 @@ local void compress_block(s, ltree, dtree) } /* =========================================================================== - * Set the data type to ASCII or BINARY, using a crude approximation: - * binary if more than 20% of the bytes are <= 6 or >= 128, ascii otherwise. - * IN assertion: the fields freq of dyn_ltree are set and the total of all - * frequencies does not exceed 64K (to fit in an int on 16 bit machines). + * Set the data type to BINARY or TEXT, using a crude approximation: + * set it to Z_TEXT if all symbols are either printable characters (33 to 255) + * or white spaces (9 to 13, or 32); or set it to Z_BINARY otherwise. + * IN assertion: the fields Freq of dyn_ltree are set. */ local void set_data_type(s) deflate_state *s; { - int n = 0; - unsigned ascii_freq = 0; - unsigned bin_freq = 0; - while (n < 7) bin_freq += s->dyn_ltree[n++].Freq; - while (n < 128) ascii_freq += s->dyn_ltree[n++].Freq; - while (n < LITERALS) bin_freq += s->dyn_ltree[n++].Freq; - s->strm->data_type = bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII; + int n; + + for (n = 0; n < 9; n++) + if (s->dyn_ltree[n].Freq != 0) + break; + if (n == 9) + for (n = 14; n < 32; n++) + if (s->dyn_ltree[n].Freq != 0) + break; + s->strm->data_type = (n == 32) ? Z_TEXT : Z_BINARY; } /* =========================================================================== diff --git a/zlib/zconf.h b/zlib/zconf.h index 3c21403fce6..03a9431c8be 100644 --- a/zlib/zconf.h +++ b/zlib/zconf.h @@ -1,5 +1,5 @@ /* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2004 Jean-loup Gailly. + * Copyright (C) 1995-2005 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -43,6 +43,10 @@ # define get_crc_table z_get_crc_table # define zError z_zError +# define alloc_func z_alloc_func +# define free_func z_free_func +# define in_func z_in_func +# define out_func z_out_func # define Byte z_Byte # define uInt z_uInt # define uLong z_uLong @@ -64,8 +68,10 @@ #if defined(_WINDOWS) && !defined(WINDOWS) # define WINDOWS #endif -#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) -# define WIN32 +#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) +# ifndef WIN32 +# define WIN32 +# endif #endif #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) diff --git a/zlib/zlib.3 b/zlib/zlib.3 index 3139e2467f2..90b8162870f 100644 --- a/zlib/zlib.3 +++ b/zlib/zlib.3 @@ -1,4 +1,4 @@ -.TH ZLIB 3 "3 October 2004" +.TH ZLIB 3 "18 July 2005" .SH NAME zlib \- compression/decompression library .SH SYNOPSIS @@ -133,8 +133,8 @@ before asking for help. Send questions and/or comments to zlib@gzip.org, or (for the Windows DLL version) to Gilles Vollant (info@winimage.com). .SH AUTHORS -Version 1.2.2 -Copyright (C) 1995-2004 Jean-loup Gailly (jloup@gzip.org) +Version 1.2.3 +Copyright (C) 1995-2005 Jean-loup Gailly (jloup@gzip.org) and Mark Adler (madler@alumni.caltech.edu). .LP This software is provided "as-is," diff --git a/zlib/zlib.h b/zlib/zlib.h index b4ddd34395c..022817927ce 100644 --- a/zlib/zlib.h +++ b/zlib/zlib.h @@ -1,7 +1,7 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.2, October 3rd, 2004 + version 1.2.3, July 18th, 2005 - Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,8 +37,8 @@ extern "C" { #endif -#define ZLIB_VERSION "1.2.2" -#define ZLIB_VERNUM 0x1220 +#define ZLIB_VERSION "1.2.3" +#define ZLIB_VERNUM 0x1230 /* The 'zlib' compression library provides in-memory compression and @@ -95,13 +95,36 @@ typedef struct z_stream_s { free_func zfree; /* used to free the internal state */ voidpf opaque; /* private data object passed to zalloc and zfree */ - int data_type; /* best guess about the data type: ascii or binary */ + int data_type; /* best guess about the data type: binary or text */ uLong adler; /* adler32 value of the uncompressed data */ uLong reserved; /* reserved for future use */ } z_stream; typedef z_stream FAR *z_streamp; +/* + gzip header information passed to and from zlib routines. See RFC 1952 + for more details on the meanings of these fields. +*/ +typedef struct gz_header_s { + int text; /* true if compressed data believed to be text */ + uLong time; /* modification time */ + int xflags; /* extra flags (not used when writing a gzip file) */ + int os; /* operating system */ + Bytef *extra; /* pointer to extra field or Z_NULL if none */ + uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ + uInt extra_max; /* space at extra (only when reading header) */ + Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ + uInt name_max; /* space at name (only when reading header) */ + Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ + uInt comm_max; /* space at comment (only when reading header) */ + int hcrc; /* true if there was or will be a header crc */ + int done; /* true when done reading gzip header (not used + when writing a gzip file) */ +} gz_header; + +typedef gz_header FAR *gz_headerp; + /* The application must update next_in and avail_in when avail_in has dropped to zero. It must update next_out and avail_out when avail_out @@ -166,11 +189,13 @@ typedef z_stream FAR *z_streamp; #define Z_FILTERED 1 #define Z_HUFFMAN_ONLY 2 #define Z_RLE 3 +#define Z_FIXED 4 #define Z_DEFAULT_STRATEGY 0 /* compression strategy; see deflateInit2() below for details */ #define Z_BINARY 0 -#define Z_ASCII 1 +#define Z_TEXT 1 +#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ #define Z_UNKNOWN 2 /* Possible values of the data_type field (though see inflate()) */ @@ -244,6 +269,10 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. + Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to + decide how much data to accumualte before producing output, in order to + maximize compression. + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is flushed to the output buffer and the output is aligned on a byte boundary, so that the decompressor can get all input data available so far. (In particular @@ -255,7 +284,7 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); Z_SYNC_FLUSH, and the compression state is reset so that decompression can restart from this point if previous compressed data has been damaged or if random access is desired. Using Z_FULL_FLUSH too often can seriously degrade - the compression. + compression. If deflate returns with avail_out == 0, this function must be called again with the same value of the flush parameter and more output space (updated @@ -280,8 +309,8 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); deflate() sets strm->adler to the adler32 checksum of all input read so far (that is, total_in bytes). - deflate() may update data_type if it can make a good guess about - the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered + deflate() may update strm->data_type if it can make a good guess about + the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered binary. This field is only for information purposes and does not affect the compression algorithm in any manner. @@ -363,11 +392,11 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much output as possible to the output buffer. Z_BLOCK requests that inflate() stop - if and when it get to the next deflate block boundary. When decoding the zlib - or gzip format, this will cause inflate() to return immediately after the - header and before the first block. When doing a raw inflate, inflate() will - go ahead and process the first block, and will return when it gets to the end - of that block, or when it runs out of data. + if and when it gets to the next deflate block boundary. When decoding the + zlib or gzip format, this will cause inflate() to return immediately after + the header and before the first block. When doing a raw inflate, inflate() + will go ahead and process the first block, and will return when it gets to + the end of that block, or when it runs out of data. The Z_BLOCK option assists in appending to or combining deflate streams. Also to assist in this, on return inflate() will set strm->data_type to the @@ -496,7 +525,9 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy parameter only affects the compression ratio but not the correctness of the - compressed output even if it is not set appropriately. + compressed output even if it is not set appropriately. Z_FIXED prevents the + use of dynamic Huffman codes, allowing for a simpler decoder for special + applications. deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid @@ -525,7 +556,9 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, deflateInit or deflateInit2, a part of the dictionary may in effect be discarded, for example if the dictionary is larger than the window size in deflate or deflate2. Thus the strings most likely to be useful should be - put at the end of the dictionary, not at the front. + put at the end of the dictionary, not at the front. In addition, the + current implementation of deflate will use at most the window size minus + 262 bytes of the provided dictionary. Upon return of this function, strm->adler is set to the adler32 value of the dictionary; the decompressor may later use this value to determine @@ -591,6 +624,23 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, if strm->avail_out was zero. */ +ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, + int good_length, + int max_lazy, + int nice_length, + int max_chain)); +/* + Fine tune deflate's internal compression parameters. This should only be + used by someone who understands the algorithm used by zlib's deflate for + searching for the best matching string, and even then only by the most + fanatic optimizer trying to squeeze out the last compressed bit for their + specific input data. Read the deflate.c source code for the meaning of the + max_lazy, good_length, nice_length, and max_chain parameters. + + deflateTune() can be called after deflateInit() or deflateInit2(), and + returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. + */ + ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, uLong sourceLen)); /* @@ -616,6 +666,30 @@ ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, stream state was inconsistent. */ +ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, + gz_headerp head)); +/* + deflateSetHeader() provides gzip header information for when a gzip + stream is requested by deflateInit2(). deflateSetHeader() may be called + after deflateInit2() or deflateReset() and before the first call of + deflate(). The text, time, os, extra field, name, and comment information + in the provided gz_header structure are written to the gzip header (xflag is + ignored -- the extra flags are set according to the compression level). The + caller must assure that, if not Z_NULL, name and comment are terminated with + a zero byte, and that if extra is not Z_NULL, that extra_len bytes are + available there. If hcrc is true, a gzip header crc is included. Note that + the current versions of the command-line version of gzip (up through version + 1.3.x) do not support header crc's, and will report that it is a "multi-part + gzip file" and give up. + + If deflateSetHeader is not used, the default gzip header has text false, + the time set to zero, and os set to 255, with no extra, name, or comment + fields. The gzip header is returned to the default state by deflateReset(). + + deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + /* ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, int windowBits)); @@ -648,15 +722,15 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, windowBits can also be greater than 15 for optional gzip decoding. Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format (the zlib format will - return a Z_DATA_ERROR. If a gzip stream is being decoded, strm->adler is + return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a crc32 instead of an adler32. inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative - memLevel). msg is set to null if there is no error message. inflateInit2 - does not perform any decompression apart from reading the zlib header if - present: this will be done by inflate(). (So next_in and avail_in may be - modified, but next_out and avail_out are unchanged.) + memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg + is set to null if there is no error message. inflateInit2 does not perform + any decompression apart from reading the zlib header if present: this will + be done by inflate(). (So next_in and avail_in may be modified, but next_out + and avail_out are unchanged.) */ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, @@ -664,11 +738,14 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, uInt dictLength)); /* Initializes the decompression dictionary from the given uncompressed byte - sequence. This function must be called immediately after a call of inflate - if this call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the adler32 value returned by this call of - inflate. The compressor and decompressor must use exactly the same - dictionary (see deflateSetDictionary). + sequence. This function must be called immediately after a call of inflate, + if that call returned Z_NEED_DICT. The dictionary chosen by the compressor + can be determined from the adler32 value returned by that call of inflate. + The compressor and decompressor must use exactly the same dictionary (see + deflateSetDictionary). For raw inflate, this function can be called + immediately after inflateInit2() or inflateReset() and before any call of + inflate() to set the dictionary. The application must insure that the + dictionary that was used for compression is provided. inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a parameter is invalid (such as NULL dictionary) or the stream state is @@ -719,8 +796,64 @@ ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); stream state was inconsistent (such as zalloc or state being NULL). */ +ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, + int bits, + int value)); /* -ZEXTERN int ZEXPORT inflateBackInit OF((z_stream FAR *strm, int windowBits, + This function inserts bits in the inflate input stream. The intent is + that this function is used to start inflating at a bit position in the + middle of a byte. The provided bits will be used before any bytes are used + from next_in. This function should only be used with raw inflate, and + should be used before the first inflate() call after inflateInit2() or + inflateReset(). bits must be less than or equal to 16, and that many of the + least significant bits of value will be inserted in the input. + + inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, + gz_headerp head)); +/* + inflateGetHeader() requests that gzip header information be stored in the + provided gz_header structure. inflateGetHeader() may be called after + inflateInit2() or inflateReset(), and before the first call of inflate(). + As inflate() processes the gzip stream, head->done is zero until the header + is completed, at which time head->done is set to one. If a zlib stream is + being decoded, then head->done is set to -1 to indicate that there will be + no gzip header information forthcoming. Note that Z_BLOCK can be used to + force inflate() to return immediately after header processing is complete + and before any actual data is decompressed. + + The text, time, xflags, and os fields are filled in with the gzip header + contents. hcrc is set to true if there is a header CRC. (The header CRC + was valid if done is set to one.) If extra is not Z_NULL, then extra_max + contains the maximum number of bytes to write to extra. Once done is true, + extra_len contains the actual extra field length, and extra contains the + extra field, or that field truncated if extra_max is less than extra_len. + If name is not Z_NULL, then up to name_max characters are written there, + terminated with a zero unless the length is greater than name_max. If + comment is not Z_NULL, then up to comm_max characters are written there, + terminated with a zero unless the length is greater than comm_max. When + any of extra, name, or comment are not Z_NULL and the respective field is + not present in the header, then that field is set to Z_NULL to signal its + absence. This allows the use of deflateSetHeader() with the returned + structure to duplicate the header. However if those fields are set to + allocated memory, then the application will need to save those pointers + elsewhere so that they can be eventually freed. + + If inflateGetHeader is not used, then the header information is simply + discarded. The header is always checked for validity, including the header + CRC if present. inflateReset() will reset the process to discard the header + information. The application would need to call inflateGetHeader() again to + retrieve the header from the next gzip stream. + + inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +/* +ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, unsigned char FAR *window)); Initialize the internal stream state for decompression using inflateBack() @@ -744,7 +877,7 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_stream FAR *strm, int windowBits, typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); -ZEXTERN int ZEXPORT inflateBack OF((z_stream FAR *strm, +ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, in_func in, void FAR *in_desc, out_func out, void FAR *out_desc)); /* @@ -813,7 +946,7 @@ ZEXTERN int ZEXPORT inflateBack OF((z_stream FAR *strm, that inflateBack() cannot return Z_OK. */ -ZEXTERN int ZEXPORT inflateBackEnd OF((z_stream FAR *strm)); +ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); /* All memory allocated by inflateBackInit() is freed. @@ -1087,6 +1220,12 @@ ZEXTERN int ZEXPORT gzeof OF((gzFile file)); input stream, otherwise zero. */ +ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); +/* + Returns 1 if file is being read directly without decompression, otherwise + zero. +*/ + ZEXTERN int ZEXPORT gzclose OF((gzFile file)); /* Flushes all pending output if necessary, closes the compressed file @@ -1119,7 +1258,6 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); */ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); - /* Update a running Adler-32 checksum with the bytes buf[0..len-1] and return the updated checksum. If buf is NULL, this function returns @@ -1135,12 +1273,21 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); if (adler != original_adler) error(); */ +ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, + z_off_t len2)); +/* + Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 + and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for + each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of + seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. +*/ + ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); /* - Update a running crc with the bytes buf[0..len-1] and return the updated - crc. If buf is NULL, this function returns the required initial value - for the crc. Pre- and post-conditioning (one's complement) is performed - within this function so it shouldn't be done by the application. + Update a running CRC-32 with the bytes buf[0..len-1] and return the + updated CRC-32. If buf is NULL, this function returns the required initial + value for the for the crc. Pre- and post-conditioning (one's complement) is + performed within this function so it shouldn't be done by the application. Usage example: uLong crc = crc32(0L, Z_NULL, 0); @@ -1151,6 +1298,16 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); if (crc != original_crc) error(); */ +ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); + +/* + Combine two CRC-32 check values into one. For two sequences of bytes, + seq1 and seq2 with lengths len1 and len2, CRC-32 check values were + calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 + check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and + len2. +*/ + /* various hacks, don't look :) */ @@ -1167,7 +1324,7 @@ ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, int stream_size)); ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateBackInit_ OF((z_stream FAR *strm, int windowBits, +ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, unsigned char FAR *window, const char *version, int stream_size)); diff --git a/zlib/zutil.c b/zlib/zutil.c index 0ef4f99f57e..d55f5948a37 100644 --- a/zlib/zutil.c +++ b/zlib/zutil.c @@ -1,5 +1,5 @@ /* zutil.c -- target dependent utility functions for the compression library - * Copyright (C) 1995-2003 Jean-loup Gailly. + * Copyright (C) 1995-2005 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -11,10 +11,6 @@ struct internal_state {int dummy;}; /* for buggy compilers */ #endif -#ifndef STDC -extern void exit OF((int)); -#endif - const char * const z_errmsg[10] = { "need dictionary", /* Z_NEED_DICT 2 */ "stream end", /* Z_STREAM_END 1 */ @@ -78,38 +74,38 @@ uLong ZEXPORT zlibCompileFlags() flags += 1 << 13; #endif #ifdef NO_GZCOMPRESS - flags += 1 << 16; + flags += 1L << 16; #endif #ifdef NO_GZIP - flags += 1 << 17; + flags += 1L << 17; #endif #ifdef PKZIP_BUG_WORKAROUND - flags += 1 << 20; + flags += 1L << 20; #endif #ifdef FASTEST - flags += 1 << 21; + flags += 1L << 21; #endif #ifdef STDC # ifdef NO_vsnprintf - flags += 1 << 25; + flags += 1L << 25; # ifdef HAS_vsprintf_void - flags += 1 << 26; + flags += 1L << 26; # endif # else # ifdef HAS_vsnprintf_void - flags += 1 << 26; + flags += 1L << 26; # endif # endif #else - flags += 1 << 24; + flags += 1L << 24; # ifdef NO_snprintf - flags += 1 << 25; + flags += 1L << 25; # ifdef HAS_sprintf_void - flags += 1 << 26; + flags += 1L << 26; # endif # else # ifdef HAS_snprintf_void - flags += 1 << 26; + flags += 1L << 26; # endif # endif #endif @@ -141,7 +137,10 @@ const char * ZEXPORT zError(err) } #if defined(_WIN32_WCE) - /* does not exist on WCE */ + /* The Microsoft C Run-Time Library for Windows CE doesn't have + * errno. We define it as a global variable to simplify porting. + * Its value is always 0 and should not be used. + */ int errno = 0; #endif diff --git a/zlib/zutil.h b/zlib/zutil.h index 7b42edcaa98..b7d5eff81b6 100644 --- a/zlib/zutil.h +++ b/zlib/zutil.h @@ -1,5 +1,5 @@ /* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-2003 Jean-loup Gailly. + * Copyright (C) 1995-2005 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -17,14 +17,26 @@ #include "zlib.h" #ifdef STDC -# include +# ifndef _WIN32_WCE +# include +# endif # include # include #endif #ifdef NO_ERRNO_H +# ifdef _WIN32_WCE + /* The Microsoft C Run-Time Library for Windows CE doesn't have + * errno. We define it as a global variable to simplify porting. + * Its value is always 0 and should not be used. We rename it to + * avoid conflict with other libraries that use the same workaround. + */ +# define errno z_errno +# endif extern int errno; #else -# include +# ifndef _WIN32_WCE +# include +# endif #endif #ifndef local @@ -105,6 +117,9 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ #ifdef OS2 # define OS_CODE 0x06 +# ifdef M_I86 + #include +# endif #endif #if defined(MACOS) || defined(TARGET_OS_MAC) @@ -193,15 +208,6 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # define NO_vsnprintf #endif -#ifdef HAVE_STRERROR -# ifndef VMS - extern char *strerror OF((int)); -# endif -# define zstrerror(errnum) strerror(errnum) -#else -# define zstrerror(errnum) "" -#endif - #if defined(pyr) # define NO_MEMCPY #endif From ca084e0f729ac7a1d53671df2f17f3df1fb252b1 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 25 Aug 2005 19:21:47 +0500 Subject: [PATCH 002/225] Fix for bug #12694 (float(1,2) field error) mysql-test/t/type_float.test: test case sql/sql_parse.cc: length & dec checks added --- mysql-test/t/type_float.test | 9 +++++++++ sql/sql_parse.cc | 16 ++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index c0f1854d5b2..cf2a2676ab0 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -147,3 +147,12 @@ select * from t1 where reckey=1.09E2; drop table t1; # End of 4.1 tests + +# +# bug #12694 (float(m,d) specifications) +# + +--error 1427 +create table t1 (s1 float(0,2)); +--error 1427 +create table t1 (s1 float(1,2)); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 70920b07a97..65169f2af10 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5752,19 +5752,31 @@ new_create_field(THD *thd, char *field_name, enum_field_types type, new_field->decimals= NOT_FIXED_DEC; break; } - if (!length) + if (!length && !decimals) { new_field->length = FLT_DIG+6; new_field->decimals= NOT_FIXED_DEC; } + if (new_field->length < new_field->decimals && + new_field->decimals != NOT_FIXED_DEC) + { + my_error(ER_SCALE_BIGGER_THAN_PRECISION, MYF(0), field_name); + DBUG_RETURN(NULL); + } break; case FIELD_TYPE_DOUBLE: allowed_type_modifier= AUTO_INCREMENT_FLAG; - if (!length) + if (!length && !decimals) { new_field->length = DBL_DIG+7; new_field->decimals=NOT_FIXED_DEC; } + if (new_field->length < new_field->decimals && + new_field->decimals != NOT_FIXED_DEC) + { + my_error(ER_SCALE_BIGGER_THAN_PRECISION, MYF(0), field_name); + DBUG_RETURN(NULL); + } break; case FIELD_TYPE_TIMESTAMP: if (!length) From eaba3ed347999af4c31c4419b6bf89e40c041caa Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 4 Sep 2005 17:45:02 +0500 Subject: [PATCH 003/225] Error message changed for buf #12694 as PeterG suggested mysql-test/r/type_float.result: result fixed mysql-test/t/type_float.test: errno fixed sql/share/errmsg.txt: error message added sql/sql_parse.cc: error message changed --- mysql-test/r/type_float.result | 4 ++++ mysql-test/t/type_float.test | 4 ++-- sql/share/errmsg.txt | 2 ++ sql/sql_parse.cc | 4 ++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index d243985332e..fc7e4c5f346 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -225,3 +225,7 @@ select * from t1 where reckey=1.09E2; reckey recdesc 109 Has 109 as key drop table t1; +create table t1 (s1 float(0,2)); +ERROR 42000: For float(M,D) or double(M,D), M must be >= D (column 's1'). +create table t1 (s1 float(1,2)); +ERROR 42000: For float(M,D) or double(M,D), M must be >= D (column 's1'). diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index cf2a2676ab0..bb7bd37039b 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -152,7 +152,7 @@ drop table t1; # bug #12694 (float(m,d) specifications) # ---error 1427 +--error 1443 create table t1 (s1 float(0,2)); ---error 1427 +--error 1443 create table t1 (s1 float(1,2)); diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index b49b7248021..1535cc95367 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5399,3 +5399,5 @@ ER_DATETIME_FUNCTION_OVERFLOW 22008 eng "Datetime function: %-.32s field overflow" ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG eng "Can't update table '%-.64s' in stored function/trigger because it is already used by statement which invoked this stored function/trigger." +ER_M_BIGGER_THAN_D 42000 S1009 + eng "For float(M,D) or double(M,D), M must be >= D (column '%-.64s')." diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 65169f2af10..27ab3fc0579 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5760,7 +5760,7 @@ new_create_field(THD *thd, char *field_name, enum_field_types type, if (new_field->length < new_field->decimals && new_field->decimals != NOT_FIXED_DEC) { - my_error(ER_SCALE_BIGGER_THAN_PRECISION, MYF(0), field_name); + my_error(ER_M_BIGGER_THAN_D, MYF(0), field_name); DBUG_RETURN(NULL); } break; @@ -5774,7 +5774,7 @@ new_create_field(THD *thd, char *field_name, enum_field_types type, if (new_field->length < new_field->decimals && new_field->decimals != NOT_FIXED_DEC) { - my_error(ER_SCALE_BIGGER_THAN_PRECISION, MYF(0), field_name); + my_error(ER_M_BIGGER_THAN_D, MYF(0), field_name); DBUG_RETURN(NULL); } break; From 8b6a8cc5615f4df62e70ff54e8a90498a8a393a5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Sep 2005 16:39:16 +0200 Subject: [PATCH 004/225] BUG#12984 mysqltest.test: different output from "exec NonExistsinfComamdn" - Improved solution mysql-test/r/mysqltest.result: Update test results mysql-test/t/mysqltest.test: Fix test for failing "exec" and "system", by using the false command --- mysql-test/r/mysqltest.result | 2 ++ mysql-test/t/mysqltest.test | 10 ++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index ae44233aab6..2277fe1b5ed 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -179,6 +179,7 @@ source database echo message echo message mysqltest: At line 1: Empty variable +mysqltest: At line 1: command "false" failed mysqltest: At line 1: Missing argument in exec MySQL "MySQL" @@ -300,6 +301,7 @@ mysqltest: At line 1: First argument to dec must be a variable (start with $) mysqltest: At line 1: End of line junk detected: "1000" mysqltest: At line 1: Missing arguments to system, nothing to do! mysqltest: At line 1: Missing arguments to system, nothing to do! +mysqltest: At line 1: system command 'false' failed test test2 test3 diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 4d3bcc037d1..fc9f621f7cd 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -426,9 +426,8 @@ echo ; # ---------------------------------------------------------------------------- # Illegal use of exec -# Disabled, some shells prints the failed command regardless of pipes -#--error 1 -#--exec echo "--exec ';' 2> /dev/null" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "--exec false" | $MYSQL_TEST 2>&1 --error 1 --exec echo "--exec " | $MYSQL_TEST 2>&1 @@ -675,9 +674,8 @@ system echo "hej" > /dev/null; --exec echo "system;" | $MYSQL_TEST 2>&1 --error 1 --exec echo "system $NONEXISTSINFVAREABLI;" | $MYSQL_TEST 2>&1 -# Disabled, some shells prints the failed command regardless of pipes -#--error 1 -#--exec echo "system NonExistsinfComamdn 2> /dev/null;" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "system false;" | $MYSQL_TEST 2>&1 --disable_abort_on_error system NonExistsinfComamdn; From 6e3efdfea7a2f113a9ec874184d87a0eec3f199b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Sep 2005 18:15:05 +0100 Subject: [PATCH 005/225] Bug#10586 regression test mysql-test/r/derived.result: Test for bug mysql-test/t/derived.test: Test for bug --- mysql-test/r/derived.result | 12 ++++++++++++ mysql-test/t/derived.test | 13 +++++++++++++ 2 files changed, 25 insertions(+) diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index 7c9d88acf90..19325731d35 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -368,3 +368,15 @@ create table t2 (a int); select * from (select * from t1,t2) foo; ERROR 42S21: Duplicate column name 'a' drop table t1,t2; +create table t1 (ID int unsigned not null auto_increment, +DATA varchar(5) not null, primary key (ID)); +create table t2 (ID int unsigned not null auto_increment, +DATA varchar(5) not null, FID int unsigned not null, +primary key (ID)); +select A.* from (t1 inner join (select * from t2) as A on t1.ID = A.FID); +ID DATA FID +select t2.* from ((select * from t1) as A inner join t2 on A.ID = t2.FID); +ID DATA FID +select t2.* from (select * from t1) as A inner join t2 on A.ID = t2.FID; +ID DATA FID +drop table t1, t2; diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index f52e12849e4..33b06e9bc11 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -258,4 +258,17 @@ create table t2 (a int); select * from (select * from t1,t2) foo; drop table t1,t2; +# +# Bug#10586 - query works with 4.1.8, but not with 4.1.11 +# +create table t1 (ID int unsigned not null auto_increment, + DATA varchar(5) not null, primary key (ID)); +create table t2 (ID int unsigned not null auto_increment, + DATA varchar(5) not null, FID int unsigned not null, + primary key (ID)); +select A.* from (t1 inner join (select * from t2) as A on t1.ID = A.FID); +select t2.* from ((select * from t1) as A inner join t2 on A.ID = t2.FID); +select t2.* from (select * from t1) as A inner join t2 on A.ID = t2.FID; +drop table t1, t2; + # End of 4.1 tests From f28e81d03e28d6260d3cb89d13ef31e0cd9a3888 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Sep 2005 15:54:23 +1000 Subject: [PATCH 006/225] W#2776 Utility for calculating storage requirements for NDB Initial ndb_size.pl Connects to an existing MySQL database and produces a XHTML document containing an estimation of storage requirements. ndb/tools/ndb_size.pl: Initial checkin of ndb_size.pl ndb/tools/ndb_size.tmpl: Initial checkin of XHTML template file for ndb_size.pl --- ndb/tools/ndb_size.pl | 260 ++++++++++++++++++++++++++++++++++++++++ ndb/tools/ndb_size.tmpl | 175 +++++++++++++++++++++++++++ 2 files changed, 435 insertions(+) create mode 100644 ndb/tools/ndb_size.pl create mode 100644 ndb/tools/ndb_size.tmpl diff --git a/ndb/tools/ndb_size.pl b/ndb/tools/ndb_size.pl new file mode 100644 index 00000000000..92ecf5ca784 --- /dev/null +++ b/ndb/tools/ndb_size.pl @@ -0,0 +1,260 @@ +#!/usr/bin/perl -w + +use strict; + +use DBI; +use POSIX; +use HTML::Template; + +# MySQL Cluster size estimator +# ---------------------------- +# +# (C)2005 MySQL AB +# +# +# The purpose of this tool is to work out storage requirements +# from an existing MySQL database. +# +# This involves connecting to a mysql server and throwing a bunch +# of queries at it. +# +# We currently estimate sizes for: 4.1, 5.0 and 5.1 to various amounts +# of accurracy. +# +# There is no warranty. +# +# BUGS +# ---- +# - enum/set is 0 byte storage! Woah - efficient! +# - some float stores come out weird (when there's a comma e.g. 'float(4,1)') +# - no disk data values +# - computes the storage requirements of views (and probably MERGE) +# - ignores character sets. + +my $template = HTML::Template->new(filename => 'ndb_size.tmpl', + die_on_bad_params => 0); + +my $dbh; + +{ + my $database= $ARGV[0]; + my $hostname= $ARGV[1]; + my $port= $ARGV[2]; + my $user= $ARGV[3]; + my $password= $ARGV[4]; + my $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port"; + $dbh= DBI->connect($dsn, $user, $password); + $template->param(db => $database); + $template->param(dsn => $dsn); +} + +my @releases = ({rel=>'4.1'},{rel=>'5.0'},{rel=>'5.1'}); +$template->param(releases => \@releases); + +my $tables = $dbh->selectall_arrayref("show tables"); + +my @table_size; + +sub align { + my($to,@unaligned) = @_; + my @aligned; + foreach my $x (@unaligned) { + push @aligned, $to * POSIX::floor(($x+$to-1)/$to); + } + return @aligned; +} + +foreach(@{$tables}) +{ + my $table= @{$_}[0]; + my @columns; + my $info= $dbh->selectall_hashref("describe $table","Field"); + my @count = $dbh->selectrow_array("select count(*) from $table"); + my %columnsize; # used for index calculations + + # We now work out the DataMemory usage + + # sizes for 4.1, 5.0, 5.1 + my @totalsize= (0,0,0); + + foreach(keys %$info) + { + my @realsize = (0,0,0); + my $type; + my $size; + my $name= $_; + + if($$info{$_}{Type} =~ /^(.*?)\((\d+)\)/) + { + $type= $1; + $size= $2; + } + else + { + $type= $$info{$_}{Type}; + } + + if($type =~ /tinyint/) + {@realsize=(1,1,1)} + elsif($type =~ /smallint/) + {@realsize=(2,2,2)} + elsif($type =~ /mediumint/) + {@realsize=(3,3,3)} + elsif($type =~ /bigint/) + {@realsize=(8,8,8)} + elsif($type =~ /int/) + {@realsize=(4,4,4)} + elsif($type =~ /float/) + { + if($size<=24) + {@realsize=(4,4,4)} + else + {@realsize=(8,8,8)} + } + elsif($type =~ /double/ || $type =~ /real/) + {@realsize=(8,8,8)} + elsif($type =~ /bit/) + { + my $a=($size+7)/8; + @realsize = ($a,$a,$a); + } + elsif($type =~ /datetime/) + {@realsize=(8,8,8)} + elsif($type =~ /timestamp/) + {@realsize=(4,4,4)} + elsif($type =~ /date/ || $type =~ /time/) + {@realsize=(3,3,3)} + elsif($type =~ /year/) + {@realsize=(1,1,1)} + elsif($type =~ /varchar/ || $type =~ /varbinary/) + { + my $fixed= 1+$size; + my @dynamic=$dbh->selectrow_array("select avg(length($name)) from $table"); + $dynamic[0]=0 if !$dynamic[0]; + @realsize= ($fixed,$fixed,ceil($dynamic[0])); + } + elsif($type =~ /binary/ || $type =~ /char/) + {@realsize=($size,$size,$size)} + elsif($type =~ /text/ || $type =~ /blob/) + {@realsize=(256,256,1)} # FIXME check if 5.1 is correct + + @realsize= align(4,@realsize); + + $totalsize[$_]+=$realsize[$_] foreach 0..$#totalsize; + + my @realout; + push @realout,{val=>$_} foreach @realsize; + + push @columns, { + name=>$name, + type=>$type, + size=>$size, + key=>$$info{$_}{Key}, + datamemory=>\@realout, + }; + + $columnsize{$name}= \@realsize; # used for index calculations + } + + # And now... the IndexMemory usage. + # + # Firstly, we assemble some information about the indexes. + # We use SHOW INDEX instead of using INFORMATION_SCHEMA so + # we can still connect to pre-5.0 mysqlds. + my %indexes; + { + my $sth= $dbh->prepare("show index from $table"); + $sth->execute; + while(my $i = $sth->fetchrow_hashref) + { + $indexes{${%$i}{Key_name}}= { + type=>${%$i}{Index_type}, + unique=>!${%$i}{Non_unique}, + comment=>${%$i}{Comment}, + } if !defined($indexes{${%$i}{Key_name}}); + + $indexes{${%$i}{Key_name}}{columns}[${%$i}{Seq_in_index}-1]= + ${%$i}{Column_name}; + } + } + + if(!defined($indexes{PRIMARY})) { + $indexes{PRIMARY}= { + type=>'BTREE', + unique=>1, + comment=>'Hidden pkey created by NDB', + columns=>['HIDDEN_NDB_PKEY'], + }; + push @columns, { + name=>'HIDDEN_NDB_PKEY', + type=>'bigint', + size=>8, + key=>'PRI', + datamemory=>[{val=>8},{val=>8},{val=>8}], + }; + $columnsize{'HIDDEN_NDB_PKEY'}= [8,8,8]; + } + + my @IndexDataMemory= ({val=>0},{val=>0},{val=>0}); + my @RowIndexMemory= ({val=>0},{val=>0},{val=>0}); + + my @indexes; + foreach my $index (keys %indexes) { + my $im41= 25; + $im41+=$columnsize{$_}[0] foreach @{$indexes{$index}{columns}}; + my @im = ({val=>$im41},{val=>25},{val=>25}); + my @dm = ({val=>10},{val=>10},{val=>10}); + push @indexes, { + name=>$index, + type=>$indexes{$index}{type}, + columns=>join(',',@{$indexes{$index}{columns}}), + indexmemory=>\@im, + datamemory=>\@dm, + }; + $IndexDataMemory[$_]{val}+=$dm[$_]{val} foreach 0..2; + $RowIndexMemory[$_]{val}+=$im[$_]{val} foreach 0..2; + } + + # total size + 16 bytes overhead + my @TotalDataMemory; + $TotalDataMemory[$_]{val}=$IndexDataMemory[$_]{val}+$totalsize[$_]+16 foreach 0..2; + + my @RowDataMemory; + push @RowDataMemory,{val=>$_} foreach @totalsize; + + my @RowPerPage; + push @RowPerPage,{val=>(floor((32768-128)/$TotalDataMemory[$_]{val}))} foreach 0..$#TotalDataMemory; + + my @RowPerIndexPage; + push @RowPerIndexPage,{val=>(floor(8192/$RowIndexMemory[$_]{val}))} foreach 0..$#TotalDataMemory; + + my @DataMemory; + push @DataMemory,{val=>ceil(($count[0]/($RowPerPage[$_]{val})))*32} foreach 0..$#RowPerPage; + + my @IndexMemory; + push @IndexMemory,{val=>ceil(($count[0]/($RowPerIndexPage[$_]{val})))*8} foreach 0..$#RowPerPage; + + my $count= $count[0]; + my @counts; + $counts[$_]{val}= $count foreach 0..$#releases; + + push @table_size, { + table=>$table, + indexes=>\@indexes, + columns=>\@columns, + count=>\@counts, + RowDataMemory=>\@RowDataMemory, + releases=>\@releases, + IndexDataMemory=>\@IndexDataMemory, + TotalDataMemory=>\@TotalDataMemory, + RowPerPage=>\@RowPerPage, + DataMemory=>\@DataMemory, + RowIndexMemory=>\@RowIndexMemory, + RowPerIndexPage=>\@RowPerIndexPage, + IndexMemory=>\@IndexMemory, + + }; +} + +$template->param(tables => \@table_size); +print $template->output; diff --git a/ndb/tools/ndb_size.tmpl b/ndb/tools/ndb_size.tmpl new file mode 100644 index 00000000000..d83d5d2c6af --- /dev/null +++ b/ndb/tools/ndb_size.tmpl @@ -0,0 +1,175 @@ + + + + + + MySQL Cluster size estimate for <TMPL_VAR NAME="db" ESCAPE="HTML"> + + + +

MySQL Cluster analysis for

+

This is an automated analysis of the database for migration into MySQL Cluster. No warranty is made to the accuracy of the information.

+ +

This information should be valid for MySQL 4.1

+ +
    + +
  • +
    +
+ +
+ + +

+ + + + + + + + + + + + + + + + + + + + + +
ColumnTypeSizeKey NDB Size
+ +

 

+ +

Indexes

+ +

We assume that indexes are ORDERED (not created USING HASH). If order is not required, 10 bytes of data memory can be saved per row if the index is created USING HASH

+ + + + + + + + + + + + + + + + + + + + + + + + + +
IndexTypeColumns IdxMem DatMem
+ +

DataMemory Usage

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
Row Overhead16
Column DataMemory/Row
Index DataMemory/Row
Total DataMemory/Row
Rows per 32kb page
Current number of rows
Total DataMemory (kb)
+ +

IndexMemory Usage

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
IndexMemory/Row
Rows per 8kb page
Current number of rows
Total IndexMemory (kb)
+ +
+
+ +

This is the output of ndb_size.pl.

+ + + From c1c2a8920cc5939715e43b615dbb2be22f09c9d3 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Sep 2005 16:08:16 +0200 Subject: [PATCH 007/225] reengineered ndb_mgmd to use SignalSender and remove some multi user issues --- ndb/include/kernel/GlobalSignalNumbers.h | 2 +- ndb/include/kernel/signaldata/EventReport.hpp | 6 +- ndb/include/kernel/signaldata/StopReq.hpp | 10 +- ndb/src/common/debugger/EventLogger.cpp | 473 +----- ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp | 65 +- ndb/src/mgmclient/CommandInterpreter.cpp | 7 +- ndb/src/mgmsrv/MgmtSrvr.cpp | 1487 ++++++----------- ndb/src/mgmsrv/MgmtSrvr.hpp | 138 +- ndb/src/mgmsrv/MgmtSrvrConfig.cpp | 4 + .../mgmsrv/MgmtSrvrGeneralSignalHandling.cpp | 120 -- ndb/src/mgmsrv/Services.cpp | 8 + 11 files changed, 605 insertions(+), 1715 deletions(-) diff --git a/ndb/include/kernel/GlobalSignalNumbers.h b/ndb/include/kernel/GlobalSignalNumbers.h index ff3690d60a5..a4a0bafb6ec 100644 --- a/ndb/include/kernel/GlobalSignalNumbers.h +++ b/ndb/include/kernel/GlobalSignalNumbers.h @@ -553,7 +553,6 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES; #define GSN_STATISTICS_CONF 454 #define GSN_START_ORD 455 -/* 456 unused */ /* 457 unused */ #define GSN_EVENT_SUBSCRIBE_REQ 458 @@ -900,6 +899,7 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES; #define GSN_RESUME_REQ 682 #define GSN_STOP_REQ 443 #define GSN_STOP_REF 444 +#define GSN_STOP_CONF 456 #define GSN_API_VERSION_REQ 697 #define GSN_API_VERSION_CONF 698 diff --git a/ndb/include/kernel/signaldata/EventReport.hpp b/ndb/include/kernel/signaldata/EventReport.hpp index 1ad6e1bf7ac..67595648f34 100644 --- a/ndb/include/kernel/signaldata/EventReport.hpp +++ b/ndb/include/kernel/signaldata/EventReport.hpp @@ -133,9 +133,9 @@ public: CreateLogBytes = 48, InfoEvent = 49, - //GREP - GrepSubscriptionInfo = 52, - GrepSubscriptionAlert = 53, + // SINGLE USER + SingleUser = 52, + /* unused 53 */ //BACKUP BackupStarted = 54, diff --git a/ndb/include/kernel/signaldata/StopReq.hpp b/ndb/include/kernel/signaldata/StopReq.hpp index ea453ae115d..8e6a0b90a91 100644 --- a/ndb/include/kernel/signaldata/StopReq.hpp +++ b/ndb/include/kernel/signaldata/StopReq.hpp @@ -67,6 +67,13 @@ public: static bool getStopAbort(const Uint32 & requestInfo); }; +struct StopConf +{ + STATIC_CONST( SignalLength = 2 ); + Uint32 senderData; + Uint32 nodeState; +}; + class StopRef { /** @@ -86,7 +93,8 @@ public: OK = 0, NodeShutdownInProgress = 1, SystemShutdownInProgress = 2, - NodeShutdownWouldCauseSystemCrash = 3 + NodeShutdownWouldCauseSystemCrash = 3, + TransactionAbortFailed = 4 }; public: diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp index f7cef644c64..d7e4fbd53aa 100644 --- a/ndb/src/common/debugger/EventLogger.cpp +++ b/ndb/src/common/debugger/EventLogger.cpp @@ -105,9 +105,8 @@ const EventLoggerBase::EventRepLogLevelMatrix EventLoggerBase::matrix[] = { { EventReport::CreateLogBytes, LogLevel::llInfo, 11, Logger::LL_INFO }, { EventReport::InfoEvent, LogLevel::llInfo, 2, Logger::LL_INFO }, - //Global replication - { EventReport::GrepSubscriptionInfo, LogLevel::llGrep, 7, Logger::LL_INFO}, - { EventReport::GrepSubscriptionAlert, LogLevel::llGrep, 7, Logger::LL_ALERT}, + //Single User + { EventReport::SingleUser, LogLevel::llInfo, 7, Logger::LL_INFO}, // Backup { EventReport::BackupStarted, LogLevel::llBackup, 7, Logger::LL_INFO }, @@ -800,473 +799,29 @@ EventLogger::getText(char * m_text, size_t m_text_len, ); break; } - case EventReport::GrepSubscriptionInfo : + case EventReport::SingleUser : { - GrepEvent::Subscription event = (GrepEvent::Subscription)theData[1]; - switch(event) { - case GrepEvent::GrepSS_CreateSubIdConf: + switch (theData[1]) { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; + case 0: BaseString::snprintf(m_text, m_text_len, - "Grep::SSCoord: Created subscription id" - " (subId=%d,SubKey=%d)" - " Return code: %d.", - subId, - subKey, - err); + "%sEntering single user mode", theNodeId); break; - } - case GrepEvent::GrepPS_CreateSubIdConf: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; + case 1: BaseString::snprintf(m_text, m_text_len, - "Grep::PSCoord: Created subscription id" - " (subId=%d,SubKey=%d)" - " Return code: %d.", - subId, - subKey, - err); + "%sEntered single user mode %d", theNodeId, theData[2]); break; - } - case GrepEvent::GrepSS_SubCreateConf: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - const int nodegrp = theData[5]; + case 2: BaseString::snprintf(m_text, m_text_len, - "Grep::SSCoord: Created subscription using" - " (subId=%d,SubKey=%d)" - " in primary system. Primary system has %d nodegroup(s)." - " Return code: %d", - subId, - subKey, - nodegrp, - err); + "%sExiting single user mode", theNodeId); break; - } - case GrepEvent::GrepPS_SubCreateConf: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::PSCoord: All participants have created " - "subscriptions" - " using (subId=%d,SubKey=%d)." - " Return code: %d", - subId, - subKey, - err); - break; - } - case GrepEvent::GrepSS_SubStartMetaConf: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::SSCoord: Logging started on meta data changes." - " using (subId=%d,SubKey=%d)" - " Return code: %d", - subId, - subKey, - err); - break; - } - case GrepEvent::GrepPS_SubStartMetaConf: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::PSCoord: All participants have started " - "logging meta data" - " changes on the subscription subId=%d,SubKey=%d) " - "(N.I yet)." - " Return code: %d", - subId, - subKey, - err); - break; - } - case GrepEvent::GrepSS_SubStartDataConf: { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::SSCoord: Logging started on table data changes " - " using (subId=%d,SubKey=%d)" - " Return code: %d", - subId, - subKey, - err); - break; - } - case GrepEvent::GrepPS_SubStartDataConf: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::PSCoord: All participants have started logging " - "table data changes on the subscription " - "subId=%d,SubKey=%d)." - " Return code: %d", - subId, - subKey, - err); - break; - } - case GrepEvent::GrepPS_SubSyncMetaConf: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::PSCoord: All participants have started " - " synchronization on meta data (META SCAN) using " - "(subId=%d,SubKey=%d)." - " Return code: %d", - subId, - subKey, - err); - break; - } - case GrepEvent::GrepSS_SubSyncMetaConf: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::SSCoord: Synchronization started (META SCAN) on " - " meta data using (subId=%d,SubKey=%d)" - " Return code: %d", - subId, - subKey, - err); - break; - } - case GrepEvent::GrepPS_SubSyncDataConf: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::PSCoord: All participants have started " - "synchronization " - " on table data (DATA SCAN) using (subId=%d,SubKey=%d)." - " Return code: %d", - subId, - subKey, - err); - break; - } - case GrepEvent::GrepSS_SubSyncDataConf: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - const int gci = theData[5]; - BaseString::snprintf(m_text, m_text_len, - "Grep::SSCoord: Synchronization started (DATA SCAN) on " - "table data using (subId=%d,SubKey=%d). GCI = %d" - " Return code: %d", - subId, - subKey, - gci, - err); - break; - } - case GrepEvent::GrepPS_SubRemoveConf: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::PSCoord: All participants have removed " - "subscription (subId=%d,SubKey=%d). I have cleaned " - "up resources I've used." - " Return code: %d", - subId, - subKey, - err); - break; - } - case GrepEvent::GrepSS_SubRemoveConf: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::SSCoord: Removed subscription " - "(subId=%d,SubKey=%d)" - " Return code: %d", - subId, - subKey, - err); - break; - } default: - BaseString::snprintf(m_text, - m_text_len, - "%sUnknown GrepSubscriptonInfo event: %d", - theNodeId, - theData[1]); + BaseString::snprintf(m_text, m_text_len, + "%sUnknown single user report %d", theNodeId, theData[1]); + break; } break; - } - - case EventReport::GrepSubscriptionAlert : - { - GrepEvent::Subscription event = (GrepEvent::Subscription)theData[1]; - switch(event) - { - case GrepEvent::GrepSS_CreateSubIdRef: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::SSCoord:Error code: %d Error message: %s" - " (subId=%d,SubKey=%d)", - err, - GrepError::getErrorDesc((GrepError::GE_Code)err), - subId, - subKey); - break; - } - case GrepEvent::GrepSS_SubCreateRef: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::SSCoord: FAILED to Created subscription using" - " (subId=%d,SubKey=%d)in primary system." - " Error code: %d Error Message: %s", - subId, - subKey, - err, - GrepError::getErrorDesc((GrepError::GE_Code)err)); - break; - } - case GrepEvent::GrepSS_SubStartMetaRef: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::SSCoord: Logging failed to start on meta " - "data changes." - " using (subId=%d,SubKey=%d)" - " Error code: %d Error Message: %s", - subId, - subKey, - err, - GrepError::getErrorDesc((GrepError::GE_Code)err)); - break; - } - case GrepEvent::GrepSS_SubStartDataRef: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::SSCoord: Logging FAILED to start on table data " - " changes using (subId=%d,SubKey=%d)" - " Error code: %d Error Message: %s", - subId, - subKey, - err, - GrepError::getErrorDesc((GrepError::GE_Code)err)); - break; - } - case GrepEvent::GrepSS_SubSyncMetaRef: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::SSCoord: Synchronization FAILED (META SCAN) on " - " meta data using (subId=%d,SubKey=%d)" - " Error code: %d Error Message: %s", - subId, - subKey, - err, - GrepError::getErrorDesc((GrepError::GE_Code)err)); - break; - } - case GrepEvent::GrepSS_SubSyncDataRef: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - const int gci = theData[5]; - BaseString::snprintf(m_text, m_text_len, - "Grep::SSCoord: Synchronization FAILED (DATA SCAN) on " - "table data using (subId=%d,SubKey=%d). GCI = %d" - " Error code: %d Error Message: %s", - subId, - subKey, - gci, - err, - GrepError::getErrorDesc((GrepError::GE_Code)err)); - break; - } - case GrepEvent::GrepSS_SubRemoveRef: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::SSCoord: Failed to remove subscription " - "(subId=%d,SubKey=%d). " - " Error code: %d Error Message: %s", - subId, - subKey, - err, - GrepError::getErrorDesc((GrepError::GE_Code)err) - ); - break; - } - - case GrepEvent::GrepPS_CreateSubIdRef: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::PSCoord: Error code: %d Error Message: %s" - " (subId=%d,SubKey=%d)", - err, - GrepError::getErrorDesc((GrepError::GE_Code)err), - subId, - subKey); - break; - } - case GrepEvent::GrepPS_SubCreateRef: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::PSCoord: FAILED to Created subscription using" - " (subId=%d,SubKey=%d)in primary system." - " Error code: %d Error Message: %s", - subId, - subKey, - err, - GrepError::getErrorDesc((GrepError::GE_Code)err)); - break; - } - case GrepEvent::GrepPS_SubStartMetaRef: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::PSCoord: Logging failed to start on meta " - "data changes." - " using (subId=%d,SubKey=%d)" - " Error code: %d Error Message: %s", - subId, - subKey, - err, - GrepError::getErrorDesc((GrepError::GE_Code)err)); - break; - } - case GrepEvent::GrepPS_SubStartDataRef: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::PSCoord: Logging FAILED to start on table data " - " changes using (subId=%d,SubKey=%d)" - " Error code: %d Error Message: %s", - subId, - subKey, - err, - GrepError::getErrorDesc((GrepError::GE_Code)err)); - break; - } - case GrepEvent::GrepPS_SubSyncMetaRef: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::PSCoord: Synchronization FAILED (META SCAN) on " - " meta data using (subId=%d,SubKey=%d)" - " Error code: %d Error Message: %s", - subId, - subKey, - err, - GrepError::getErrorDesc((GrepError::GE_Code)err)); - break; - } - case GrepEvent::GrepPS_SubSyncDataRef: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - const int gci = theData[5]; - BaseString::snprintf(m_text, m_text_len, - "Grep::PSCoord: Synchronization FAILED (DATA SCAN) on " - "table data using (subId=%d,SubKey=%d). GCI = %d. " - " Error code: %d Error Message: %s", - subId, - subKey, - gci, - err, - GrepError::getErrorDesc((GrepError::GE_Code)err)); - break; - } - case GrepEvent::GrepPS_SubRemoveRef: - { - const int subId = theData[2]; - const int subKey = theData[3]; - const int err = theData[4]; - BaseString::snprintf(m_text, m_text_len, - "Grep::PSCoord: Failed to remove subscription " - "(subId=%d,SubKey=%d)." - " Error code: %d Error Message: %s", - subId, - subKey, - err, - GrepError::getErrorDesc((GrepError::GE_Code)err)); - break; - } - case GrepEvent::Rep_Disconnect: - { - const int err = theData[4]; - const int nodeId = theData[5]; - BaseString::snprintf(m_text, m_text_len, - "Rep: Node %d." - " Error code: %d Error Message: %s", - nodeId, - err, - GrepError::getErrorDesc((GrepError::GE_Code)err)); - break; - } - - - default: - BaseString::snprintf(m_text, - m_text_len, - "%sUnknown GrepSubscriptionAlert event: %d", - theNodeId, - theData[1]); - break; - } - break; - } - + } case EventReport::BackupStarted: BaseString::snprintf(m_text, m_text_len, diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp index 071a85c96da..e3ec1f9723e 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp @@ -1966,6 +1966,11 @@ Ndbcntr::execRESUME_REQ(Signal* signal){ //ResumeRef * const ref = (ResumeRef *)&signal->theData[0]; jamEntry(); + + signal->theData[0] = EventReport::SingleUser; + signal->theData[1] = 2; + sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB); + //Uint32 senderData = req->senderData; //BlockReference senderRef = req->senderRef; NodeState newState(NodeState::SL_STARTED); @@ -2004,12 +2009,11 @@ Ndbcntr::execSTOP_REQ(Signal* signal){ return; } - if(c_stopRec.stopReq.senderRef != 0 && !singleuser){ - jam(); + if(c_stopRec.stopReq.senderRef != 0){ /** * Requested a system shutdown */ - if(StopReq::getSystemStop(req->requestInfo)){ + if(!singleuser && StopReq::getSystemStop(req->requestInfo)){ jam(); sendSignalWithDelay(reference(), GSN_STOP_REQ, signal, 100, StopReq::SignalLength); @@ -2031,23 +2035,28 @@ Ndbcntr::execSTOP_REQ(Signal* signal){ c_stopRec.stopReq = * req; c_stopRec.stopInitiatedTime = NdbTick_CurrentMillisecond(); - if(StopReq::getSystemStop(c_stopRec.stopReq.requestInfo) && !singleuser) { - jam(); - if(StopReq::getPerformRestart(c_stopRec.stopReq.requestInfo)){ - ((Configuration&)theConfiguration).stopOnError(false); - } - } if(!singleuser) { + if(StopReq::getSystemStop(c_stopRec.stopReq.requestInfo)) { + jam(); + if(StopReq::getPerformRestart(c_stopRec.stopReq.requestInfo)){ + ((Configuration&)theConfiguration).stopOnError(false); + } + } if(!c_stopRec.checkNodeFail(signal)){ jam(); return; } + signal->theData[0] = EventReport::NDBStopStarted; + signal->theData[1] = StopReq::getSystemStop(c_stopRec.stopReq.requestInfo) ? 1 : 0; + sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB); } - - signal->theData[0] = EventReport::NDBStopStarted; - signal->theData[1] = StopReq::getSystemStop(c_stopRec.stopReq.requestInfo) ? 1 : 0; - sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB); - + else + { + signal->theData[0] = EventReport::SingleUser; + signal->theData[1] = 0; + sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB); + } + NodeState newState(NodeState::SL_STOPPING_1, StopReq::getSystemStop(c_stopRec.stopReq.requestInfo)); @@ -2129,9 +2138,11 @@ Ndbcntr::StopRecord::checkNodeFail(Signal* signal){ stopReq.senderRef = 0; - NodeState newState(NodeState::SL_STARTED); - - cntr.updateNodeState(signal, newState); + if (cntr.getNodeState().startLevel != NodeState::SL_SINGLEUSER) + { + NodeState newState(NodeState::SL_STARTED); + cntr.updateNodeState(signal, newState); + } signal->theData[0] = EventReport::NDBStopAborted; cntr.sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 1, JBB); @@ -2227,12 +2238,24 @@ void Ndbcntr::execABORT_ALL_CONF(Signal* signal){ jamEntry(); if(c_stopRec.stopReq.singleuser) { jam(); + NodeState newState(NodeState::SL_SINGLEUSER); newState.setSingleUser(true); newState.setSingleUserApi(c_stopRec.stopReq.singleUserApi); updateNodeState(signal, newState); c_stopRec.stopInitiatedTime = NdbTick_CurrentMillisecond(); + StopConf * const stopConf = (StopConf *)&signal->theData[0]; + stopConf->senderData = c_stopRec.stopReq.senderData; + stopConf->nodeState = (Uint32) NodeState::SL_SINGLEUSER; + sendSignal(c_stopRec.stopReq.senderRef, GSN_STOP_CONF, signal, StopConf::SignalLength, JBB); + + c_stopRec.stopReq.senderRef = 0; // the command is done + + signal->theData[0] = EventReport::SingleUser; + signal->theData[1] = 1; + signal->theData[2] = c_stopRec.stopReq.singleUserApi; + sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 3, JBB); } else { @@ -2250,7 +2273,13 @@ void Ndbcntr::execABORT_ALL_CONF(Signal* signal){ void Ndbcntr::execABORT_ALL_REF(Signal* signal){ jamEntry(); - ndbrequire(false); + AbortAllRef *abortAllRef = (AbortAllRef *)&signal->theData[0]; + AbortAllRef::ErrorCode errorCode = (AbortAllRef::ErrorCode) abortAllRef->errorCode; + + StopRef * const stopRef = (StopRef *)&signal->theData[0]; + stopRef->senderData = c_stopRec.stopReq.senderData; + stopRef->errorCode = StopRef::TransactionAbortFailed; + sendSignal(c_stopRec.stopReq.senderRef, GSN_STOP_REF, signal, StopRef::SignalLength, JBB); } void diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 124c5c18748..72debcc26a9 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -1430,9 +1430,8 @@ CommandInterpreter::executeEnterSingleUser(char* parameters) ndbout_c("Entering single user mode for node %d failed", nodeId); printError(); } else { - ndbout_c("Entering single user mode"); - ndbout_c("Access will be granted for API node %d only.", nodeId); - ndbout_c("Use ALL STATUS to see when single user mode has been entered."); + ndbout_c("Single user mode entered"); + ndbout_c("Access is granted for API node %d only.", nodeId); } } @@ -1445,7 +1444,7 @@ CommandInterpreter::executeExitSingleUser(char* parameters) printError(); } else { ndbout_c("Exiting single user mode in progress."); - ndbout_c("Use ALL STATUS to see when single user mode has been exited."); + ndbout_c("Use ALL STATUS or SHOW to see when single user mode has been exited."); } } diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 011643237f8..dab99cb83db 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -67,6 +67,16 @@ #define DEBUG(x) #endif +#define INIT_SIGNAL_SENDER(ss,nodeId) \ + SignalSender ss(theFacade); \ + ss.lock(); /* lock will be released on exit */ \ + {\ + int result = okToSendTo(nodeId, true);\ + if (result != 0) {\ + return result;\ + }\ + } + extern int global_flag_send_heartbeat_now; extern int g_no_nodeid_checks; extern my_bool opt_core; @@ -90,55 +100,6 @@ MgmtSrvr::logLevelThread_C(void* m) return 0; } -void * -MgmtSrvr::signalRecvThread_C(void *m) -{ - MgmtSrvr *mgm = (MgmtSrvr*)m; - mgm->signalRecvThreadRun(); - return 0; -} - -class SigMatch -{ -public: - int gsn; - void (MgmtSrvr::* function)(NdbApiSignal *signal); - - SigMatch() { gsn = 0; function = NULL; }; - - SigMatch(int _gsn, - void (MgmtSrvr::* _function)(NdbApiSignal *signal)) { - gsn = _gsn; - function = _function; - }; - - bool check(NdbApiSignal *signal) { - if(signal->readSignalNumber() == gsn) - return true; - return false; - }; - -}; - -void -MgmtSrvr::signalRecvThreadRun() -{ - Vector siglist; - siglist.push_back(SigMatch(GSN_MGM_LOCK_CONFIG_REQ, - &MgmtSrvr::handle_MGM_LOCK_CONFIG_REQ)); - siglist.push_back(SigMatch(GSN_MGM_UNLOCK_CONFIG_REQ, - &MgmtSrvr::handle_MGM_UNLOCK_CONFIG_REQ)); - - while(!_isStopThread) { - SigMatch *handler = NULL; - NdbApiSignal *signal = NULL; - if(m_signalRecvQueue.waitFor(siglist, &handler, &signal, DEFAULT_TIMEOUT)) { - if(handler->function != 0) - (this->*handler->function)(signal); - } - } -} - extern EventLogger g_eventLogger; static NdbOut& @@ -427,7 +388,6 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server, _isStopThread = false; _logLevelThread = NULL; _logLevelThreadSleep = 500; - m_signalRecvThread = NULL; theFacade = 0; @@ -636,12 +596,6 @@ MgmtSrvr::start(BaseString &error_string) "MgmtSrvr_Loglevel", NDB_THREAD_PRIO_LOW); - m_signalRecvThread = NdbThread_Create(signalRecvThread_C, - (void **)this, - 32768, - "MgmtSrvr_Service", - NDB_THREAD_PRIO_LOW); - DBUG_RETURN(true); } @@ -650,10 +604,6 @@ MgmtSrvr::start(BaseString &error_string) //**************************************************************************** MgmtSrvr::~MgmtSrvr() { - while (theSignalIdleList != NULL) { - freeSignal(); - } - if(theFacade != 0){ theFacade->stop_instance(); delete theFacade; @@ -681,10 +631,6 @@ MgmtSrvr::~MgmtSrvr() NdbThread_Destroy(&_logLevelThread); } - if (m_signalRecvThread != NULL) { - NdbThread_WaitFor(m_signalRecvThread, &res); - NdbThread_Destroy(&m_signalRecvThread); - } if (m_config_retriever) delete m_config_retriever; } @@ -692,21 +638,21 @@ MgmtSrvr::~MgmtSrvr() //**************************************************************************** //**************************************************************************** -int MgmtSrvr::okToSendTo(NodeId processId, bool unCond) +int MgmtSrvr::okToSendTo(NodeId nodeId, bool unCond) { - if(processId == 0) + if(nodeId == 0) return 0; - if (getNodeType(processId) != NDB_MGM_NODE_TYPE_NDB) + if (getNodeType(nodeId) != NDB_MGM_NODE_TYPE_NDB) return WRONG_PROCESS_TYPE; // Check if we have contact with it if(unCond){ - if(theFacade->theClusterMgr->getNodeInfo(processId).connected) + if(theFacade->theClusterMgr->getNodeInfo(nodeId).connected) return 0; return NO_CONTACT_WITH_PROCESS; } - if (theFacade->get_node_alive(processId) == 0) { + if (theFacade->get_node_alive(nodeId) == 0) { return NO_CONTACT_WITH_PROCESS; } else { return 0; @@ -727,219 +673,380 @@ void report_unknown_signal(SimpleSignal *signal) ****************************************************************************/ int -MgmtSrvr::start(int processId) +MgmtSrvr::start(int nodeId) { - int result; - - result = okToSendTo(processId, true); - if (result != 0) { - return result; - } - - NdbApiSignal* signal = getSignal(); - if (signal == NULL) { - return COULD_NOT_ALLOCATE_MEMORY; - } - - StartOrd* const startOrd = CAST_PTR(StartOrd, signal->getDataPtrSend()); - signal->set(TestOrd::TraceAPI, CMVMI, GSN_START_ORD, StartOrd::SignalLength); + INIT_SIGNAL_SENDER(ss,nodeId); + SimpleSignal ssig; + StartOrd* const startOrd = CAST_PTR(StartOrd, ssig.getDataPtrSend()); + ssig.set(ss,TestOrd::TraceAPI, CMVMI, GSN_START_ORD, StartOrd::SignalLength); startOrd->restartInfo = 0; - result = sendSignal(processId, NO_WAIT, signal, true); - if (result == -1) { - return SEND_OR_RECEIVE_FAILED; + return ss.sendSignal(nodeId, &ssig) == SEND_OK ? 0 : SEND_OR_RECEIVE_FAILED; +} + +/***************************************************************************** + * Version handling + *****************************************************************************/ + +int +MgmtSrvr::versionNode(int nodeId, Uint32 &version) +{ + version= 0; + if (getOwnNodeId() == nodeId) + { + version= NDB_VERSION; } - + else if (getNodeType(nodeId) == NDB_MGM_NODE_TYPE_NDB) + { + ClusterMgr::Node node= theFacade->theClusterMgr->getNodeInfo(nodeId); + if(node.connected) + version= node.m_info.m_version; + } + else if (getNodeType(nodeId) == NDB_MGM_NODE_TYPE_API || + getNodeType(nodeId) == NDB_MGM_NODE_TYPE_MGM) + { + return sendVersionReq(nodeId, version); + } + return 0; } -/** - * Restart one database node - */ -int -MgmtSrvr::restartNode(int processId, bool nostart, - bool initalStart, bool abort, - StopCallback callback, void * anyData) +int +MgmtSrvr::sendVersionReq(int v_nodeId, Uint32 &version) { - int result; + SignalSender ss(theFacade); + ss.lock(); - if(m_stopRec.singleUserMode) - return 5060; + SimpleSignal ssig; + ApiVersionReq* req = CAST_PTR(ApiVersionReq, ssig.getDataPtrSend()); + req->senderRef = ss.getOwnRef(); + req->nodeId = v_nodeId; + ssig.set(ss, TestOrd::TraceAPI, QMGR, GSN_API_VERSION_REQ, + ApiVersionReq::SignalLength); - if(m_stopRec.inUse){ - return 5029; - } - - result = okToSendTo(processId, true); - if (result != 0) { - return result; - } - - NdbApiSignal* signal = getSignal(); - if (signal == NULL) { - return COULD_NOT_ALLOCATE_MEMORY; - } + int do_send = 1; + NodeId nodeId; - StopReq* const stopReq = CAST_PTR(StopReq, signal->getDataPtrSend()); - signal->set(TestOrd::TraceAPI, NDBCNTR, GSN_STOP_REQ, StopReq::SignalLength); + while (1) + { + if (do_send) + { + bool next; + nodeId = 0; + while((next = getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)) == true && + okToSendTo(nodeId, true) != 0); + if(!next) return NO_CONTACT_WITH_DB_NODES; + if (ss.sendSignal(nodeId, &ssig) != SEND_OK) { + return SEND_OR_RECEIVE_FAILED; + } + do_send = 0; + } + + SimpleSignal *signal = ss.waitFor(); + + int gsn = signal->readSignalNumber(); + switch (gsn) { + case GSN_API_VERSION_CONF: { + const ApiVersionConf * const conf = + CAST_CONSTPTR(ApiVersionConf, signal->getDataPtr()); + assert(conf->nodeId == v_nodeId); + version = conf->version; + return 0; + } + case GSN_NF_COMPLETEREP:{ + const NFCompleteRep * const rep = + CAST_CONSTPTR(NFCompleteRep, signal->getDataPtr()); + if (rep->failedNodeId == nodeId) + do_send = 1; // retry with other node + continue; + } + case GSN_NODE_FAILREP:{ + const NodeFailRep * const rep = + CAST_CONSTPTR(NodeFailRep, signal->getDataPtr()); + if (rep->failNo == nodeId) + do_send = 1; // retry with other node + continue; + } + default: + report_unknown_signal(signal); + return SEND_OR_RECEIVE_FAILED; + } + break; + } // while(1) + + return 0; +} + +/* + * Common method for handeling all STOP_REQ signalling that + * is used by Stopping, Restarting and Single user commands + */ + +int MgmtSrvr::sendSTOP_REQ(NodeId nodeId, + NodeBitmask &stoppedNodes, + Uint32 singleUserNodeId, + bool abort, + bool stop, + bool restart, + bool nostart, + bool initialStart) +{ + stoppedNodes.clear(); + + SignalSender ss(theFacade); + ss.lock(); // lock will be released on exit + + SimpleSignal ssig; + StopReq* const stopReq = CAST_PTR(StopReq, ssig.getDataPtrSend()); + ssig.set(ss, TestOrd::TraceAPI, NDBCNTR, GSN_STOP_REQ, StopReq::SignalLength); + stopReq->requestInfo = 0; - StopReq::setSystemStop(stopReq->requestInfo, false); - StopReq::setPerformRestart(stopReq->requestInfo, true); - StopReq::setNoStart(stopReq->requestInfo, nostart); - StopReq::setInitialStart(stopReq->requestInfo, initalStart); - StopReq::setStopAbort(stopReq->requestInfo, abort); - stopReq->singleuser = 0; stopReq->apiTimeout = 5000; stopReq->transactionTimeout = 1000; stopReq->readOperationTimeout = 1000; stopReq->operationTimeout = 1000; stopReq->senderData = 12; - stopReq->senderRef = _ownReference; - - m_stopRec.singleUserMode = false; - m_stopRec.sentCount = 1; - m_stopRec.reply = 0; - m_stopRec.nodeId = processId; - m_stopRec.anyData = anyData; - m_stopRec.callback = callback; - m_stopRec.inUse = true; - - if(callback == NULL){ - Uint32 timeOut = 0; - timeOut += stopReq->apiTimeout; - timeOut += stopReq->transactionTimeout; - timeOut += stopReq->readOperationTimeout; - timeOut += stopReq->operationTimeout; - timeOut *= 3; - result = sendRecSignal(processId, WAIT_STOP, signal, true, timeOut); - } else { - result = sendSignal(processId, NO_WAIT, signal, true); + stopReq->senderRef = ss.getOwnRef(); + if (singleUserNodeId) + { + stopReq->singleuser = 1; + stopReq->singleUserApi = singleUserNodeId; + StopReq::setSystemStop(stopReq->requestInfo, false); + StopReq::setPerformRestart(stopReq->requestInfo, false); + StopReq::setStopAbort(stopReq->requestInfo, false); } - - if (result == -1 && theWaitState != WAIT_NODEFAILURE) { - m_stopRec.inUse = false; - return SEND_OR_RECEIVE_FAILED; + else + { + stopReq->singleuser = 0; + StopReq::setSystemStop(stopReq->requestInfo, stop); + StopReq::setPerformRestart(stopReq->requestInfo, restart); + StopReq::setStopAbort(stopReq->requestInfo, abort); + StopReq::setNoStart(stopReq->requestInfo, nostart); + StopReq::setInitialStart(stopReq->requestInfo, initialStart); } - if(callback == 0){ - m_stopRec.inUse = false; - return m_stopRec.reply; - } else { - return 0; - } -} - -/** - * Restart all database nodes - */ -int -MgmtSrvr::restart(bool nostart, bool initalStart, bool abort, - int * stopCount, StopCallback callback, void * anyData) -{ - if(m_stopRec.singleUserMode) - return 5060; - - if(m_stopRec.inUse){ - return 5029; - } - - m_stopRec.singleUserMode = false; - m_stopRec.sentCount = 0; - m_stopRec.reply = 0; - m_stopRec.nodeId = 0; - m_stopRec.anyData = anyData; - m_stopRec.callback = callback; - m_stopRec.inUse = true; - - /** - * Restart all database nodes into idle ("no-started") state - */ - Uint32 timeOut = 0; - NodeId nodeId = 0; + // send the signals NodeBitmask nodes; - while(getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)){ - if(okToSendTo(nodeId, true) == 0){ - - NdbApiSignal* signal = getSignal(); - if (signal == NULL) { - return COULD_NOT_ALLOCATE_MEMORY; - } - - StopReq* const stopReq = CAST_PTR(StopReq, signal->getDataPtrSend()); - signal->set(TestOrd::TraceAPI, NDBCNTR, GSN_STOP_REQ, - StopReq::SignalLength); - - stopReq->requestInfo = 0; - stopReq->singleuser = 0; - StopReq::setSystemStop(stopReq->requestInfo, true); - StopReq::setPerformRestart(stopReq->requestInfo, true); - if (callback == 0) { - // Start node in idle ("no-started") state - StopReq::setNoStart(stopReq->requestInfo, 1); - } else { - StopReq::setNoStart(stopReq->requestInfo, nostart); - } - StopReq::setInitialStart(stopReq->requestInfo, initalStart); - StopReq::setStopAbort(stopReq->requestInfo, abort); - - stopReq->apiTimeout = 5000; - stopReq->transactionTimeout = 1000; - stopReq->readOperationTimeout = 1000; - stopReq->operationTimeout = 1000; - stopReq->senderData = 12; - stopReq->senderRef = _ownReference; - - timeOut += stopReq->apiTimeout; - timeOut += stopReq->transactionTimeout; - timeOut += stopReq->readOperationTimeout; - timeOut += stopReq->operationTimeout; - timeOut *= 3; - - m_stopRec.sentCount++; - int res; - if(callback == 0){ - res = sendSignal(nodeId, WAIT_STOP, signal, true); - } else { - res = sendSignal(nodeId, NO_WAIT, signal, true); - } - - if(res != -1){ - nodes.set(nodeId); + if (nodeId) + { + { + int r; + if((r = okToSendTo(nodeId, true)) != 0) + return r; + } + { + if (ss.sendSignal(nodeId, &ssig) != SEND_OK) + return SEND_OR_RECEIVE_FAILED; + } + nodes.set(nodeId); + } + else + while(getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)) + { + if(okToSendTo(nodeId, true) == 0) + { + SendStatus result = ss.sendSignal(nodeId, &ssig); + if (result == SEND_OK) + nodes.set(nodeId); } } - } - - if(stopCount != 0){ - * stopCount = m_stopRec.sentCount; - } - if(m_stopRec.sentCount == 0){ - m_stopRec.inUse = false; - return 0; + // now wait for the replies + int error = 0; + while (!nodes.isclear()) + { + SimpleSignal *signal = ss.waitFor(); + int gsn = signal->readSignalNumber(); + switch (gsn) { + case GSN_STOP_REF:{ + const StopRef * const ref = CAST_CONSTPTR(StopRef, signal->getDataPtr()); + const NodeId nodeId = refToNode(signal->header.theSendersBlockRef); +#ifdef VM_TRACE + ndbout_c("Node %d refused stop", nodeId); +#endif + assert(nodes.get(nodeId)); + nodes.clear(nodeId); + error = translateStopRef(ref->errorCode); + break; + } + case GSN_STOP_CONF:{ + const StopConf * const ref = CAST_CONSTPTR(StopConf, signal->getDataPtr()); + const NodeId nodeId = refToNode(signal->header.theSendersBlockRef); +#ifdef VM_TRACE + ndbout_c("Node %d single user mode", nodeId); +#endif + assert(nodes.get(nodeId)); + assert(singleUserNodeId != 0); + nodes.clear(nodeId); + stoppedNodes.set(nodeId); + break; + } + case GSN_NF_COMPLETEREP:{ + const NFCompleteRep * const rep = + CAST_CONSTPTR(NFCompleteRep, signal->getDataPtr()); +#ifdef VM_TRACE + ndbout_c("Node %d fail completed", rep->failedNodeId); +#endif + break; + } + case GSN_NODE_FAILREP:{ + const NodeFailRep * const rep = + CAST_CONSTPTR(NodeFailRep, signal->getDataPtr()); +#ifdef VM_TRACE + ndbout_c("Node %d failed", rep->failNo); +#endif + if (nodes.get(rep->failNo)) + { + nodes.clear(rep->failNo); + if (singleUserNodeId == 0) + stoppedNodes.set(rep->failNo); + } + break; + } + default: + report_unknown_signal(signal); +#ifdef VM_TRACE + ndbout_c("Unknown signal %d", gsn); +#endif + return SEND_OR_RECEIVE_FAILED; + } } - - if(callback != 0){ - return 0; + return error; +} + +/* + * Stop one node + */ + +int MgmtSrvr::stopNode(int nodeId, bool abort) +{ + NodeBitmask nodes; + return sendSTOP_REQ(nodeId, + nodes, + 0, + abort, + false, + false, + false, + false); +} + +/* + * Perform system shutdown + */ + +int MgmtSrvr::stop(int * stopCount, bool abort) +{ + NodeBitmask nodes; + int ret = sendSTOP_REQ(0, + nodes, + 0, + abort, + true, + false, + false, + false); + if (stopCount) + *stopCount = nodes.count(); + return ret; +} + +/* + * Enter single user mode on all live nodes + */ + +int MgmtSrvr::enterSingleUser(int * stopCount, Uint32 singleUserNodeId) +{ + if (getNodeType(singleUserNodeId) != NDB_MGM_NODE_TYPE_API) + return 5062; + NodeId nodeId = 0; + ClusterMgr::Node node; + while(getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)) + { + node = theFacade->theClusterMgr->getNodeInfo(nodeId); + if((node.m_state.startLevel != NodeState::SL_STARTED) && + (node.m_state.startLevel != NodeState::SL_NOTHING)) + return 5063; } - - theFacade->lock_mutex(); - int waitTime = timeOut/m_stopRec.sentCount; - if (receiveOptimisedResponse(waitTime) != 0) { - m_stopRec.inUse = false; - return -1; - } - + NodeBitmask nodes; + int ret = sendSTOP_REQ(0, + nodes, + singleUserNodeId, + false, + false, + false, + false, + false); + if (stopCount) + *stopCount = nodes.count(); + return ret; +} + +/* + * Perform node restart + */ + +int MgmtSrvr::restartNode(int nodeId, bool nostart, bool initialStart, + bool abort) +{ + NodeBitmask nodes; + return sendSTOP_REQ(nodeId, + nodes, + 0, + abort, + false, + true, + nostart, + initialStart); +} + +/* + * Perform system restart + */ + +int MgmtSrvr::restart(bool nostart, bool initialStart, + bool abort, int * stopCount ) +{ + NodeBitmask nodes; + int ret = sendSTOP_REQ(0, + nodes, + 0, + abort, + true, + true, + true, + initialStart); + + if (ret) + return ret; + + if (stopCount) + *stopCount = nodes.count(); + +#ifdef VM_TRACE + ndbout_c("Stopped %d nodes", nodes.count()); +#endif /** * Here all nodes were correctly stopped, * so we wait for all nodes to be contactable */ - nodeId = 0; + int waitTime = 12000; + NodeId nodeId = 0; NDB_TICKS maxTime = NdbTick_CurrentMillisecond() + waitTime; - while(getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB) && nodes.get(nodeId)) { + + ndbout_c(" %d", nodes.get(1)); + ndbout_c(" %d", nodes.get(2)); + + while(getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)) { + if (!nodes.get(nodeId)) + continue; enum ndb_mgm_node_status s; s = NDB_MGM_NODE_STATUS_NO_CONTACT; +#ifdef VM_TRACE + ndbout_c("Waiting for %d not started", nodeId); +#endif while (s != NDB_MGM_NODE_STATUS_NOT_STARTED && waitTime > 0) { Uint32 startPhase = 0, version = 0, dynamicId = 0, nodeGroup = 0; Uint32 connectCount = 0; @@ -951,17 +1058,17 @@ MgmtSrvr::restart(bool nostart, bool initalStart, bool abort, } } - if(nostart){ - m_stopRec.inUse = false; + if(nostart) return 0; - } /** * Now we start all database nodes (i.e. we make them non-idle) * We ignore the result we get from the start command. */ nodeId = 0; - while(getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB) && nodes.get(nodeId)) { + while(getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)) { + if (!nodes.get(nodeId)) + continue; int result; result = start(nodeId); DEBUG("Starting node " << nodeId << " with result " << result); @@ -970,455 +1077,43 @@ MgmtSrvr::restart(bool nostart, bool initalStart, bool abort, * Maybe the user only wanted to restart a subset of the nodes. * It is also easy for the user to check which nodes have * started and which nodes have not. - * - * if (result != 0) { - * m_stopRec.inUse = false; - * return result; - * } */ } - m_stopRec.inUse = false; - return 0; -} - -/***************************************************************************** - * Version handling - *****************************************************************************/ - -int -MgmtSrvr::versionNode(int processId, bool abort, - VersionCallback callback, void * anyData) -{ - int version; - - if(m_versionRec.inUse) - return OPERATION_IN_PROGRESS; - - m_versionRec.callback = callback; - m_versionRec.inUse = true ; - - if (getOwnNodeId() == processId) - { - version= NDB_VERSION; - } - else if (getNodeType(processId) == NDB_MGM_NODE_TYPE_NDB) - { - ClusterMgr::Node node= theFacade->theClusterMgr->getNodeInfo(processId); - if(node.connected) - version= node.m_info.m_version; - else - version= 0; - } - else if (getNodeType(processId) == NDB_MGM_NODE_TYPE_API || - getNodeType(processId) == NDB_MGM_NODE_TYPE_MGM) - { - return sendVersionReq(processId); - } - else - version= 0; - - if(m_versionRec.callback != 0) - m_versionRec.callback(processId, version, this,0); - m_versionRec.inUse = false ; - - m_versionRec.version[processId]= version; - - return 0; -} - -int -MgmtSrvr::sendVersionReq(int processId) -{ - Uint32 ndbnode=0; - int result; - for(Uint32 i = 0; igetDataPtrSend()); - req->senderRef = _ownReference; - req->nodeId = processId; - - signal->set(TestOrd::TraceAPI, QMGR, GSN_API_VERSION_REQ, - ApiVersionReq::SignalLength); - - - // if(m_versionRec.callback == 0){ - Uint32 timeOut = 0; - timeOut = 10000; - result = sendRecSignal(ndbnode, WAIT_VERSION, signal, true, timeOut); - //} else { - //result = sendSignal(processId, NO_WAIT, signal, true); - // } - - if (result == -1) { - m_versionRec.inUse = false; - if(m_versionRec.callback != 0) - m_versionRec.callback(processId, 0, this,0); - m_versionRec.version[processId] = 0; - return SEND_OR_RECEIVE_FAILED; - } - - m_versionRec.inUse = false; return 0; } int -MgmtSrvr::version(int * stopCount, bool abort, - VersionCallback callback, void * anyData) +MgmtSrvr::exitSingleUser(int * stopCount, bool abort) { - ClusterMgr::Node node; - int version; - - if(m_versionRec.inUse) - return 1; - - m_versionRec.callback = callback; - m_versionRec.inUse = true ; - Uint32 i; - for(i = 0; itheClusterMgr->getNodeInfo(i); - version = node.m_info.m_version; - if(theFacade->theClusterMgr->getNodeInfo(i).connected) - m_versionRec.callback(i, version, this,0); - else - m_versionRec.callback(i, 0, this,0); - - } - } - for(i = 0; igetDataPtrSend()); - signal->set(TestOrd::TraceAPI, NDBCNTR, GSN_STOP_REQ, StopReq::SignalLength); - - stopReq->requestInfo = 0; - stopReq->singleuser = 0; - StopReq::setPerformRestart(stopReq->requestInfo, false); - StopReq::setSystemStop(stopReq->requestInfo, false); - StopReq::setStopAbort(stopReq->requestInfo, abort); - - stopReq->apiTimeout = 5000; - stopReq->transactionTimeout = 1000; - stopReq->readOperationTimeout = 1000; - stopReq->operationTimeout = 1000; - stopReq->senderData = 12; - stopReq->senderRef = _ownReference; - - m_stopRec.sentCount = 1; - m_stopRec.reply = 0; - m_stopRec.nodeId = processId; - m_stopRec.anyData = anyData; - m_stopRec.callback = callback; - m_stopRec.inUse = true; - - if(callback == NULL){ - Uint32 timeOut = 0; - timeOut += stopReq->apiTimeout; - timeOut += stopReq->transactionTimeout; - timeOut += stopReq->readOperationTimeout; - timeOut += stopReq->operationTimeout; - timeOut *= 3; - result = sendRecSignal(processId, WAIT_STOP, signal, true, timeOut); - } else { - result = sendSignal(processId, NO_WAIT, signal, true); - } - - if (result == -1) { - m_stopRec.inUse = false; - return SEND_OR_RECEIVE_FAILED; - } - - if(callback == 0){ - m_stopRec.inUse = false; - return m_stopRec.reply; - } else { - return 0; - } -} - -int -MgmtSrvr::stop(int * stopCount, bool abort, StopCallback callback, - void * anyData) -{ - if(m_stopRec.singleUserMode) - return 5060; - - if(m_stopRec.inUse){ - return 5029; - } - - m_stopRec.singleUserMode = false; - m_stopRec.sentCount = 0; - m_stopRec.reply = 0; - m_stopRec.nodeId = 0; - m_stopRec.anyData = anyData; - m_stopRec.callback = callback; - m_stopRec.inUse = true; - NodeId nodeId = 0; - Uint32 timeOut = 0; + int count = 0; + + SignalSender ss(theFacade); + ss.lock(); // lock will be released on exit + + SimpleSignal ssig; + ResumeReq* const resumeReq = + CAST_PTR(ResumeReq, ssig.getDataPtrSend()); + ssig.set(ss,TestOrd::TraceAPI, NDBCNTR, GSN_RESUME_REQ, + ResumeReq::SignalLength); + resumeReq->senderData = 12; + resumeReq->senderRef = ss.getOwnRef(); + while(getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)){ if(okToSendTo(nodeId, true) == 0){ - - NdbApiSignal* signal = getSignal(); - if (signal == NULL) { - return COULD_NOT_ALLOCATE_MEMORY; - } - - StopReq* const stopReq = CAST_PTR(StopReq, signal->getDataPtrSend()); - signal->set(TestOrd::TraceAPI, NDBCNTR, GSN_STOP_REQ, - StopReq::SignalLength); - - stopReq->requestInfo = 0; - stopReq->singleuser = 0; - StopReq::setSystemStop(stopReq->requestInfo, true); - StopReq::setPerformRestart(stopReq->requestInfo, false); - StopReq::setStopAbort(stopReq->requestInfo, abort); - - stopReq->apiTimeout = 5000; - stopReq->transactionTimeout = 1000; - stopReq->readOperationTimeout = 1000; - stopReq->operationTimeout = 1000; - stopReq->senderData = 12; - stopReq->senderRef = _ownReference; - - timeOut += stopReq->apiTimeout; - timeOut += stopReq->transactionTimeout; - timeOut += stopReq->readOperationTimeout; - timeOut += stopReq->operationTimeout; - timeOut *= 3; - - m_stopRec.sentCount++; - if(callback == 0) - sendSignal(nodeId, WAIT_STOP, signal, true); - else - sendSignal(nodeId, NO_WAIT, signal, true); + SendStatus result = ss.sendSignal(nodeId, &ssig); + if (result == SEND_OK) + count++; } } if(stopCount != 0) - * stopCount = m_stopRec.sentCount; - - if(m_stopRec.sentCount > 0){ - if(callback == 0){ - theFacade->lock_mutex(); - receiveOptimisedResponse(timeOut / m_stopRec.sentCount); - } else { - return 0; - } - } - - m_stopRec.inUse = false; - return m_stopRec.reply; + * stopCount = count; + + return 0; } -/***************************************************************************** - * Single user mode - ****************************************************************************/ - -int -MgmtSrvr::enterSingleUser(int * stopCount, Uint32 singleUserNodeId, - EnterSingleCallback callback, void * anyData) -{ - if(m_stopRec.singleUserMode) { - return 5060; - } - - if (getNodeType(singleUserNodeId) != NDB_MGM_NODE_TYPE_API) { - return 5062; - } - ClusterMgr::Node node; - - for(Uint32 i = 0; itheClusterMgr->getNodeInfo(i); - if((node.m_state.startLevel != NodeState::SL_STARTED) && - (node.m_state.startLevel != NodeState::SL_NOTHING)) { - return 5063; - } - } - } - - if(m_stopRec.inUse){ - return 5029; - } - - if(singleUserNodeId == 0) - return 1; - m_stopRec.singleUserMode = true; - m_stopRec.sentCount = 0; - m_stopRec.reply = 0; - m_stopRec.nodeId = 0; - m_stopRec.anyData = anyData; - m_stopRec.callback = callback; - m_stopRec.inUse = true; - - NodeId nodeId = 0; - Uint32 timeOut = 0; - while(getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)){ - if(okToSendTo(nodeId, true) == 0){ - - NdbApiSignal* signal = getSignal(); - if (signal == NULL) { - return COULD_NOT_ALLOCATE_MEMORY; - } - - StopReq* const stopReq = CAST_PTR(StopReq, signal->getDataPtrSend()); - signal->set(TestOrd::TraceAPI, NDBCNTR, GSN_STOP_REQ, - StopReq::SignalLength); - - stopReq->requestInfo = 0; - stopReq->singleuser = 1; - stopReq->singleUserApi = singleUserNodeId; - StopReq::setSystemStop(stopReq->requestInfo, false); - StopReq::setPerformRestart(stopReq->requestInfo, false); - StopReq::setStopAbort(stopReq->requestInfo, false); - - stopReq->apiTimeout = 5000; - stopReq->transactionTimeout = 1000; - stopReq->readOperationTimeout = 1000; - stopReq->operationTimeout = 1000; - stopReq->senderData = 12; - stopReq->senderRef = _ownReference; - timeOut += stopReq->apiTimeout; - timeOut += stopReq->transactionTimeout; - timeOut += stopReq->readOperationTimeout; - timeOut += stopReq->operationTimeout; - timeOut *= 3; - - m_stopRec.sentCount++; - if(callback == 0) - sendSignal(nodeId, WAIT_STOP, signal, true); - else - sendSignal(nodeId, NO_WAIT, signal, true); - } - } - - if(stopCount != 0) - * stopCount = m_stopRec.sentCount; - - if(callback == 0){ - m_stopRec.inUse = false; - return 0; - // return m_stopRec.reply; - } else { - return 0; - } - - m_stopRec.inUse = false; - return m_stopRec.reply; -} - -int -MgmtSrvr::exitSingleUser(int * stopCount, bool abort, - ExitSingleCallback callback, void * anyData) -{ - m_stopRec.sentCount = 0; - m_stopRec.reply = 0; - m_stopRec.nodeId = 0; - m_stopRec.anyData = anyData; - m_stopRec.callback = callback; - m_stopRec.inUse = true; - - NodeId nodeId = 0; - while(getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)){ - if(okToSendTo(nodeId, true) == 0){ - - NdbApiSignal* signal = getSignal(); - if (signal == NULL) { - return COULD_NOT_ALLOCATE_MEMORY; - } - - ResumeReq* const resumeReq = - CAST_PTR(ResumeReq, signal->getDataPtrSend()); - signal->set(TestOrd::TraceAPI, NDBCNTR, GSN_RESUME_REQ, - StopReq::SignalLength); - resumeReq->senderData = 12; - resumeReq->senderRef = _ownReference; - - m_stopRec.sentCount++; - if(callback == 0) - sendSignal(nodeId, WAIT_STOP, signal, true); - else - sendSignal(nodeId, NO_WAIT, signal, true); - } - } - - m_stopRec.singleUserMode = false; - - if(stopCount != 0) - * stopCount = m_stopRec.sentCount; - - - if(callback == 0){ - m_stopRec.inUse = false; - return m_stopRec.reply; - } else { - return 0; - } - - m_stopRec.inUse = false; - return m_stopRec.reply; -} - - /***************************************************************************** * Status ****************************************************************************/ @@ -1426,7 +1121,7 @@ MgmtSrvr::exitSingleUser(int * stopCount, bool abort, #include int -MgmtSrvr::status(int processId, +MgmtSrvr::status(int nodeId, ndb_mgm_node_status * _status, Uint32 * version, Uint32 * _phase, @@ -1435,23 +1130,20 @@ MgmtSrvr::status(int processId, Uint32 * nodegroup, Uint32 * connectCount) { - if (getNodeType(processId) == NDB_MGM_NODE_TYPE_API || - getNodeType(processId) == NDB_MGM_NODE_TYPE_MGM) { - if(versionNode(processId, false,0,0) ==0) - * version = m_versionRec.version[processId]; - else - * version = 0; + if (getNodeType(nodeId) == NDB_MGM_NODE_TYPE_API || + getNodeType(nodeId) == NDB_MGM_NODE_TYPE_MGM) { + versionNode(nodeId, *version); } const ClusterMgr::Node node = - theFacade->theClusterMgr->getNodeInfo(processId); + theFacade->theClusterMgr->getNodeInfo(nodeId); if(!node.connected){ * _status = NDB_MGM_NODE_STATUS_NO_CONTACT; return 0; } - if (getNodeType(processId) == NDB_MGM_NODE_TYPE_NDB) { + if (getNodeType(nodeId) == NDB_MGM_NODE_TYPE_NDB) { * version = node.m_info.m_version; } @@ -1514,103 +1206,93 @@ MgmtSrvr::status(int processId, } int -MgmtSrvr::setEventReportingLevelImpl(int processId, +MgmtSrvr::setEventReportingLevelImpl(int nodeId, const EventSubscribeReq& ll) { - - int result = okToSendTo(processId, true); - if (result != 0) { - return result; - } - - NdbApiSignal signal(_ownReference); + INIT_SIGNAL_SENDER(ss,nodeId); + SimpleSignal ssig; EventSubscribeReq * dst = - CAST_PTR(EventSubscribeReq, signal.getDataPtrSend()); - - * dst = ll; - - signal.set(TestOrd::TraceAPI, CMVMI, GSN_EVENT_SUBSCRIBE_REQ, - EventSubscribeReq::SignalLength); - - theFacade->lock_mutex(); - send(&signal, processId, NODE_TYPE_DB); - theFacade->unlock_mutex(); - - return 0; -} + CAST_PTR(EventSubscribeReq, ssig.getDataPtrSend()); + ssig.set(ss,TestOrd::TraceAPI, CMVMI, GSN_EVENT_SUBSCRIBE_REQ, + EventSubscribeReq::SignalLength); + *dst = ll; -//**************************************************************************** -//**************************************************************************** -int -MgmtSrvr::setNodeLogLevelImpl(int processId, const SetLogLevelOrd & ll) -{ - int result = okToSendTo(processId, true); - if (result != 0) { - return result; + if (ss.sendSignal(nodeId, &ssig) != SEND_OK) { + return SEND_OR_RECEIVE_FAILED; } - NdbApiSignal signal(_ownReference); - - SetLogLevelOrd * dst = CAST_PTR(SetLogLevelOrd, signal.getDataPtrSend()); - - * dst = ll; - - signal.set(TestOrd::TraceAPI, CMVMI, GSN_SET_LOGLEVELORD, - SetLogLevelOrd::SignalLength); - - theFacade->lock_mutex(); - theFacade->sendSignalUnCond(&signal, processId); - theFacade->unlock_mutex(); - - return 0; -} - -int -MgmtSrvr::send(NdbApiSignal* signal, Uint32 node, Uint32 node_type){ - Uint32 max = (node == 0) ? MAX_NODES : node + 1; - - for(; node < max; node++){ - while(nodeTypes[node] != (int)node_type && node < max) node++; - if(nodeTypes[node] != (int)node_type) +#if 0 + while (1) + { + SimpleSignal *signal = ss.waitFor(); + int gsn = signal->readSignalNumber(); + switch (gsn) { + case GSN_EVENT_SUBSCRIBE_CONF:{ break; - theFacade->sendSignalUnCond(signal, node); + } + case GSN_EVENT_SUBSCRIBE_REF:{ + return SEND_OR_RECEIVE_FAILED; + } + case GSN_NF_COMPLETEREP:{ + const NFCompleteRep * const rep = + CAST_CONSTPTR(NFCompleteRep, signal->getDataPtr()); + if (rep->failedNodeId == nodeId) + return SEND_OR_RECEIVE_FAILED; + break; + } + case GSN_NODE_FAILREP:{ + const NodeFailRep * const rep = + CAST_CONSTPTR(NodeFailRep, signal->getDataPtr()); + if (rep->failNo == nodeId) + return SEND_OR_RECEIVE_FAILED; + break; + } + default: + report_unknown_signal(signal); + return SEND_OR_RECEIVE_FAILED; + } + } +#endif return 0; } +//**************************************************************************** +//**************************************************************************** +int +MgmtSrvr::setNodeLogLevelImpl(int nodeId, const SetLogLevelOrd & ll) +{ + INIT_SIGNAL_SENDER(ss,nodeId); + + SimpleSignal ssig; + ssig.set(ss,TestOrd::TraceAPI, CMVMI, GSN_SET_LOGLEVELORD, + SetLogLevelOrd::SignalLength); + SetLogLevelOrd* const dst = CAST_PTR(SetLogLevelOrd, ssig.getDataPtrSend()); + *dst = ll; + + return ss.sendSignal(nodeId, &ssig) == SEND_OK ? 0 : SEND_OR_RECEIVE_FAILED; +} + //**************************************************************************** //**************************************************************************** int -MgmtSrvr::insertError(int processId, int errorNo) +MgmtSrvr::insertError(int nodeId, int errorNo) { if (errorNo < 0) { return INVALID_ERROR_NUMBER; } - int result; - result = okToSendTo(processId, true); - if (result != 0) { - return result; - } + INIT_SIGNAL_SENDER(ss,nodeId); - NdbApiSignal* signal = getSignal(); - if (signal == NULL) { - return COULD_NOT_ALLOCATE_MEMORY; - } - - TamperOrd* const tamperOrd = CAST_PTR(TamperOrd, signal->getDataPtrSend()); + SimpleSignal ssig; + ssig.set(ss,TestOrd::TraceAPI, CMVMI, GSN_TAMPER_ORD, + TamperOrd::SignalLength); + TamperOrd* const tamperOrd = CAST_PTR(TamperOrd, ssig.getDataPtrSend()); tamperOrd->errorNo = errorNo; - signal->set(TestOrd::TraceAPI, CMVMI, GSN_TAMPER_ORD, - TamperOrd::SignalLength); - result = sendSignal(processId, NO_WAIT, signal, true); - if (result == -1) { - return SEND_OR_RECEIVE_FAILED; - } - - return 0; + return ss.sendSignal(nodeId, &ssig) == SEND_OK ? 0 : SEND_OR_RECEIVE_FAILED; } @@ -1619,37 +1301,23 @@ MgmtSrvr::insertError(int processId, int errorNo) //**************************************************************************** int -MgmtSrvr::setTraceNo(int processId, int traceNo) +MgmtSrvr::setTraceNo(int nodeId, int traceNo) { if (traceNo < 0) { return INVALID_TRACE_NUMBER; } - int result; - result = okToSendTo(processId, true); - if (result != 0) { - return result; - } + INIT_SIGNAL_SENDER(ss,nodeId); - NdbApiSignal* signal = getSignal(); - if (signal == NULL) { - return COULD_NOT_ALLOCATE_MEMORY; - } - - TestOrd* const testOrd = CAST_PTR(TestOrd, signal->getDataPtrSend()); + SimpleSignal ssig; + ssig.set(ss,TestOrd::TraceAPI, CMVMI, GSN_TEST_ORD, TestOrd::SignalLength); + TestOrd* const testOrd = CAST_PTR(TestOrd, ssig.getDataPtrSend()); testOrd->clear(); - // Assume TRACE command causes toggling. Not really defined... ? TODO testOrd->setTraceCommand(TestOrd::Toggle, (TestOrd::TraceSpecification)traceNo); - signal->set(TestOrd::TraceAPI, CMVMI, GSN_TEST_ORD, TestOrd::SignalLength); - result = sendSignal(processId, NO_WAIT, signal, true); - if (result == -1) { - return SEND_OR_RECEIVE_FAILED; - } - - return 0; + return ss.sendSignal(nodeId, &ssig) == SEND_OK ? 0 : SEND_OR_RECEIVE_FAILED; } //**************************************************************************** @@ -1668,14 +1336,10 @@ MgmtSrvr::getBlockNumber(const BaseString &blockName) //**************************************************************************** int -MgmtSrvr::setSignalLoggingMode(int processId, LogMode mode, +MgmtSrvr::setSignalLoggingMode(int nodeId, LogMode mode, const Vector& blocks) { - int result; - result = okToSendTo(processId, true); - if (result != 0) { - return result; - } + INIT_SIGNAL_SENDER(ss,nodeId); // Convert from MgmtSrvr format... @@ -1710,12 +1374,10 @@ MgmtSrvr::setSignalLoggingMode(int processId, LogMode mode, return -1; } - NdbApiSignal* signal = getSignal(); - if (signal == NULL) { - return COULD_NOT_ALLOCATE_MEMORY; - } + SimpleSignal ssig; + ssig.set(ss,TestOrd::TraceAPI, CMVMI, GSN_TEST_ORD, TestOrd::SignalLength); - TestOrd* const testOrd = CAST_PTR(TestOrd, signal->getDataPtrSend()); + TestOrd* const testOrd = CAST_PTR(TestOrd, ssig.getDataPtrSend()); testOrd->clear(); if (blocks.size() == 0 || blocks[0] == "ALL") { @@ -1725,78 +1387,44 @@ MgmtSrvr::setSignalLoggingMode(int processId, LogMode mode, for(unsigned i = 0; i < blocks.size(); i++){ int blockNumber = getBlockNumber(blocks[i]); if (blockNumber == -1) { - releaseSignal(signal); return INVALID_BLOCK_NAME; } testOrd->addSignalLoggerCommand(blockNumber, command, logSpec); } // for } // else - - signal->set(TestOrd::TraceAPI, CMVMI, GSN_TEST_ORD, TestOrd::SignalLength); - result = sendSignal(processId, NO_WAIT, signal, true); - if (result == -1) { - return SEND_OR_RECEIVE_FAILED; - } - return 0; + return ss.sendSignal(nodeId, &ssig) == SEND_OK ? 0 : SEND_OR_RECEIVE_FAILED; } - /***************************************************************************** * Signal tracing *****************************************************************************/ -int MgmtSrvr::startSignalTracing(int processId) +int MgmtSrvr::startSignalTracing(int nodeId) { - int result; - result = okToSendTo(processId, true); - if (result != 0) { - return result; - } - - NdbApiSignal* signal = getSignal(); - if (signal == NULL) { - return COULD_NOT_ALLOCATE_MEMORY; - } - + INIT_SIGNAL_SENDER(ss,nodeId); - TestOrd* const testOrd = CAST_PTR(TestOrd, signal->getDataPtrSend()); + SimpleSignal ssig; + ssig.set(ss,TestOrd::TraceAPI, CMVMI, GSN_TEST_ORD, TestOrd::SignalLength); + + TestOrd* const testOrd = CAST_PTR(TestOrd, ssig.getDataPtrSend()); testOrd->clear(); testOrd->setTestCommand(TestOrd::On); - signal->set(TestOrd::TraceAPI, CMVMI, GSN_TEST_ORD, TestOrd::SignalLength); - result = sendSignal(processId, NO_WAIT, signal, true); - if (result == -1) { - return SEND_OR_RECEIVE_FAILED; - } - - return 0; + return ss.sendSignal(nodeId, &ssig) == SEND_OK ? 0 : SEND_OR_RECEIVE_FAILED; } int -MgmtSrvr::stopSignalTracing(int processId) +MgmtSrvr::stopSignalTracing(int nodeId) { - int result; - result = okToSendTo(processId, true); - if (result != 0) { - return result; - } + INIT_SIGNAL_SENDER(ss,nodeId); - NdbApiSignal* signal = getSignal(); - if (signal == NULL) { - return COULD_NOT_ALLOCATE_MEMORY; - } - - TestOrd* const testOrd = CAST_PTR(TestOrd, signal->getDataPtrSend()); + SimpleSignal ssig; + ssig.set(ss,TestOrd::TraceAPI, CMVMI, GSN_TEST_ORD, TestOrd::SignalLength); + TestOrd* const testOrd = CAST_PTR(TestOrd, ssig.getDataPtrSend()); testOrd->clear(); testOrd->setTestCommand(TestOrd::Off); - signal->set(TestOrd::TraceAPI, CMVMI, GSN_TEST_ORD, TestOrd::SignalLength); - result = sendSignal(processId, NO_WAIT, signal, true); - if (result == -1) { - return SEND_OR_RECEIVE_FAILED; - } - - return 0; + return ss.sendSignal(nodeId, &ssig) == SEND_OK ? 0 : SEND_OR_RECEIVE_FAILED; } @@ -1805,7 +1433,7 @@ MgmtSrvr::stopSignalTracing(int processId) *****************************************************************************/ int -MgmtSrvr::dumpState(int processId, const char* args) +MgmtSrvr::dumpState(int nodeId, const char* args) { // Convert the space separeted args // string to an int array @@ -1827,29 +1455,20 @@ MgmtSrvr::dumpState(int processId, const char* args) } } - return dumpState(processId, args_array, numArgs); + return dumpState(nodeId, args_array, numArgs); } int -MgmtSrvr::dumpState(int processId, const Uint32 args[], Uint32 no) +MgmtSrvr::dumpState(int nodeId, const Uint32 args[], Uint32 no) { - int result; - - result = okToSendTo(processId, true); - if (result != 0) { - return result; - } - - NdbApiSignal* signal = getSignal(); - if (signal == NULL) { - return COULD_NOT_ALLOCATE_MEMORY; - } + INIT_SIGNAL_SENDER(ss,nodeId); const Uint32 len = no > 25 ? 25 : no; + SimpleSignal ssig; DumpStateOrd * const dumpOrd = - CAST_PTR(DumpStateOrd, signal->getDataPtrSend()); - signal->set(TestOrd::TraceAPI, CMVMI, GSN_DUMP_STATE_ORD, len); + CAST_PTR(DumpStateOrd, ssig.getDataPtrSend()); + ssig.set(ss,TestOrd::TraceAPI, CMVMI, GSN_DUMP_STATE_ORD, len); for(Uint32 i = 0; i<25; i++){ if (i < len) dumpOrd->args[i] = args[i]; @@ -1857,12 +1476,7 @@ MgmtSrvr::dumpState(int processId, const Uint32 args[], Uint32 no) dumpOrd->args[i] = 0; } - result = sendSignal(processId, NO_WAIT, signal, true); - if (result == -1) { - return SEND_OR_RECEIVE_FAILED; - } - - return 0; + return ss.sendSignal(nodeId, &ssig) == SEND_OK ? 0 : SEND_OR_RECEIVE_FAILED; } @@ -1895,42 +1509,18 @@ MgmtSrvr::handleReceivedSignal(NdbApiSignal* signal) int gsn = signal->readSignalNumber(); switch (gsn) { - case GSN_API_VERSION_CONF: { - if (theWaitState == WAIT_VERSION) { - const ApiVersionConf * const conf = - CAST_CONSTPTR(ApiVersionConf, signal->getDataPtr()); - if(m_versionRec.callback != 0) - m_versionRec.callback(conf->nodeId, conf->version, this, 0); - else { - m_versionRec.version[conf->nodeId]=conf->version; - } - } else return; - theWaitState = NO_WAIT; - } - break; - case GSN_EVENT_SUBSCRIBE_CONF: break; - + case GSN_EVENT_SUBSCRIBE_REF: + break; case GSN_EVENT_REP: eventReport(refToNode(signal->theSendersBlockRef), signal->getDataPtr()); break; - case GSN_STOP_REF:{ - const StopRef * const ref = CAST_CONSTPTR(StopRef, signal->getDataPtr()); - const NodeId nodeId = refToNode(signal->theSendersBlockRef); - handleStopReply(nodeId, ref->errorCode); - return; - } + case GSN_NF_COMPLETEREP: break; - - case GSN_MGM_LOCK_CONFIG_REP: - case GSN_MGM_LOCK_CONFIG_REQ: - case GSN_MGM_UNLOCK_CONFIG_REP: - case GSN_MGM_UNLOCK_CONFIG_REQ: { - m_signalRecvQueue.receive(new NdbApiSignal(*signal)); + case GSN_NODE_FAILREP: break; - } default: g_eventLogger.error("Unknown signal received. SignalNumber: " @@ -1945,75 +1535,6 @@ MgmtSrvr::handleReceivedSignal(NdbApiSignal* signal) } } -/** - * A database node was either stopped or there was some error - */ -void -MgmtSrvr::handleStopReply(NodeId nodeId, Uint32 errCode) -{ - /** - * If we are in single user mode and get a stop reply from a - * DB node, then we have had a node crash. - * If all DB nodes are gone, and we are still in single user mode, - * the set m_stopRec.singleUserMode = false; - */ - if(m_stopRec.singleUserMode) { - ClusterMgr::Node node; - bool failure = true; - for(Uint32 i = 0; itheClusterMgr->getNodeInfo(i); - if((node.m_state.startLevel == NodeState::SL_NOTHING)) - failure = true; - else - failure = false; - } - } - if(failure) { - m_stopRec.singleUserMode = false; - } - } - if(m_stopRec.inUse == false) - return; - - if(!(m_stopRec.nodeId == 0 || m_stopRec.nodeId == nodeId)) - goto error; - - if(m_stopRec.sentCount <= 0) - goto error; - - if(!(theWaitState == WAIT_STOP || m_stopRec.callback != 0)) - goto error; - - if(errCode != 0) - m_stopRec.reply = translateStopRef(errCode); - - m_stopRec.sentCount --; - if(m_stopRec.sentCount == 0){ - if(theWaitState == WAIT_STOP){ - theWaitState = NO_WAIT; - NdbCondition_Signal(theMgmtWaitForResponseCondPtr); - return; - } - if(m_stopRec.callback != 0){ - m_stopRec.inUse = false; - StopCallback callback = m_stopRec.callback; - m_stopRec.callback = NULL; - (* callback)(m_stopRec.nodeId, - m_stopRec.anyData, - m_stopRec.reply); - return; - } - } - return; - - error: - if(errCode != 0){ - g_eventLogger.error("Unexpected signal received. SignalNumber: %i from %d", - GSN_STOP_REF, nodeId); - } -} - void MgmtSrvr::handleStatus(NodeId nodeId, bool alive, bool nfComplete) { @@ -2027,16 +1548,8 @@ MgmtSrvr::handleStatus(NodeId nodeId, bool alive, bool nfComplete) theData[0] = EventReport::Disconnected; if(nfComplete) { - handleStopReply(nodeId, 0); DBUG_VOID_RETURN; } - - if(theWaitNode == nodeId && - theWaitState != NO_WAIT && theWaitState != WAIT_STOP) - { - theWaitState = WAIT_NODEFAILURE; - NdbCondition_Signal(theMgmtWaitForResponseCondPtr); - } } eventReport(_ownNodeId, theData); @@ -2381,6 +1894,7 @@ MgmtSrvr::eventReport(NodeId nodeId, const Uint32 * theData) /*************************************************************************** * Backup ***************************************************************************/ + int MgmtSrvr::startBackup(Uint32& backupId, int waitCompleted) { @@ -2395,7 +1909,6 @@ MgmtSrvr::startBackup(Uint32& backupId, int waitCompleted) if(!next) return NO_CONTACT_WITH_DB_NODES; SimpleSignal ssig; - BackupReq* req = CAST_PTR(BackupReq, ssig.getDataPtrSend()); ssig.set(ss, TestOrd::TraceAPI, BACKUP, GSN_BACKUP_REQ, BackupReq::SignalLength); @@ -2410,8 +1923,7 @@ MgmtSrvr::startBackup(Uint32& backupId, int waitCompleted) while (1) { if (do_send) { - SendStatus result = ss.sendSignal(nodeId, &ssig); - if (result != SEND_OK) { + if (ss.sendSignal(nodeId, &ssig) != SEND_OK) { return SEND_OR_RECEIVE_FAILED; } if (waitCompleted == 0) @@ -2516,13 +2028,13 @@ MgmtSrvr::startBackup(Uint32& backupId, int waitCompleted) return SEND_OR_RECEIVE_FAILED; } } - - return 0; } int MgmtSrvr::abortBackup(Uint32 backupId) { + SignalSender ss(theFacade); + bool next; NodeId nodeId = 0; while((next = getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)) == true && @@ -2532,25 +2044,17 @@ MgmtSrvr::abortBackup(Uint32 backupId) return NO_CONTACT_WITH_DB_NODES; } - NdbApiSignal* signal = getSignal(); - if (signal == NULL) { - return COULD_NOT_ALLOCATE_MEMORY; - } + SimpleSignal ssig; - AbortBackupOrd* ord = CAST_PTR(AbortBackupOrd, signal->getDataPtrSend()); - signal->set(TestOrd::TraceAPI, BACKUP, GSN_ABORT_BACKUP_ORD, - AbortBackupOrd::SignalLength); + AbortBackupOrd* ord = CAST_PTR(AbortBackupOrd, ssig.getDataPtrSend()); + ssig.set(ss, TestOrd::TraceAPI, BACKUP, GSN_ABORT_BACKUP_ORD, + AbortBackupOrd::SignalLength); ord->requestType = AbortBackupOrd::ClientAbort; ord->senderData = 19; ord->backupId = backupId; - int result = sendSignal(nodeId, NO_WAIT, signal, true); - if (result == -1) { - return SEND_OR_RECEIVE_FAILED; - } - - return 0; + return ss.sendSignal(nodeId, &ssig) == SEND_OK ? 0 : SEND_OR_RECEIVE_FAILED; } @@ -2724,11 +2228,6 @@ MgmtSrvr::setDbParameter(int node, int param, const char * value, return 0; } -template class Vector; -#if __SUNPRO_CC != 0x560 -template bool SignalQueue::waitFor(Vector&, SigMatch**, NdbApiSignal**, unsigned); -#endif - template class MutexVector; template class MutexVector; template class MutexVector; diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index f8c244a1bf1..0ed8a816e0d 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -22,11 +22,11 @@ #include #include - +#include +#include #include #include #include -#include "SignalQueue.hpp" #include #include #include @@ -213,17 +213,6 @@ public: // COULD_NOT_ALLOCATE_MEMORY, SEND_OR_RECEIVE_FAILED - typedef void (* StopCallback)(int nodeId, void * anyData, int errorCode); - - typedef void (* VersionCallback)(int nodeId, int version, - void * anyData, int errorCode); - - - typedef void (* EnterSingleCallback)(int nodeId, void * anyData, - int errorCode); - typedef void (* ExitSingleCallback)(int nodeId, void * anyData, - int errorCode); - /** * Lock configuration */ @@ -272,12 +261,12 @@ public: * @param processId: Id of the DB process to stop * @return 0 if succeeded, otherwise: as stated above, plus: */ - int stopNode(int nodeId, bool abort = false, StopCallback = 0, void *any= 0); + int stopNode(int nodeId, bool abort = false); /** * Stop the system */ - int stop(int * cnt = 0, bool abort = false, StopCallback = 0, void *any = 0); + int stop(int * cnt = 0, bool abort = false); /** * print version info about a node @@ -285,27 +274,18 @@ public: * @param processId: Id of the DB process to stop * @return 0 if succeeded, otherwise: as stated above, plus: */ - int versionNode(int nodeId, bool abort = false, - VersionCallback = 0, void *any= 0); + int versionNode(int nodeId, Uint32 &version); - /** - * print version info about all node in the system - */ - int version(int * cnt = 0, bool abort = false, - VersionCallback = 0, void *any = 0); - /** * Maintenance on the system */ - int enterSingleUser(int * cnt = 0, Uint32 singleuserNodeId = 0, - EnterSingleCallback = 0, void *any = 0); + int enterSingleUser(int * cnt = 0, Uint32 singleuserNodeId = 0); /** * Resume from maintenance on the system */ - int exitSingleUser(int * cnt = 0, bool abort = false, - ExitSingleCallback = 0, void *any = 0); + int exitSingleUser(int * cnt = 0, bool abort = false); /** * Start DB process. @@ -319,15 +299,14 @@ public: * @param processId: Id of the DB process to start */ int restartNode(int processId, bool nostart, bool initialStart, - bool abort = false, - StopCallback = 0, void * anyData = 0); + bool abort = false); /** * Restart the system */ int restart(bool nostart, bool initialStart, bool abort = false, - int * stopCount = 0, StopCallback = 0, void * anyData = 0); + int * stopCount = 0); struct BackupEvent { enum Event { @@ -518,7 +497,17 @@ private: //************************************************************************** int setEventReportingLevel(int processId, LogLevel::EventCategory, Uint32); - + void set_common_stop_req_params(void *stopReq); + + int sendSTOP_REQ(NodeId nodeId, + NodeBitmask &stoppedNodes, + Uint32 singleUserNodeId, + bool abort, + bool stop, + bool restart, + bool nostart, + bool initialStart); + /** * Check if it is possible to send a signal to a (DB) process * @@ -608,59 +597,8 @@ private: enum WaitSignalType { NO_WAIT, // We don't expect to receive any signal WAIT_SET_VAR, // Accept SET_VAR_CONF and SET_VAR_REF - WAIT_SUBSCRIBE_CONF, // Accept event subscription confirmation - WAIT_STOP, - WAIT_BACKUP_STARTED, - WAIT_BACKUP_COMPLETED, - WAIT_VERSION, - WAIT_NODEFAILURE + WAIT_SUBSCRIBE_CONF // Accept event subscription confirmation }; - - /** - * Get an unused signal - * @return A signal if succeeded, NULL otherwise - */ - NdbApiSignal* getSignal(); - - /** - * Add a signal to the list of unused signals - * @param signal: The signal to add - */ - void releaseSignal(NdbApiSignal* signal); - - /** - * Remove a signal from the list of unused signals and delete - * the memory for it. - */ - void freeSignal(); - - /** - * Send a signal - * @param processId: Id of the receiver process - * @param waitState: State denoting a set of signals we accept to receive - * @param signal: The signal to send - * @return 0 if succeeded, -1 otherwise - */ - int sendSignal(Uint16 processId, WaitSignalType waitState, - NdbApiSignal* signal, bool force = false); - - /** - * Send a signal and wait for an answer signal - * @param processId: Id of the receiver process - * @param waitState: State denoting a set of signals we accept to receive. - * @param signal: The signal to send - * @return 0 if succeeded, -1 otherwise (for example failed to send or - * failed to receive expected signal). - */ - int sendRecSignal(Uint16 processId, WaitSignalType waitState, - NdbApiSignal* signal, bool force = false, - int waitTime = WAIT_FOR_RESPONSE_TIMEOUT); - - /** - * Wait for a signal to arrive. - * @return 0 if signal arrived, -1 otherwise - */ - int receiveOptimisedResponse(int waitTime); /** * This function is called from "outside" of MgmtSrvr @@ -671,7 +609,7 @@ private: static void signalReceivedNotification(void* mgmtSrvr, NdbApiSignal* signal, struct LinearSectionPtr ptr[3]); - + /** * Called from "outside" of MgmtSrvr when a DB process has died. * @param mgmtSrvr: The MgmtSrvr object wreceiveOptimisedResponsehich @@ -708,31 +646,7 @@ private: class TransporterFacade * theFacade; - class SignalQueue m_signalRecvQueue; - - struct StopRecord { - StopRecord(){ inUse = false; callback = 0; singleUserMode = false;} - bool inUse; - bool singleUserMode; - int sentCount; - int reply; - int nodeId; - void * anyData; - StopCallback callback; - }; - StopRecord m_stopRec; - - struct VersionRecord { - VersionRecord(){ inUse = false; callback = 0;} - bool inUse; - Uint32 version[MAX_NODES]; - VersionCallback callback; - }; - VersionRecord m_versionRec; - int sendVersionReq( int processId); - - - void handleStopReply(NodeId nodeId, Uint32 errCode); + int sendVersionReq( int processId, Uint32 &version); int translateStopRef(Uint32 errCode); bool _isStopThread; @@ -753,14 +667,8 @@ private: static void *logLevelThread_C(void *); void logLevelThreadRun(); - struct NdbThread *m_signalRecvThread; - static void *signalRecvThread_C(void *); - void signalRecvThreadRun(); - Config *_props; - int send(class NdbApiSignal* signal, Uint32 node, Uint32 node_type); - ConfigRetriever *m_config_retriever; }; diff --git a/ndb/src/mgmsrv/MgmtSrvrConfig.cpp b/ndb/src/mgmsrv/MgmtSrvrConfig.cpp index 6c4b4e9ae3c..acf7ccbfd4c 100644 --- a/ndb/src/mgmsrv/MgmtSrvrConfig.cpp +++ b/ndb/src/mgmsrv/MgmtSrvrConfig.cpp @@ -23,6 +23,8 @@ #include #include +#if 0 // code must be rewritten to use SignalSender + void MgmtSrvr::handle_MGM_LOCK_CONFIG_REQ(NdbApiSignal *signal) { NodeId sender = refToNode(signal->theSendersBlockRef); @@ -221,6 +223,8 @@ MgmtSrvr::unlockConf(bool commit) { return result; } +#endif // code must be rewritten to use SignalSender + /** * Commit the new configuration */ diff --git a/ndb/src/mgmsrv/MgmtSrvrGeneralSignalHandling.cpp b/ndb/src/mgmsrv/MgmtSrvrGeneralSignalHandling.cpp index f93948abc75..c99936e1861 100644 --- a/ndb/src/mgmsrv/MgmtSrvrGeneralSignalHandling.cpp +++ b/ndb/src/mgmsrv/MgmtSrvrGeneralSignalHandling.cpp @@ -20,123 +20,3 @@ // Some kind of reuse should be preferred. //****************************************************************************** -#include "MgmtSrvr.hpp" -#include -#include - - -NdbApiSignal* -MgmtSrvr::getSignal() -{ - NdbApiSignal* tSignal; - tSignal = theSignalIdleList; - if (tSignal != NULL){ - NdbApiSignal* tSignalNext = tSignal->next(); - tSignal->next(NULL); - theSignalIdleList = tSignalNext; - return tSignal; - } else - { - tSignal = new NdbApiSignal(_ownReference); - if (tSignal != NULL) - tSignal->next(NULL); - } - return tSignal; -} - - -void -MgmtSrvr::releaseSignal(NdbApiSignal* aSignal) -{ - aSignal->next(theSignalIdleList); - theSignalIdleList = aSignal; -} - - -void -MgmtSrvr::freeSignal() -{ - NdbApiSignal* tSignal = theSignalIdleList; - theSignalIdleList = tSignal->next(); - delete tSignal; -} - - -int -MgmtSrvr::sendSignal(Uint16 aNodeId, - WaitSignalType aWaitState, - NdbApiSignal* aSignal, - bool force) -{ - int tReturnCode; - theFacade->lock_mutex(); - if(force){ - tReturnCode = theFacade->sendSignalUnCond(aSignal, - aNodeId); - } else { - tReturnCode = theFacade->sendSignal(aSignal, - aNodeId); - } - releaseSignal(aSignal); - if (tReturnCode == -1) { - theFacade->unlock_mutex(); - return -1; - } - theWaitState = aWaitState; - theFacade->unlock_mutex(); - return 0; -} - - -int -MgmtSrvr::sendRecSignal(Uint16 aNodeId, - WaitSignalType aWaitState, - NdbApiSignal* aSignal, - bool force, - int waitTime) -{ - int tReturnCode; - theFacade->lock_mutex(); - if(force){ - tReturnCode = theFacade->sendSignalUnCond(aSignal, aNodeId); - } else { - tReturnCode = theFacade->sendSignalUnCond(aSignal, aNodeId); - } - releaseSignal(aSignal); - if (tReturnCode == -1) { - theFacade->unlock_mutex(); - return -1; - } - theWaitState = aWaitState; - theWaitNode = aNodeId; - return receiveOptimisedResponse(waitTime); -} - - -int -MgmtSrvr::receiveOptimisedResponse(int waitTime) -{ - int tResultCode; - theFacade->checkForceSend(_blockNumber); - NDB_TICKS maxTime = NdbTick_CurrentMillisecond() + waitTime; - - while (theWaitState != NO_WAIT && theWaitState != WAIT_NODEFAILURE - && waitTime > 0) { - NdbCondition_WaitTimeout(theMgmtWaitForResponseCondPtr, - theFacade->theMutexPtr, - waitTime); - if(theWaitState == NO_WAIT || theWaitState == WAIT_NODEFAILURE) - break; - waitTime = (maxTime - NdbTick_CurrentMillisecond()); - }//while - - if(theWaitState == NO_WAIT) { - tResultCode = 0; - } else { - tResultCode = -1; - } - theFacade->unlock_mutex(); - return tResultCode; -} - - diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 46bfb531b61..a6e418b43a1 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -1203,7 +1203,11 @@ MgmApiSession::setLogFilter(Parser_t::Context &ctx, void MgmApiSession::configLock(Parser_t::Context &, Properties const &) { +#if 0 // not implemented int ret = m_mgmsrv.lockConf(); +#else + int ret = -1; +#endif m_output->println("config lock reply"); m_output->println("result: %d", ret); m_output->println(""); @@ -1214,7 +1218,11 @@ MgmApiSession::configUnlock(Parser_t::Context &, Properties const &args) { Uint32 commit; args.get("commit", &commit); +#if 0 // not implemented int ret = m_mgmsrv.unlockConf(commit == 1); +#else + int ret = -1; +#endif m_output->println("config unlock reply"); m_output->println("result: %d", ret); m_output->println(""); From a100123ab3f93afa9a65c19893895c596aacbac7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Sep 2005 22:51:44 +0200 Subject: [PATCH 008/225] adopted to corrected ndb SendSignal Node failrep --- ndb/src/mgmsrv/MgmtSrvr.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index dab99cb83db..b525d14cc2f 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -765,7 +765,7 @@ MgmtSrvr::sendVersionReq(int v_nodeId, Uint32 &version) case GSN_NODE_FAILREP:{ const NodeFailRep * const rep = CAST_CONSTPTR(NodeFailRep, signal->getDataPtr()); - if (rep->failNo == nodeId) + if (NodeBitmask::get(rep->theNodes,nodeId)) do_send = 1; // retry with other node continue; } @@ -894,14 +894,23 @@ int MgmtSrvr::sendSTOP_REQ(NodeId nodeId, case GSN_NODE_FAILREP:{ const NodeFailRep * const rep = CAST_CONSTPTR(NodeFailRep, signal->getDataPtr()); + NodeBitmask failedNodes; + failedNodes.assign(NodeBitmask::Size, rep->theNodes); #ifdef VM_TRACE - ndbout_c("Node %d failed", rep->failNo); -#endif - if (nodes.get(rep->failNo)) { - nodes.clear(rep->failNo); + ndbout << "Failed nodes:"; + for (unsigned i = 0; i < 32*NodeBitmask::Size; i++) + if(failedNodes.get(i)) + ndbout << " " << i; + ndbout << endl; + } +#endif + failedNodes.bitAND(nodes); + if (!failedNodes.isclear()) + { + nodes.bitANDC(failedNodes); // clear the failed nodes if (singleUserNodeId == 0) - stoppedNodes.set(rep->failNo); + stoppedNodes.bitOR(failedNodes); } break; } @@ -1244,7 +1253,7 @@ MgmtSrvr::setEventReportingLevelImpl(int nodeId, case GSN_NODE_FAILREP:{ const NodeFailRep * const rep = CAST_CONSTPTR(NodeFailRep, signal->getDataPtr()); - if (rep->failNo == nodeId) + if (NodeBitmask::get(rep->theNodes,nodeId)) return SEND_OR_RECEIVE_FAILED; break; } From 03a5e223affe9b3cb475657e2d76c15a76b00cf6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 13 Sep 2005 00:22:06 +0200 Subject: [PATCH 009/225] corrected prev patch on ndb_mgmd usage of SignalSender --- ndb/src/mgmsrv/MgmtSrvr.cpp | 17 ++++++++++++++--- ndb/src/mgmsrv/MgmtSrvr.hpp | 5 +++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 9c81dfd9445..e00140dbdb2 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -1227,9 +1227,7 @@ MgmtSrvr::setEventReportingLevelImpl(int nodeId, EventSubscribeReq::SignalLength); *dst = ll; - if (ss.sendSignal(nodeId, &ssig) != SEND_OK) { - return SEND_OR_RECEIVE_FAILED; - } + send(ss,ssig,nodeId,NODE_TYPE_DB); #if 0 while (1) @@ -1283,6 +1281,19 @@ MgmtSrvr::setNodeLogLevelImpl(int nodeId, const SetLogLevelOrd & ll) return ss.sendSignal(nodeId, &ssig) == SEND_OK ? 0 : SEND_OR_RECEIVE_FAILED; } +int +MgmtSrvr::send(SignalSender &ss, SimpleSignal &ssig, Uint32 node, Uint32 node_type){ + Uint32 max = (node == 0) ? MAX_NODES : node + 1; + + for(; node < max; node++){ + while(nodeTypes[node] != (int)node_type && node < max) node++; + if(nodeTypes[node] != (int)node_type) + break; + ss.sendSignal(node, &ssig); + } + return 0; +} + //**************************************************************************** //**************************************************************************** diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index 0ed8a816e0d..5a29d820d6e 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -31,6 +31,8 @@ #include #include +#include + /** * @desc Block number for Management server. * @todo This should probably be somewhere else. I don't know where atm. @@ -496,8 +498,7 @@ public: private: //************************************************************************** - int setEventReportingLevel(int processId, LogLevel::EventCategory, Uint32); - void set_common_stop_req_params(void *stopReq); + int send(SignalSender &ss, SimpleSignal &ssig, Uint32 node, Uint32 node_type); int sendSTOP_REQ(NodeId nodeId, NodeBitmask &stoppedNodes, From da5ffc732cae26712a504874e4c4f3f60309d4a4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Sep 2005 16:28:19 +1000 Subject: [PATCH 010/225] WL#2779 ndb_size.pl Bug reported by Adam Dixon - table name needs quoting. ndb/tools/ndb_size.pl: Always quote the table and database names when sending to cluster. --- ndb/tools/ndb_size.pl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ndb/tools/ndb_size.pl b/ndb/tools/ndb_size.pl index 92ecf5ca784..64a20423636 100644 --- a/ndb/tools/ndb_size.pl +++ b/ndb/tools/ndb_size.pl @@ -68,8 +68,9 @@ foreach(@{$tables}) { my $table= @{$_}[0]; my @columns; - my $info= $dbh->selectall_hashref("describe $table","Field"); - my @count = $dbh->selectrow_array("select count(*) from $table"); + my $info= $dbh->selectall_hashref("describe ".$dbh->quote($table),"Field"); + my @count = $dbh->selectrow_array("select count(*) from " + .$dbh->quote($table)); my %columnsize; # used for index calculations # We now work out the DataMemory usage @@ -129,7 +130,9 @@ foreach(@{$tables}) elsif($type =~ /varchar/ || $type =~ /varbinary/) { my $fixed= 1+$size; - my @dynamic=$dbh->selectrow_array("select avg(length($name)) from $table"); + my @dynamic=$dbh->selectrow_array("select avg(length(" + .$dbh->quote($name) + .")) from ".$dbh->quote($table)); $dynamic[0]=0 if !$dynamic[0]; @realsize= ($fixed,$fixed,ceil($dynamic[0])); } @@ -163,7 +166,7 @@ foreach(@{$tables}) # we can still connect to pre-5.0 mysqlds. my %indexes; { - my $sth= $dbh->prepare("show index from $table"); + my $sth= $dbh->prepare("show index from "$dbh->quote($table)); $sth->execute; while(my $i = $sth->fetchrow_hashref) { From f89424f8b69d50fb26c0af3d226ac20afe2a32da Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Sep 2005 06:31:38 -0600 Subject: [PATCH 011/225] fix for BUG#11139 (multi-delete with alias breaking replication if table rules are present): the problem originally was that the tables in auxilliary_tables did not have the correct real_name, which caused problems in the second call to tables_ok(). The fix corrects the real_name problem, and also sets the updating flag properly, which makes the second call to tables_ok() unnecessary. mysql-test/r/rpl_multi_delete2.result: updates for for BUG#11139 mysql-test/t/rpl_multi_delete2-slave.opt: updates for for BUG#11139 mysql-test/t/rpl_multi_delete2.test: updates for for BUG#11139 sql/mysql_priv.h: fix for BUG#11139 (multi-delete with alias breaking replication if table rules are present) sql/slave.cc: fix for BUG#11139 (multi-delete with alias breaking replication if table rules are present) sql/sql_parse.cc: fix for BUG#11139 (multi-delete with alias breaking replication if table rules are present) sql/sql_yacc.yy: fix for BUG#11139 (multi-delete with alias breaking replication if table rules are present) --- mysql-test/r/rpl_multi_delete2.result | 29 ++++++++++++-- mysql-test/t/rpl_multi_delete2-slave.opt | 2 +- mysql-test/t/rpl_multi_delete2.test | 45 ++++++++++++++++++++- sql/mysql_priv.h | 2 + sql/slave.cc | 9 +---- sql/sql_parse.cc | 50 ++++++++++++++++++------ sql/sql_yacc.yy | 10 ++--- 7 files changed, 117 insertions(+), 30 deletions(-) diff --git a/mysql-test/r/rpl_multi_delete2.result b/mysql-test/r/rpl_multi_delete2.result index c6c088111fc..73db9f62eb4 100644 --- a/mysql-test/r/rpl_multi_delete2.result +++ b/mysql-test/r/rpl_multi_delete2.result @@ -4,6 +4,26 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +set sql_log_bin=0; +create database mysqltest_from; +set sql_log_bin=1; +create database mysqltest_to; +use mysqltest_from; +drop table if exists a; +CREATE TABLE a (i INT); +INSERT INTO a VALUES(1); +DELETE alias FROM a alias WHERE alias.i=1; +SELECT * FROM a; +i +insert into a values(2),(3); +delete a alias FROM a alias where alias.i=2; +select * from a; +i +3 +use mysqltest_to; +select * from a; +i +3 create table t1 (a int); create table t2 (a int); insert into t1 values (1); @@ -15,7 +35,10 @@ select * from t2; a 1 select * from t1; -ERROR 42S02: Table 'test.t1' doesn't exist +ERROR 42S02: Table 'mysqltest_to.t1' doesn't exist select * from t2; -ERROR 42S02: Table 'test.t2' doesn't exist -drop table t1,t2; +ERROR 42S02: Table 'mysqltest_to.t2' doesn't exist +set sql_log_bin=0; +drop database mysqltest_from; +set sql_log_bin=1; +drop database mysqltest_to; diff --git a/mysql-test/t/rpl_multi_delete2-slave.opt b/mysql-test/t/rpl_multi_delete2-slave.opt index b828d03fafb..0febb2891b1 100644 --- a/mysql-test/t/rpl_multi_delete2-slave.opt +++ b/mysql-test/t/rpl_multi_delete2-slave.opt @@ -1 +1 @@ ---replicate-wild-ignore-table=test.% +"--replicate-rewrite-db=mysqltest_from->mysqltest_to" --replicate-do-table=mysqltest_to.a diff --git a/mysql-test/t/rpl_multi_delete2.test b/mysql-test/t/rpl_multi_delete2.test index 62d95a3a90f..c50311de363 100644 --- a/mysql-test/t/rpl_multi_delete2.test +++ b/mysql-test/t/rpl_multi_delete2.test @@ -1,4 +1,41 @@ +#multi delete replication bugs + + source include/master-slave.inc; + +#BUG#11139 - improper wild-table and table rules +#checking for multi deletes with an alias + +connection master; +set sql_log_bin=0; +create database mysqltest_from; +set sql_log_bin=1; + +connection slave; +create database mysqltest_to; + + +connection master; +use mysqltest_from; +--disable_warnings +drop table if exists a; +--enable_warnings +CREATE TABLE a (i INT); +INSERT INTO a VALUES(1); +DELETE alias FROM a alias WHERE alias.i=1; +SELECT * FROM a; +insert into a values(2),(3); +delete a alias FROM a alias where alias.i=2; +select * from a; +save_master_pos; +connection slave; + +use mysqltest_to; +sync_with_master; +select * from a; + +# BUG#3461 +connection master; create table t1 (a int); create table t2 (a int); @@ -19,7 +56,13 @@ select * from t1; error 1146; select * from t2; +# cleanup connection master; -drop table t1,t2; +set sql_log_bin=0; +drop database mysqltest_from; +set sql_log_bin=1; +connection slave; +drop database mysqltest_to; # End of 4.1 tests + diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 0d889aaf0b1..32c5861028e 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -59,6 +59,7 @@ void kill_one_thread(THD *thd, ulong id); bool net_request_file(NET* net, const char* fname); char* query_table_status(THD *thd,const char *db,const char *table_name); + #define x_free(A) { my_free((gptr) (A),MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR)); } #define safeFree(x) { if(x) { my_free((gptr) x,MYF(0)); x = NULL; } } #define PREV_BITS(type,A) ((type) (((type) 1 << (A)) -1)) @@ -464,6 +465,7 @@ void mysql_reset_thd_for_next_command(THD *thd); bool mysql_new_select(LEX *lex, bool move_down); void create_select_for_variable(const char *var_name); void mysql_init_multi_delete(LEX *lex); +void fix_multi_delete_lex(LEX* lex); void init_max_user_conn(void); void init_update_queries(void); void free_max_user_conn(void); diff --git a/sql/slave.cc b/sql/slave.cc index 9ff7a432b89..1be3e3b4a17 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -746,14 +746,7 @@ static TABLE_RULE_ENT* find_wild(DYNAMIC_ARRAY *a, const char* key, int len) rules (see code below). For that reason, users should not set conflicting rules because they may get unpredicted results (precedence order is explained in the manual). - If no table of the list is marked "updating" (so far this can only happen - if the statement is a multi-delete (SQLCOM_DELETE_MULTI) and the "tables" - is the tables in the FROM): then we always return 0, because there is no - reason we play this statement on this slave if it updates nothing. In the - case of SQLCOM_DELETE_MULTI, there will be a second call to tables_ok(), - with tables having "updating==TRUE" (those after the DELETE), so this - second call will make the decision (because - all_tables_not_ok() = !tables_ok(1st_list) && !tables_ok(2nd_list)). + RETURN VALUES 0 should not be logged/replicated diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 76d4c5c27dc..89f166aca8e 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -59,6 +59,9 @@ static void remove_escape(char *name); static void refresh_status(void); static bool append_file_to_dir(THD *thd, const char **filename_ptr, const char *table_name); + +static TABLE_LIST* get_table_by_alias(TABLE_LIST* tl, const char* db, + const char* alias); const char *any_db="*any*"; // Special symbol for check_access @@ -125,10 +128,7 @@ static bool end_active_trans(THD *thd) */ inline bool all_tables_not_ok(THD *thd, TABLE_LIST *tables) { - return (table_rules_on && tables && !tables_ok(thd,tables) && - ((thd->lex->sql_command != SQLCOM_DELETE_MULTI) || - !tables_ok(thd, - (TABLE_LIST *)thd->lex->auxilliary_table_list.first))); + return (table_rules_on && tables && !tables_ok(thd,tables)); } #endif @@ -4248,6 +4248,40 @@ void create_select_for_variable(const char *var_name) DBUG_VOID_RETURN; } +static TABLE_LIST* get_table_by_alias(TABLE_LIST* tl, const char* db, + const char* alias) +{ + for (;tl;tl= tl->next) + { + if (!strcmp(db,tl->db) && + tl->alias && !my_strcasecmp(table_alias_charset,tl->alias,alias)) + return tl; + } + + return 0; +} + +/* Sets up lex->auxilliary_table_list */ +void fix_multi_delete_lex(LEX* lex) +{ + TABLE_LIST *tl; + TABLE_LIST *good_list= (TABLE_LIST*)lex->select_lex.table_list.first; + + for (tl= (TABLE_LIST*)lex->auxilliary_table_list.first; tl; tl= tl->next) + { + TABLE_LIST* good_table= get_table_by_alias(good_list,tl->db,tl->alias); + if (good_table && !good_table->derived) + { + /* + real_name points to a member of Table_ident which is + allocated via thd->strmake() from THD memroot + */ + tl->real_name= good_table->real_name; + tl->real_name_length= good_table->real_name_length; + good_table->updating= tl->updating; + } + } +} void mysql_init_multi_delete(LEX *lex) { @@ -5570,13 +5604,7 @@ int multi_delete_precheck(THD *thd, TABLE_LIST *tables, uint *table_count) (*table_count)++; /* All tables in aux_tables must be found in FROM PART */ TABLE_LIST *walk; - for (walk= delete_tables; walk; walk= walk->next) - { - if (!my_strcasecmp(table_alias_charset, - target_tbl->alias, walk->alias) && - !strcmp(walk->db, target_tbl->db)) - break; - } + walk= get_table_by_alias(delete_tables,target_tbl->db,target_tbl->alias); if (!walk) { my_error(ER_UNKNOWN_TABLE, MYF(0), target_tbl->real_name, diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 6283cad7cc8..e29aaac8f94 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -4295,12 +4295,10 @@ single_multi: } where_clause opt_order_clause delete_limit_clause {} - | table_wild_list - { mysql_init_multi_delete(Lex); } - FROM join_table_list where_clause - | FROM table_wild_list - { mysql_init_multi_delete(Lex); } - USING join_table_list where_clause + | table_wild_list {mysql_init_multi_delete(Lex);} + FROM join_table_list {fix_multi_delete_lex(Lex);} where_clause + | FROM table_wild_list { mysql_init_multi_delete(Lex);} + USING join_table_list {fix_multi_delete_lex(Lex);} where_clause {} ; From f4e518881f9eab95d5c9da628509556d537fba3e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Sep 2005 21:47:24 -0700 Subject: [PATCH 012/225] Fix for Bug#3982 Added check for availability of multibyte characters and functions --- config/ac-macros/readline.m4 | 39 ++++++++++++++++++++++++++++++++++++ configure.in | 1 + 2 files changed, 40 insertions(+) diff --git a/config/ac-macros/readline.m4 b/config/ac-macros/readline.m4 index 79c6479d15d..e47d0a44483 100644 --- a/config/ac-macros/readline.m4 +++ b/config/ac-macros/readline.m4 @@ -59,3 +59,42 @@ AC_DEFUN([MYSQL_CHECK_NEW_RL_INTERFACE], [ ) ) ]) + +dnl +dnl check for availability of multibyte characters and functions +dnl (Based on BASH_CHECK_MULTIBYTE in aclocal.m4 of readline-5.0) +dnl +AC_DEFUN([MYSQL_CHECK_MULTIBYTE], +[ +AC_CHECK_HEADERS(wctype.h) +AC_CHECK_HEADERS(wchar.h) +AC_CHECK_HEADERS(langinfo.h) + +AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE([HAVE_MBSRTOWCS],[],[Define if you have mbsrtowcs])) +AC_CHECK_FUNC(mbrtowc, AC_DEFINE([HAVE_MBRTOWC],[],[Define if you have mbrtowc])) +AC_CHECK_FUNC(mbrlen, AC_DEFINE([HAVE_MBRLEN],[],[Define if you have mbrlen])) +AC_CHECK_FUNC(wctomb, AC_DEFINE([HAVE_WCTOMB],[],[Define if you have wctomb])) +AC_CHECK_FUNC(wcwidth, AC_DEFINE([HAVE_WCWIDTH],[],[Define if you have wcwidth])) +AC_CHECK_FUNC(wcsdup, AC_DEFINE([HAVE_WCSDUP],[],[Define if you check wcsdup])) + +AC_CACHE_CHECK([for mbstate_t], mysql_cv_have_mbstate_t, +[AC_TRY_COMPILE([ +#include ], [ + mbstate_t ps; + mbstate_t *psp; + psp = (mbstate_t *)0; +], mysql_cv_have_mbstate_t=yes, mysql_cv_have_mbstate_t=no)]) +if test $mysql_cv_have_mbstate_t = yes; then + AC_DEFINE([HAVE_MBSTATE_T],[],[Define if mysql_cv_have_mbstate_t=yes]) +fi + +AC_CACHE_CHECK([for nl_langinfo and CODESET], mysql_cv_langinfo_codeset, +[AC_TRY_LINK( +[#include ], +[char* cs = nl_langinfo(CODESET);], +mysql_cv_langinfo_codeset=yes, mysql_cv_langinfo_codeset=no)]) +if test $mysql_cv_langinfo_codeset = yes; then + AC_DEFINE([HAVE_LANGINFO_CODESET],[],[Define if mysql_cv_langinfo_codeset=yes]) +fi + +]) diff --git a/configure.in b/configure.in index 05aaaa73bfa..e3c9877c680 100644 --- a/configure.in +++ b/configure.in @@ -1820,6 +1820,7 @@ MYSQL_HAVE_TIOCSTAT MYSQL_STRUCT_DIRENT_D_INO MYSQL_STRUCT_DIRENT_D_NAMLEN MYSQL_TYPE_SIGHANDLER +MYSQL_CHECK_MULTIBYTE if test "$with_named_curses" = "no" then MYSQL_CHECK_LIB_TERMCAP From 84f029a448fc822f2fa150ab13e61b233b1e4027 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Sep 2005 22:29:07 +0300 Subject: [PATCH 013/225] WL#2787 (part 2, ver 3 (merged)) changed securety context switching libmysqld/lib_sql.cc: changed securety context switching mysql-test/r/rpl_sp.result: now it show real information from changed security context of SP (checked) sql/ha_innodb.cc: changed securety context switching sql/item.cc: changed securety context switching sql/item_func.cc: changed securety context switching sql/item_strfunc.cc: changed securety context switching sql/log.cc: changed securety context switching sql/mysql_priv.h: changed securety context switching sql/mysqld.cc: changed securety context switching sql/repl_failsafe.cc: changed securety context switching sql/set_var.cc: changed securety context switching sql/slave.cc: changed securety context switching sql/sp.cc: changed securety context switching sql/sp_head.cc: changed securety context switching in case of inability to switch context we return error now sql/sp_head.h: changed securety context switching sql/sql_acl.cc: changed securety context switching sql/sql_acl.h: changed securety context switching sql/sql_base.cc: changed securety context switching sql/sql_class.cc: changed securety context switching sql/sql_class.h: changed securety context switching sql/sql_db.cc: changed securety context switching sql/sql_insert.cc: changed securety context switching sql/sql_parse.cc: changed securety context switching sql/sql_show.cc: changed securety context switching sql/sql_trigger.cc: changed securety context switching sql/sql_view.cc: changed securety context switching sql/sql_yacc.yy: changed securety context switching --- libmysqld/lib_sql.cc | 7 +- mysql-test/r/rpl_sp.result | 2 +- sql/ha_innodb.cc | 16 ++- sql/item.cc | 4 +- sql/item_func.cc | 12 +- sql/item_strfunc.cc | 13 ++- sql/log.cc | 12 +- sql/mysql_priv.h | 3 +- sql/mysqld.cc | 8 +- sql/repl_failsafe.cc | 4 +- sql/set_var.cc | 17 +-- sql/slave.cc | 9 +- sql/sp.cc | 5 +- sql/sp_head.cc | 68 +++++------- sql/sp_head.h | 22 ++-- sql/sql_acl.cc | 187 ++++++++++++++++--------------- sql/sql_acl.h | 3 +- sql/sql_base.cc | 3 +- sql/sql_class.cc | 48 ++++++-- sql/sql_class.h | 41 +++++-- sql/sql_db.cc | 19 ++-- sql/sql_insert.cc | 11 +- sql/sql_parse.cc | 218 +++++++++++++++++++------------------ sql/sql_show.cc | 49 +++++---- sql/sql_trigger.cc | 2 +- sql/sql_view.cc | 15 ++- sql/sql_yacc.yy | 30 ++--- 27 files changed, 449 insertions(+), 379 deletions(-) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index a86d467299c..d6f41fda5f6 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -532,10 +532,9 @@ err: int check_embedded_connection(MYSQL *mysql) { THD *thd= (THD*)mysql->thd; - thd->host= (char*)my_localhost; - thd->host_or_ip= thd->host; - thd->user= my_strdup(mysql->user, MYF(0)); - thd->priv_user= thd->user; + st_security_context *sctx= thd->security_ctx; + sctx->host_or_ip= sctx->host= (char*)my_localhost; + sctx->priv_user= sctx->user= my_strdup(mysql->user, MYF(0)); return check_user(thd, COM_CONNECT, NULL, 0, thd->db, true); } diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/r/rpl_sp.result index 394f93f2ea0..b1f564a0791 100644 --- a/mysql-test/r/rpl_sp.result +++ b/mysql-test/r/rpl_sp.result @@ -121,7 +121,7 @@ call foo4(); Got one of the listed errors show warnings; Level Code Message -Error 1142 INSERT command denied to user 'zedjzlcsjhd'@'localhost' for table 't1' +Error 1142 INSERT command denied to user 'zedjzlcsjhd'@'127.0.0.1' for table 't1' Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes alter procedure foo4 sql security invoker; call foo4(); diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 4ed5fadb603..fd5db6da722 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -563,25 +563,29 @@ innobase_mysql_print_thd( use the default max length */ { const THD* thd; + const st_security_context *sctx; const char* s; thd = (const THD*) input_thd; + /* We probably want to have original user as part of debug output. */ + sctx = &thd->main_security_ctx; + fprintf(f, "MySQL thread id %lu, query id %lu", thd->thread_id, (ulong) thd->query_id); - if (thd->host) { + if (sctx->host) { putc(' ', f); - fputs(thd->host, f); + fputs(sctx->host, f); } - if (thd->ip) { + if (sctx->ip) { putc(' ', f); - fputs(thd->ip, f); + fputs(sctx->ip, f); } - if (thd->user) { + if (sctx->user) { putc(' ', f); - fputs(thd->user, f); + fputs(sctx->user, f); } if ((s = thd->proc_info)) { diff --git a/sql/item.cc b/sql/item.cc index df57c301327..45c12d3840f 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -3443,8 +3443,8 @@ bool Item_field::fix_fields(THD *thd, Item **reference) VIEW_ANY_ACL))) { my_error(ER_COLUMNACCESS_DENIED_ERROR, MYF(0), - "ANY", thd->priv_user, thd->host_or_ip, - field_name, tab); + "ANY", thd->security_ctx->priv_user, + thd->security_ctx->host_or_ip, field_name, tab); goto error; } } diff --git a/sql/item_func.cc b/sql/item_func.cc index 518fb011e0f..338bb4db4fe 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4713,7 +4713,7 @@ Item_func_sp::execute(Item **itp) Sub_statement_state statement_state; #ifndef NO_EMBEDDED_ACCESS_CHECKS - st_sp_security_context save_ctx; + st_security_context *save_ctx; #endif if (! m_sp && ! (m_sp= sp_find_function(thd, m_name, TRUE))) @@ -4723,11 +4723,11 @@ Item_func_sp::execute(Item **itp) } #ifndef NO_EMBEDDED_ACCESS_CHECKS - if (check_routine_access(thd, EXECUTE_ACL, - m_sp->m_db.str, m_sp->m_name.str, 0, 0)) + if (check_routine_access(thd, EXECUTE_ACL, + m_sp->m_db.str, m_sp->m_name.str, 0, 0) || + sp_change_security_context(thd, m_sp, &save_ctx)) goto error; - sp_change_security_context(thd, m_sp, &save_ctx); - if (save_ctx.changed && + if (save_ctx && check_routine_access(thd, EXECUTE_ACL, m_sp->m_db.str, m_sp->m_name.str, 0, 0)) goto error_check_ctx; @@ -4750,7 +4750,7 @@ Item_func_sp::execute(Item **itp) #ifndef NO_EMBEDDED_ACCESS_CHECKS error_check_ctx: - sp_restore_security_context(thd, m_sp, &save_ctx); + sp_restore_security_context(thd, save_ctx); #endif error: diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 4fd33c06095..6a51ecd307d 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -473,7 +473,8 @@ String *Item_func_des_decrypt::val_str(String *str) { uint key_number=(uint) (*res)[0] & 127; // Check if automatic key and that we have privilege to uncompress using it - if (!(current_thd->master_access & SUPER_ACL) || key_number > 9) + if (!(current_thd->security_ctx->master_access & SUPER_ACL) || + key_number > 9) goto error; VOID(pthread_mutex_lock(&LOCK_des_key_file)); @@ -1601,13 +1602,13 @@ String *Item_func_user::val_str(String *str) if (is_current) { - user= thd->priv_user; - host= thd->priv_host; + user= thd->security_ctx->priv_user; + host= thd->security_ctx->priv_host; } else { - user= thd->user; - host= thd->host_or_ip; + user= thd->main_security_ctx.user; + host= thd->main_security_ctx.priv_host; } // For system threads (e.g. replication SQL thread) user may be empty @@ -2518,7 +2519,7 @@ String *Item_load_file::val_str(String *str) if (!(file_name= args[0]->val_str(str)) #ifndef NO_EMBEDDED_ACCESS_CHECKS - || !(current_thd->master_access & FILE_ACL) + || !(current_thd->security_ctx->master_access & FILE_ACL) #endif ) goto err; diff --git a/sql/log.cc b/sql/log.cc index 920a3fcff42..032ac392c00 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1476,7 +1476,7 @@ bool MYSQL_LOG::write(THD *thd,enum enum_server_command command, { // Normal thread if ((thd->options & OPTION_LOG_OFF) #ifndef NO_EMBEDDED_ACCESS_CHECKS - && (thd->master_access & SUPER_ACL) + && (thd->security_ctx->master_access & SUPER_ACL) #endif ) { @@ -1935,10 +1935,12 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length, tmp_errno=errno; } if (my_b_printf(&log_file, "# User@Host: %s[%s] @ %s [%s]\n", - thd->priv_user ? thd->priv_user : "", - thd->user ? thd->user : "", - thd->host ? thd->host : "", - thd->ip ? thd->ip : "") == (uint) -1) + thd->security_ctx->priv_user ? + thd->security_ctx->priv_user : "", + thd->security_ctx->user ? thd->security_ctx->user : "", + thd->security_ctx->host ? thd->security_ctx->host : "", + thd->security_ctx->ip ? thd->security_ctx->ip : "") == + (uint) -1) tmp_errno=errno; } if (query_start_arg) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 2d45360ab64..059b9cca48e 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -484,6 +484,7 @@ typedef my_bool (*qc_engine_callback)(THD *thd, char *table_key, #include "protocol.h" #include "sql_udf.h" class user_var_entry; +class st_security_context; enum enum_var_type { OPT_DEFAULT= 0, OPT_SESSION, OPT_GLOBAL @@ -515,7 +516,7 @@ bool delete_precheck(THD *thd, TABLE_LIST *tables); bool insert_precheck(THD *thd, TABLE_LIST *tables); bool create_table_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *create_table); -bool default_view_definer(THD *thd, st_lex_user *definer); +bool default_view_definer(st_security_context *sctx, st_lex_user *definer); enum enum_mysql_completiontype { diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a28ae38c675..daabb53a39d 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -776,7 +776,9 @@ static void close_connections(void) { if (global_system_variables.log_warnings) sql_print_warning(ER(ER_FORCING_CLOSE),my_progname, - tmp->thread_id,tmp->user ? tmp->user : ""); + tmp->thread_id, + (tmp->security_ctx->user ? + tmp->security_ctx->user : "")); close_connection(tmp,0,0); } #endif @@ -3582,7 +3584,7 @@ static void bootstrap(FILE *file) thd->client_capabilities=0; my_net_init(&thd->net,(st_vio*) 0); thd->max_client_packet_length= thd->net.max_packet; - thd->master_access= ~(ulong)0; + thd->security_ctx->master_access= ~(ulong)0; thd->thread_id=thread_id++; thread_count++; @@ -3922,7 +3924,7 @@ extern "C" pthread_handler_decl(handle_connections_sockets, continue; } if (sock == unix_sock) - thd->host=(char*) my_localhost; + thd->security_ctx->host=(char*) my_localhost; #ifdef __WIN__ /* Set default wait_timeout */ ulong wait_timeout= global_system_variables.net_wait_timeout * 1000; diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 59e29d1d80c..d4d26c2ccf1 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -66,13 +66,11 @@ static int init_failsafe_rpl_thread(THD* thd) this thread has no other error reporting method). */ thd->system_thread = thd->bootstrap = 1; - thd->host_or_ip= ""; + thd->security_ctx->skip_grants(); thd->client_capabilities = 0; my_net_init(&thd->net, 0); thd->net.read_timeout = slave_net_timeout; thd->max_client_packet_length=thd->net.max_packet; - thd->master_access= ~(ulong)0; - thd->priv_user = 0; pthread_mutex_lock(&LOCK_thread_count); thd->thread_id = thread_id++; pthread_mutex_unlock(&LOCK_thread_count); diff --git a/sql/set_var.cc b/sql/set_var.cc index ff997158941..853f3570003 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1092,9 +1092,10 @@ static void sys_default_init_slave(THD* thd, enum_var_type type) static int sys_check_ftb_syntax(THD *thd, set_var *var) { - if (thd->master_access & SUPER_ACL) - return ft_boolean_check_syntax_string((byte*) var->value->str_value.c_ptr()) ? - -1 : 0; + if (thd->security_ctx->master_access & SUPER_ACL) + return (ft_boolean_check_syntax_string((byte*) + var->value->str_value.c_ptr()) ? + -1 : 0); else { my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER"); @@ -2689,7 +2690,7 @@ static bool set_option_autocommit(THD *thd, set_var *var) static int check_log_update(THD *thd, set_var *var) { #ifndef NO_EMBEDDED_ACCESS_CHECKS - if (!(thd->master_access & SUPER_ACL)) + if (!(thd->security_ctx->master_access & SUPER_ACL)) { my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER"); return 1; @@ -2735,7 +2736,7 @@ static int check_pseudo_thread_id(THD *thd, set_var *var) { var->save_result.ulonglong_value= var->value->val_int(); #ifndef NO_EMBEDDED_ACCESS_CHECKS - if (thd->master_access & SUPER_ACL) + if (thd->security_ctx->master_access & SUPER_ACL) return 0; else { @@ -3100,10 +3101,10 @@ int set_var_password::check(THD *thd) #ifndef NO_EMBEDDED_ACCESS_CHECKS if (!user->host.str) { - if (thd->priv_host != 0) + if (*thd->security_ctx->priv_host != 0) { - user->host.str= (char *) thd->priv_host; - user->host.length= strlen(thd->priv_host); + user->host.str= (char *) thd->security_ctx->priv_host; + user->host.length= strlen(thd->security_ctx->priv_host); } else { diff --git a/sql/slave.cc b/sql/slave.cc index d2a60076cef..7bbad84debb 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2809,17 +2809,10 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type) DBUG_ENTER("init_slave_thread"); thd->system_thread = (thd_type == SLAVE_THD_SQL) ? SYSTEM_THREAD_SLAVE_SQL : SYSTEM_THREAD_SLAVE_IO; - /* - The two next lines are needed for replication of SP (CREATE PROCEDURE - needs a valid user to store in mysql.proc). - */ - thd->priv_user= (char *) ""; - thd->priv_host[0]= '\0'; - thd->host_or_ip= ""; + thd->security_ctx->skip_grants(); thd->client_capabilities = 0; my_net_init(&thd->net, 0); thd->net.read_timeout = slave_net_timeout; - thd->master_access= ~(ulong)0; thd->slave_thread = 1; set_slave_thread_options(thd); /* diff --git a/sql/sp.cc b/sql/sp.cc index 80b18571d7d..4f7b544f5c7 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -494,7 +494,8 @@ db_create_routine(THD *thd, int type, sp_head *sp) else { restore_record(table, s->default_values); // Get default values for fields - strxmov(definer, thd->priv_user, "@", thd->priv_host, NullS); + strxmov(definer, thd->security_ctx->priv_user, "@", + thd->security_ctx->priv_host, NullS); if (table->s->fields != MYSQL_PROC_FIELD_COUNT) { @@ -569,7 +570,7 @@ db_create_routine(THD *thd, int type, sp_head *sp) goto done; } } - if (!(thd->master_access & SUPER_ACL)) + if (!(thd->security_ctx->master_access & SUPER_ACL)) { my_message(ER_BINLOG_CREATE_ROUTINE_NEED_SUPER, ER(ER_BINLOG_CREATE_ROUTINE_NEED_SUPER), MYF(0)); diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 1a7599d7bbc..0d481047849 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1636,8 +1636,10 @@ bool check_show_routine_access(THD *thd, sp_head *sp, bool *full_access) tables.db= (char*) "mysql"; tables.table_name= tables.alias= (char*) "proc"; *full_access= (!check_table_access(thd, SELECT_ACL, &tables, 1) || - (!strcmp(sp->m_definer_user.str, thd->priv_user) && - !strcmp(sp->m_definer_host.str, thd->priv_host))); + (!strcmp(sp->m_definer_user.str, + thd->security_ctx->priv_user) && + !strcmp(sp->m_definer_host.str, + thd->security_ctx->priv_host))); if (!*full_access) return check_some_routine_access(thd, sp->m_db.str, sp->m_name.str, sp->m_type == TYPE_ENUM_PROCEDURE); @@ -2645,54 +2647,38 @@ sp_instr_error::print(String *str) */ #ifndef NO_EMBEDDED_ACCESS_CHECKS -void -sp_change_security_context(THD *thd, sp_head *sp, st_sp_security_context *ctxp) +bool +sp_change_security_context(THD *thd, sp_head *sp, st_security_context **backup) { - ctxp->changed= (sp->m_chistics->suid != SP_IS_NOT_SUID && - (strcmp(sp->m_definer_user.str, thd->priv_user) || - strcmp(sp->m_definer_host.str, thd->priv_host))); + bool changed= (sp->m_chistics->suid != SP_IS_NOT_SUID && + (strcmp(sp->m_definer_user.str, + thd->security_ctx->priv_user) || + my_strcasecmp(system_charset_info, sp->m_definer_host.str, + thd->security_ctx->priv_host))); - if (ctxp->changed) + *backup= 0; + if (changed) { - ctxp->master_access= thd->master_access; - ctxp->db_access= thd->db_access; - ctxp->priv_user= thd->priv_user; - strncpy(ctxp->priv_host, thd->priv_host, sizeof(ctxp->priv_host)); - ctxp->user= thd->user; - ctxp->host= thd->host; - ctxp->ip= thd->ip; - - /* Change thise just to do the acl_getroot_no_password */ - thd->user= sp->m_definer_user.str; - thd->host= thd->ip = sp->m_definer_host.str; - - if (acl_getroot_no_password(thd)) - { // Failed, run as invoker for now - ctxp->changed= FALSE; - thd->master_access= ctxp->master_access; - thd->db_access= ctxp->db_access; - thd->priv_user= ctxp->priv_user; - strncpy(thd->priv_host, ctxp->priv_host, sizeof(thd->priv_host)); + if (acl_getroot_no_password(&sp->m_security_ctx, sp->m_definer_user.str, + sp->m_definer_host.str, + sp->m_definer_host.str, + sp->m_db.str)) + { + my_error(ER_NO_SUCH_USER, MYF(0), sp->m_definer_user.str, + sp->m_definer_host.str); + return TRUE; } - - /* Restore these immiediately */ - thd->user= ctxp->user; - thd->host= ctxp->host; - thd->ip= ctxp->ip; + *backup= thd->security_ctx; + thd->security_ctx= &sp->m_security_ctx; } + return FALSE; } void -sp_restore_security_context(THD *thd, sp_head *sp, st_sp_security_context *ctxp) +sp_restore_security_context(THD *thd, st_security_context *backup) { - if (ctxp->changed) - { - ctxp->changed= FALSE; - thd->master_access= ctxp->master_access; - thd->db_access= ctxp->db_access; - thd->priv_user= ctxp->priv_user; - strncpy(thd->priv_host, ctxp->priv_host, sizeof(thd->priv_host)); - } + if (backup) + thd->security_ctx= backup; } #endif /* NO_EMBEDDED_ACCESS_CHECKS */ diff --git a/sql/sp_head.h b/sql/sp_head.h index 9888fe74149..ccf8c48a5eb 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -151,6 +151,9 @@ public: // Pointers set during parsing uchar *m_param_begin, *m_param_end, *m_body_begin; + /* security context for SP procedure/function in case we switch it*/ + st_security_context m_security_ctx; + static void * operator new(size_t size); @@ -1017,23 +1020,12 @@ private: }; // class sp_instr_error : public sp_instr -struct st_sp_security_context -{ - bool changed; - uint master_access; - uint db_access; - char *priv_user; - char priv_host[MAX_HOSTNAME]; - char *user; - char *host; - char *ip; -}; - #ifndef NO_EMBEDDED_ACCESS_CHECKS +bool +sp_change_security_context(THD *thd, sp_head *sp, + st_security_context **backup); void -sp_change_security_context(THD *thd, sp_head *sp, st_sp_security_context *ctxp); -void -sp_restore_security_context(THD *thd, sp_head *sp,st_sp_security_context *ctxp); +sp_restore_security_context(THD *thd, st_security_context *backup); #endif /* NO_EMBEDDED_ACCESS_CHECKS */ TABLE_LIST * diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 5e2fd17377a..95f7fed358d 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -719,6 +719,7 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, ulong user_access= NO_ACCESS; int res= 1; ACL_USER *acl_user= 0; + st_security_context *sctx= thd->security_ctx; DBUG_ENTER("acl_getroot"); if (!initialized) @@ -726,10 +727,7 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, /* here if mysqld's been started with --skip-grant-tables option. */ - thd->priv_user= (char *) ""; // privileges for - *thd->priv_host= '\0'; // the user are unknown - thd->master_access= ~NO_ACCESS; // everything is allowed - bzero((char*) mqh, sizeof(*mqh)); + sctx->skip_grants(); DBUG_RETURN(0); } @@ -744,9 +742,9 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, for (uint i=0 ; i < acl_users.elements ; i++) { ACL_USER *acl_user_tmp= dynamic_element(&acl_users,i,ACL_USER*); - if (!acl_user_tmp->user || !strcmp(thd->user, acl_user_tmp->user)) + if (!acl_user_tmp->user || !strcmp(sctx->user, acl_user_tmp->user)) { - if (compare_hostname(&acl_user_tmp->host, thd->host, thd->ip)) + if (compare_hostname(&acl_user_tmp->host, sctx->host, sctx->ip)) { /* check password: it should be empty or valid */ if (passwd_len == acl_user_tmp->salt_len) @@ -893,14 +891,14 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, break; #endif /* HAVE_OPENSSL */ } - thd->master_access= user_access; - thd->priv_user= acl_user->user ? thd->user : (char *) ""; + sctx->master_access= user_access; + sctx->priv_user= acl_user->user ? sctx->user : (char *) ""; *mqh= acl_user->user_resource; if (acl_user->host.hostname) - strmake(thd->priv_host, acl_user->host.hostname, MAX_HOSTNAME); + strmake(sctx->priv_host, acl_user->host.hostname, MAX_HOSTNAME); else - *thd->priv_host= 0; + *sctx->priv_host= 0; } VOID(pthread_mutex_unlock(&acl_cache->lock)); DBUG_RETURN(res); @@ -913,42 +911,46 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, * Used to get access rights for SQL SECURITY DEFINER invocation of * stored procedures. */ -int acl_getroot_no_password(THD *thd) +int acl_getroot_no_password(st_security_context *sctx, char *user, char *host, + char *ip, char *db) { int res= 1; uint i; ACL_USER *acl_user= 0; DBUG_ENTER("acl_getroot_no_password"); + sctx->user= user; + sctx->host= host; + sctx->ip= ip; + sctx->host_or_ip= host ? host : (ip ? ip : ""); + if (!initialized) { - /* + /* here if mysqld's been started with --skip-grant-tables option. */ - thd->priv_user= (char *) ""; // privileges for - *thd->priv_host= '\0'; // the user are unknown - thd->master_access= ~NO_ACCESS; // everything is allowed + sctx->skip_grants(); DBUG_RETURN(0); } VOID(pthread_mutex_lock(&acl_cache->lock)); - thd->master_access= 0; - thd->db_access= 0; + sctx->master_access= 0; + sctx->db_access= 0; /* Find acl entry in user database. This is specially tailored to suit the check we do for CALL of - a stored procedure; thd->user is set to what is actually a + a stored procedure; user is set to what is actually a priv_user, which can be ''. */ for (i=0 ; i < acl_users.elements ; i++) { acl_user= dynamic_element(&acl_users,i,ACL_USER*); - if ((!acl_user->user && (!thd->user || !thd->user[0])) || - (acl_user->user && strcmp(thd->user, acl_user->user) == 0)) + if ((!acl_user->user && (!user || !user[0])) || + (acl_user->user && strcmp(user, acl_user->user) == 0)) { - if (compare_hostname(&acl_user->host, thd->host, thd->ip)) + if (compare_hostname(&acl_user->host, host, ip)) { res= 0; break; @@ -962,25 +964,25 @@ int acl_getroot_no_password(THD *thd) { ACL_DB *acl_db= dynamic_element(&acl_dbs, i, ACL_DB*); if (!acl_db->user || - (thd->user && thd->user[0] && !strcmp(thd->user, acl_db->user))) + (user && user[0] && !strcmp(user, acl_db->user))) { - if (compare_hostname(&acl_db->host, thd->host, thd->ip)) + if (compare_hostname(&acl_db->host, host, ip)) { - if (!acl_db->db || (thd->db && !strcmp(acl_db->db, thd->db))) + if (!acl_db->db || (db && !strcmp(acl_db->db, db))) { - thd->db_access= acl_db->access; + sctx->db_access= acl_db->access; break; } } } } - thd->master_access= acl_user->access; - thd->priv_user= acl_user->user ? thd->user : (char *) ""; + sctx->master_access= acl_user->access; + sctx->priv_user= acl_user->user ? user : (char *) ""; if (acl_user->host.hostname) - strmake(thd->priv_host, acl_user->host.hostname, MAX_HOSTNAME); + strmake(sctx->priv_host, acl_user->host.hostname, MAX_HOSTNAME); else - *thd->priv_host= 0; + *sctx->priv_host= 0; } VOID(pthread_mutex_unlock(&acl_cache->lock)); DBUG_RETURN(res); @@ -1334,13 +1336,14 @@ bool check_change_password(THD *thd, const char *host, const char *user, return(1); } if (!thd->slave_thread && - (strcmp(thd->user,user) || - my_strcasecmp(system_charset_info, host, thd->priv_host))) + (strcmp(thd->security_ctx->user, user) || + my_strcasecmp(system_charset_info, host, + thd->security_ctx->priv_host))) { if (check_access(thd, UPDATE_ACL, "mysql",0,1,0,0)) return(1); } - if (!thd->slave_thread && !thd->user[0]) + if (!thd->slave_thread && !thd->security_ctx->user[0]) { my_message(ER_PASSWORD_ANONYMOUS_USER, ER(ER_PASSWORD_ANONYMOUS_USER), MYF(0)); @@ -1646,9 +1649,10 @@ static bool update_user_table(THD *thd, TABLE *table, static bool test_if_create_new_users(THD *thd) { - bool create_new_users= test(thd->master_access & INSERT_ACL) || + st_security_context *sctx= thd->security_ctx; + bool create_new_users= test(sctx->master_access & INSERT_ACL) || (!opt_safe_user_create && - test(thd->master_access & CREATE_USER_ACL)); + test(sctx->master_access & CREATE_USER_ACL)); if (!create_new_users) { TABLE_LIST tl; @@ -1658,8 +1662,8 @@ static bool test_if_create_new_users(THD *thd) tl.table_name= (char*) "user"; create_new_users= 1; - db_access=acl_get(thd->host, thd->ip, - thd->priv_user, tl.db, 0); + db_access=acl_get(sctx->host, sctx->ip, + sctx->priv_user, tl.db, 0); if (!(db_access & INSERT_ACL)) { if (check_grant(thd, INSERT_ACL, &tl, 0, UINT_MAX, 1)) @@ -1738,7 +1742,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, else if (!can_create_user) { my_error(ER_CANT_CREATE_USER_WITH_GRANT, MYF(0), - thd->user, thd->host_or_ip); + thd->security_ctx->user, thd->security_ctx->host_or_ip); goto end; } old_row_exists = 0; @@ -2450,7 +2454,8 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table, byte user_key[MAX_KEY_LENGTH]; DBUG_ENTER("replace_table_table"); - strxmov(grantor, thd->user, "@", thd->host_or_ip, NullS); + strxmov(grantor, thd->security_ctx->user, "@", + thd->security_ctx->host_or_ip, NullS); /* The following should always succeed as new users are created before @@ -2572,7 +2577,8 @@ static int replace_routine_table(THD *thd, GRANT_NAME *grant_name, DBUG_RETURN(-1); } - strxmov(grantor, thd->user, "@", thd->host_or_ip, NullS); + strxmov(grantor, thd->security_ctx->user, "@", + thd->security_ctx->host_or_ip, NullS); /* The following should always succeed as new users are created before @@ -2763,7 +2769,8 @@ bool mysql_table_grant(THD *thd, TABLE_LIST *table_list, get_privilege_desc(command, sizeof(command), table_list->grant.want_privilege); my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0), - command, thd->priv_user, thd->host_or_ip, table_list->alias); + command, thd->security_ctx->priv_user, + thd->security_ctx->host_or_ip, table_list->alias); DBUG_RETURN(-1); } } @@ -3486,11 +3493,11 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables, uint show_table, uint number, bool no_errors) { TABLE_LIST *table; - char *user = thd->priv_user; + st_security_context *sctx= thd->security_ctx; DBUG_ENTER("check_grant"); DBUG_ASSERT(number > 0); - want_access&= ~thd->master_access; + want_access&= ~sctx->master_access; if (!want_access) DBUG_RETURN(0); // ok @@ -3508,8 +3515,9 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables, table->grant.want_privilege= 0; continue; // Already checked } - if (!(grant_table= table_hash_search(thd->host,thd->ip, - table->db,user, table->table_name,0))) + if (!(grant_table= table_hash_search(sctx->host, sctx->ip, + table->db, sctx->priv_user, + table->table_name,0))) { want_access &= ~table->grant.privilege; goto err; // No grants @@ -3543,8 +3551,8 @@ err: get_privilege_desc(command, sizeof(command), want_access); my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0), command, - thd->priv_user, - thd->host_or_ip, + sctx->priv_user, + sctx->host_or_ip, table ? table->table_name : "unknown"); } DBUG_RETURN(1); @@ -3555,6 +3563,7 @@ bool check_grant_column(THD *thd, GRANT_INFO *grant, const char *db_name, const char *table_name, const char *name, uint length, uint show_tables) { + st_security_context *sctx= thd->security_ctx; GRANT_TABLE *grant_table; GRANT_COLUMN *grant_column; ulong want_access= grant->want_privilege & ~grant->privilege; @@ -3571,8 +3580,8 @@ bool check_grant_column(THD *thd, GRANT_INFO *grant, if (grant->version != grant_version) { grant->grant_table= - table_hash_search(thd->host, thd->ip, db_name, - thd->priv_user, + table_hash_search(sctx->host, sctx->ip, db_name, + sctx->priv_user, table_name, 0); /* purecov: inspected */ grant->version= grant_version; /* purecov: inspected */ } @@ -3601,8 +3610,8 @@ err: get_privilege_desc(command, sizeof(command), want_access); my_error(ER_COLUMNACCESS_DENIED_ERROR, MYF(0), command, - thd->priv_user, - thd->host_or_ip, + sctx->priv_user, + sctx->host_or_ip, name, table_name); } @@ -3614,6 +3623,7 @@ bool check_grant_all_columns(THD *thd, ulong want_access, GRANT_INFO *grant, const char* db_name, const char *table_name, Field_iterator *fields) { + st_security_context *sctx= thd->security_ctx; GRANT_TABLE *grant_table; GRANT_COLUMN *grant_column; @@ -3630,8 +3640,8 @@ bool check_grant_all_columns(THD *thd, ulong want_access, GRANT_INFO *grant, if (grant->version != grant_version) { grant->grant_table= - table_hash_search(thd->host, thd->ip, db_name, - thd->priv_user, + table_hash_search(sctx->host, sctx->ip, db_name, + sctx->priv_user, table_name, 0); /* purecov: inspected */ grant->version= grant_version; /* purecov: inspected */ } @@ -3657,8 +3667,8 @@ err2: get_privilege_desc(command, sizeof(command), want_access); my_error(ER_COLUMNACCESS_DENIED_ERROR, MYF(0), command, - thd->priv_user, - thd->host_or_ip, + sctx->priv_user, + sctx->host_or_ip, fields->name(), table_name); return 1; @@ -3673,11 +3683,12 @@ err2: bool check_grant_db(THD *thd,const char *db) { + st_security_context *sctx= thd->security_ctx; char helping [NAME_LEN+USERNAME_LENGTH+2]; uint len; bool error= 1; - len= (uint) (strmov(strmov(helping,thd->priv_user)+1,db)-helping)+ 1; + len= (uint) (strmov(strmov(helping, sctx->priv_user) + 1, db) - helping) + 1; rw_rdlock(&LOCK_grant); for (uint idx=0 ; idx < column_priv_hash.records ; idx++) @@ -3686,7 +3697,7 @@ bool check_grant_db(THD *thd,const char *db) idx); if (len < grant_table->key_length && !memcmp(grant_table->hash_key,helping,len) && - compare_hostname(&grant_table->host, thd->host, thd->ip)) + compare_hostname(&grant_table->host, sctx->host, sctx->ip)) { error=0; // Found match break; @@ -3714,15 +3725,16 @@ bool check_grant_db(THD *thd,const char *db) 1 Error: User did not have the requested privielges ****************************************************************************/ -bool check_grant_routine(THD *thd, ulong want_access, +bool check_grant_routine(THD *thd, ulong want_access, TABLE_LIST *procs, bool is_proc, bool no_errors) { TABLE_LIST *table; - char *user= thd->priv_user; - char *host= thd->priv_host; + st_security_context *sctx= thd->security_ctx; + char *user= sctx->priv_user; + char *host= sctx->priv_host; DBUG_ENTER("check_grant_routine"); - want_access&= ~thd->master_access; + want_access&= ~sctx->master_access; if (!want_access) DBUG_RETURN(0); // ok @@ -3730,7 +3742,7 @@ bool check_grant_routine(THD *thd, ulong want_access, for (table= procs; table; table= table->next_global) { GRANT_NAME *grant_proc; - if ((grant_proc= routine_hash_search(host,thd->ip, table->db, user, + if ((grant_proc= routine_hash_search(host, sctx->ip, table->db, user, table->table_name, is_proc, 0))) table->grant.privilege|= grant_proc->privs; @@ -3786,8 +3798,10 @@ bool check_routine_level_acl(THD *thd, const char *db, const char *name, { GRANT_NAME *grant_proc; rw_rdlock(&LOCK_grant); - if ((grant_proc= routine_hash_search(thd->priv_host, thd->ip, db, - thd->priv_user, name, is_proc, 0))) + if ((grant_proc= routine_hash_search(thd->security_ctx->priv_host, + thd->security_ctx->ip, db, + thd->security_ctx->priv_user, + name, is_proc, 0))) no_routine_acl= !(grant_proc->privs & SHOW_PROC_ACLS); rw_unlock(&LOCK_grant); } @@ -3802,7 +3816,7 @@ bool check_routine_level_acl(THD *thd, const char *db, const char *name, ulong get_table_grant(THD *thd, TABLE_LIST *table) { ulong privilege; - char *user = thd->priv_user; + st_security_context *sctx= thd->security_ctx; const char *db = table->db ? table->db : thd->db; GRANT_TABLE *grant_table; @@ -3810,7 +3824,7 @@ ulong get_table_grant(THD *thd, TABLE_LIST *table) #ifdef EMBEDDED_LIBRARY grant_table= NULL; #else - grant_table= table_hash_search(thd->host, thd->ip, db, user, + grant_table= table_hash_search(sctx->host, sctx->ip, db, sctx->priv_user, table->table_name, 0); #endif table->grant.grant_table=grant_table; // Remember for column test @@ -3854,8 +3868,8 @@ ulong get_column_grant(THD *thd, GRANT_INFO *grant, if (grant->version != grant_version) { grant->grant_table= - table_hash_search(thd->host, thd->ip, db_name, - thd->priv_user, + table_hash_search(thd->security_ctx->host, thd->security_ctx->ip, + db_name, thd->security_ctx->priv_user, table_name, 0); /* purecov: inspected */ grant->version= grant_version; /* purecov: inspected */ } @@ -5425,22 +5439,24 @@ bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name, bool sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name, bool is_proc) { + st_security_context *sctx= thd->security_ctx; LEX_USER *combo; TABLE_LIST tables[1]; List user_list; bool result; - DBUG_ENTER("sp_grant_privileges"); + DBUG_ENTER("sp_grant_privileges"); if (!(combo=(LEX_USER*) thd->alloc(sizeof(st_lex_user)))) DBUG_RETURN(TRUE); - combo->user.str= thd->user; + combo->user.str= sctx->user; - if (!find_acl_user(combo->host.str=(char*)thd->host_or_ip, combo->user.str, + if (!find_acl_user(combo->host.str=(char*)sctx->host_or_ip, combo->user.str, FALSE) && - !find_acl_user(combo->host.str=(char*)thd->host, combo->user.str, + !find_acl_user(combo->host.str=(char*)sctx->host, combo->user.str, + FALSE) && + !find_acl_user(combo->host.str=(char*)sctx->ip, combo->user.str, FALSE) && - !find_acl_user(combo->host.str=(char*)thd->ip, combo->user.str, FALSE) && !find_acl_user(combo->host.str=(char*)"%", combo->user.str, FALSE)) DBUG_RETURN(TRUE); @@ -5557,7 +5573,7 @@ int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond) char buff[100]; TABLE *table= tables->table; bool no_global_access= check_access(thd, SELECT_ACL, "mysql",0,1,1,0); - char *curr_host= thd->priv_host ? thd->priv_host : (char *) "%"; + char *curr_host= thd->security_ctx->get_priv_host(); DBUG_ENTER("fill_schema_user_privileges"); for (counter=0 ; counter < acl_users.elements ; counter++) @@ -5570,7 +5586,7 @@ int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond) host= ""; if (no_global_access && - (strcmp(thd->priv_user, user) || + (strcmp(thd->security_ctx->priv_user, user) || my_strcasecmp(system_charset_info, curr_host, host))) continue; @@ -5610,7 +5626,7 @@ int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond) char buff[100]; TABLE *table= tables->table; bool no_global_access= check_access(thd, SELECT_ACL, "mysql",0,1,1,0); - char *curr_host= thd->priv_host ? thd->priv_host : (char *) "%"; + char *curr_host= thd->security_ctx->get_priv_host(); DBUG_ENTER("fill_schema_schema_privileges"); for (counter=0 ; counter < acl_dbs.elements ; counter++) @@ -5624,7 +5640,7 @@ int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond) host= ""; if (no_global_access && - (strcmp(thd->priv_user, user) || + (strcmp(thd->security_ctx->priv_user, user) || my_strcasecmp(system_charset_info, curr_host, host))) continue; @@ -5665,7 +5681,7 @@ int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond) char buff[100]; TABLE *table= tables->table; bool no_global_access= check_access(thd, SELECT_ACL, "mysql",0,1,1,0); - char *curr_host= thd->priv_host ? thd->priv_host : (char *) "%"; + char *curr_host= thd->security_ctx->get_priv_host(); DBUG_ENTER("fill_schema_table_privileges"); for (index=0 ; index < column_priv_hash.records ; index++) @@ -5677,7 +5693,7 @@ int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond) user= ""; if (no_global_access && - (strcmp(thd->priv_user, user) || + (strcmp(thd->security_ctx->priv_user, user) || my_strcasecmp(system_charset_info, curr_host, grant_table->host.hostname))) continue; @@ -5727,7 +5743,7 @@ int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond) char buff[100]; TABLE *table= tables->table; bool no_global_access= check_access(thd, SELECT_ACL, "mysql",0,1,1,0); - char *curr_host= thd->priv_host ? thd->priv_host : (char *) "%"; + char *curr_host= thd->security_ctx->get_priv_host(); DBUG_ENTER("fill_schema_table_privileges"); for (index=0 ; index < column_priv_hash.records ; index++) @@ -5739,7 +5755,7 @@ int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond) user= ""; if (no_global_access && - (strcmp(thd->priv_user, user) || + (strcmp(thd->security_ctx->priv_user, user) || my_strcasecmp(system_charset_info, curr_host, grant_table->host.hostname))) continue; @@ -5803,6 +5819,7 @@ int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond) void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant, const char *db, const char *table) { + st_security_context *sctx= thd->security_ctx; /* --skip-grants */ if (!initialized) { @@ -5811,13 +5828,13 @@ void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant, } /* global privileges */ - grant->privilege= thd->master_access; + grant->privilege= sctx->master_access; - if (!thd->priv_user) + if (!sctx->priv_user) return; // it is slave /* db privileges */ - grant->privilege|= acl_get(thd->host, thd->ip, thd->priv_user, db, 0); + grant->privilege|= acl_get(sctx->host, sctx->ip, sctx->priv_user, db, 0); if (!grant_option) return; @@ -5827,8 +5844,8 @@ void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant, { rw_rdlock(&LOCK_grant); grant->grant_table= - table_hash_search(thd->host, thd->ip, db, - thd->priv_user, + table_hash_search(sctx->host, sctx->ip, db, + sctx->priv_user, table, 0); /* purecov: inspected */ grant->version= grant_version; /* purecov: inspected */ rw_unlock(&LOCK_grant); diff --git a/sql/sql_acl.h b/sql/sql_acl.h index 344302de9be..f62f3c12b28 100644 --- a/sql/sql_acl.h +++ b/sql/sql_acl.h @@ -181,7 +181,8 @@ ulong acl_get(const char *host, const char *ip, const char *user, const char *db, my_bool db_is_pattern); int acl_getroot(THD *thd, USER_RESOURCES *mqh, const char *passwd, uint passwd_len); -int acl_getroot_no_password(THD *thd); +int acl_getroot_no_password(st_security_context *sctx, char *user, char *host, + char *ip, char *db); bool acl_check_host(const char *host, const char *ip); bool check_change_password(THD *thd, const char *host, const char *user, char *password, uint password_len); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index fb23093731a..1b8d65e21f0 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -4572,7 +4572,8 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name, VIEW_ANY_ACL))) { my_error(ER_COLUMNACCESS_DENIED_ERROR, MYF(0), "ANY", - thd->priv_user, thd->host_or_ip, + thd->security_ctx->priv_user, + thd->security_ctx->host_or_ip, fld->field_name, field_table_name); DBUG_RETURN(TRUE); } diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 2699a4fa628..85bf520b56e 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -181,9 +181,10 @@ THD::THD() spcont(NULL) { stmt_arena= this; - host= user= priv_user= db= ip= 0; + db= 0; catalog= (char*)"std"; // the only catalog we have for now - host_or_ip= "connecting host"; + main_security_ctx.init(); + security_ctx= &main_security_ctx; locked=some_tables_deleted=no_errors=password= 0; query_start_used= 0; count_cuted_fields= CHECK_FIELD_IGNORE; @@ -236,9 +237,6 @@ THD::THD() server_id = ::server_id; slave_net = 0; command=COM_CONNECT; -#ifndef NO_EMBEDDED_ACCESS_CHECKS - db_access=NO_ACCESS; -#endif *scramble= '\0'; init(); @@ -426,12 +424,8 @@ THD::~THD() ha_close_connection(this); - DBUG_PRINT("info", ("freeing host")); - if (host != my_localhost) // If not pointer to constant - safeFree(host); - if (user != delayed_user) - safeFree(user); - safeFree(ip); + DBUG_PRINT("info", ("freeing security context")); + main_security_ctx.destroy(); safeFree(db); free_root(&warn_root,MYF(0)); #ifdef USING_TRANSACTIONS @@ -1827,6 +1821,38 @@ void THD::set_status_var_init() bzero((char*) &status_var, sizeof(status_var)); } + +void st_security_context::init() +{ + host= user= priv_user= ip= 0; + host_or_ip= "connecting host"; +#ifndef NO_EMBEDDED_ACCESS_CHECKS + db_access= NO_ACCESS; +#endif +} + + +void st_security_context::destroy() +{ + // If not pointer to constant + if (host != my_localhost) + safeFree(host); + if (user != delayed_user) + safeFree(user); + safeFree(ip); +} + + +void st_security_context::skip_grants() +{ + /* privileges for the user are unknown everything is allowed */ + host_or_ip= (char *)""; + master_access= ~NO_ACCESS; + priv_user= (char *)""; + *priv_host= '\0'; +} + + /**************************************************************************** Handling of open and locked tables states. diff --git a/sql/sql_class.h b/sql/sql_class.h index 1a215d39841..ddc8b092311 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -941,6 +941,32 @@ bool xid_cache_insert(XID *xid, enum xa_states xa_state); bool xid_cache_insert(XID_STATE *xid_state); void xid_cache_delete(XID_STATE *xid_state); + +struct st_security_context { + /* + host - host of the client + user - user of the client, set to NULL until the user has been read from + the connection + priv_user - The user privilege we are using. May be '' for anonymous user. + ip - client IP + */ + char *host, *user, *priv_user, *ip; + char priv_host[MAX_HOSTNAME]; + /* points to host if host is available, otherwise points to ip */ + const char *host_or_ip; + ulong master_access; /* Global privileges from mysql.user */ + ulong db_access; /* Privileges for current db */ + + void init(); + void destroy(); + void skip_grants(); + inline char *get_priv_host() + { + return (*priv_host ? priv_host : (char *)"%"); + } +}; + + /* A registry for item tree transformations performed during query optimization. We register only those changes which require @@ -1113,13 +1139,8 @@ public: char *thread_stack; /* - host - host of the client - user - user of the client, set to NULL until the user has been read from - the connection - priv_user - The user privilege we are using. May be '' for anonymous user. db - currently selected database catalog - currently selected catalog - ip - client IP WARNING: some members of THD (currently 'db', 'catalog' and 'query') are set and alloced by the slave SQL thread (for the THD of that thread); that thread is (and must remain, for now) the only responsible for freeing these @@ -1128,8 +1149,10 @@ public: properly. For details see the 'err:' label of the pthread_handler_decl of the slave SQL thread, in sql/slave.cc. */ - char *host,*user,*priv_user,*db,*catalog,*ip; - char priv_host[MAX_HOSTNAME]; + char *db, *catalog; + st_security_context main_security_ctx; + st_security_context *security_ctx; + /* remote (peer) port */ uint16 peer_port; /* @@ -1138,13 +1161,9 @@ public: a time-consuming piece that MySQL can get stuck in for a long time. */ const char *proc_info; - /* points to host if host is available, otherwise points to ip */ - const char *host_or_ip; ulong client_capabilities; /* What the client supports */ ulong max_client_packet_length; - ulong master_access; /* Global privileges from mysql.user */ - ulong db_access; /* Privileges for current db */ HASH handler_tables_hash; /* diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 69ccbe690db..e4d8c1b8164 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -1093,6 +1093,7 @@ bool mysql_change_db(THD *thd, const char *name, bool no_access_check) bool system_db= 0; #ifndef NO_EMBEDDED_ACCESS_CHECKS ulong db_access; + st_security_context *sctx= thd->security_ctx; #endif DBUG_ENTER("mysql_change_db"); DBUG_PRINT("enter",("name: '%s'",name)); @@ -1130,22 +1131,20 @@ bool mysql_change_db(THD *thd, const char *name, bool no_access_check) #ifndef NO_EMBEDDED_ACCESS_CHECKS if (!no_access_check) { - if (test_all_bits(thd->master_access,DB_ACLS)) + if (test_all_bits(sctx->master_access,DB_ACLS)) db_access=DB_ACLS; else - db_access= (acl_get(thd->host,thd->ip, thd->priv_user,dbname,0) | - thd->master_access); + db_access= (acl_get(sctx->host, sctx->ip, sctx->priv_user, dbname, 0) | + sctx->master_access); if (!(db_access & DB_ACLS) && (!grant_option || check_grant_db(thd,dbname))) { my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), - thd->priv_user, - thd->priv_host, + sctx->priv_user, + sctx->priv_host, dbname); - mysql_log.write(thd,COM_INIT_DB,ER(ER_DBACCESS_DENIED_ERROR), - thd->priv_user, - thd->priv_host, - dbname); + mysql_log.write(thd, COM_INIT_DB, ER(ER_DBACCESS_DENIED_ERROR), + sctx->priv_user, sctx->priv_host, dbname); my_free(dbname,MYF(0)); DBUG_RETURN(1); } @@ -1167,7 +1166,7 @@ end: thd->db_length=db_length; #ifndef NO_EMBEDDED_ACCESS_CHECKS if (!no_access_check) - thd->db_access=db_access; + sctx->db_access=db_access; #endif if (system_db) { diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index f548a917bf8..cc4b291b5d1 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -272,7 +272,8 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, By default, both logs are enabled (this won't cause problems if the server runs without --log-update or --log-bin). */ - bool log_on= (thd->options & OPTION_BIN_LOG) || (!(thd->master_access & SUPER_ACL)); + bool log_on= (thd->options & OPTION_BIN_LOG) || + (!(thd->security_ctx->master_access & SUPER_ACL)); bool transactional_table; uint value_count; ulong counter = 1; @@ -1264,8 +1265,8 @@ public: table(0),tables_in_use(0),stacked_inserts(0), status(0), dead(0), group_count(0) { - thd.user=thd.priv_user=(char*) delayed_user; - thd.host=(char*) my_localhost; + thd.security_ctx->user=thd.security_ctx->priv_user=(char*) delayed_user; + thd.security_ctx->host=(char*) my_localhost; thd.current_tablenr=0; thd.version=refresh_version; thd.command=COM_DELAYED_INSERT; @@ -1275,7 +1276,7 @@ public: bzero((char*) &thd.net, sizeof(thd.net)); // Safety bzero((char*) &table_list, sizeof(table_list)); // Safety thd.system_thread= SYSTEM_THREAD_DELAYED_INSERT; - thd.host_or_ip= ""; + thd.security_ctx->host_or_ip= ""; bzero((char*) &info,sizeof(info)); pthread_mutex_init(&mutex,MY_MUTEX_INIT_FAST); pthread_cond_init(&cond,NULL); @@ -1298,7 +1299,7 @@ public: pthread_cond_destroy(&cond_client); thd.unlink(); // Must be unlinked under lock x_free(thd.query); - thd.user=thd.host=0; + thd.security_ctx->user= thd.security_ctx->host=0; thread_count--; delayed_insert_threads--; VOID(pthread_mutex_unlock(&LOCK_thread_count)); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e83530b7239..d056215c19b 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -270,10 +270,11 @@ int check_user(THD *thd, enum enum_server_command command, const char *passwd, uint passwd_len, const char *db, bool check_count) { + st_security_context *sctx= thd->security_ctx; DBUG_ENTER("check_user"); #ifdef NO_EMBEDDED_ACCESS_CHECKS - thd->master_access= GLOBAL_ACLS; // Full rights + sctx->master_access= GLOBAL_ACLS; // Full rights /* Change database if necessary */ if (db && db[0]) { @@ -340,9 +341,9 @@ int check_user(THD *thd, enum enum_server_command command, if (opt_secure_auth_local) { net_printf_error(thd, ER_SERVER_IS_IN_SECURE_AUTH_MODE, - thd->user, thd->host_or_ip); + sctx->user, sctx->host_or_ip); mysql_log.write(thd, COM_CONNECT, ER(ER_SERVER_IS_IN_SECURE_AUTH_MODE), - thd->user, thd->host_or_ip); + sctx->user, sctx->host_or_ip); DBUG_RETURN(-1); } /* We have to read very specific packet size */ @@ -360,22 +361,22 @@ int check_user(THD *thd, enum enum_server_command command, /* here res is always >= 0 */ if (res == 0) { - if (!(thd->master_access & NO_ACCESS)) // authentication is OK + if (!(sctx->master_access & NO_ACCESS)) // authentication is OK { DBUG_PRINT("info", ("Capabilities: %d packet_length: %ld Host: '%s' " "Login user: '%s' Priv_user: '%s' Using password: %s " "Access: %u db: '%s'", thd->client_capabilities, thd->max_client_packet_length, - thd->host_or_ip, thd->user, thd->priv_user, + sctx->host_or_ip, sctx->user, sctx->priv_user, passwd_len ? "yes": "no", - thd->master_access, thd->db ? thd->db : "*none*")); + sctx->master_access, thd->db ? thd->db : "*none*")); if (check_count) { VOID(pthread_mutex_lock(&LOCK_thread_count)); bool count_ok= thread_count <= max_connections + delayed_insert_threads - || (thd->master_access & SUPER_ACL); + || (sctx->master_access & SUPER_ACL); VOID(pthread_mutex_unlock(&LOCK_thread_count)); if (!count_ok) { // too many connections @@ -385,11 +386,11 @@ int check_user(THD *thd, enum enum_server_command command, } /* Why logging is performed before all checks've passed? */ - mysql_log.write(thd,command, - (thd->priv_user == thd->user ? + mysql_log.write(thd, command, + (sctx->priv_user == sctx->user ? (char*) "%s@%s on %s" : (char*) "%s@%s as anonymous on %s"), - thd->user, thd->host_or_ip, + sctx->user, sctx->host_or_ip, db ? db : (char*) ""); /* @@ -397,14 +398,14 @@ int check_user(THD *thd, enum enum_server_command command, set to 0 here because we don't have an active database yet (and we may not have an active database to set. */ - thd->db_access=0; + sctx->db_access=0; /* Don't allow user to connect if he has done too many queries */ if ((ur.questions || ur.updates || ur.conn_per_hour || ur.user_conn || max_user_connections) && get_or_create_user_conn(thd, - opt_old_style_user_limits ? thd->user : thd->priv_user, - opt_old_style_user_limits ? thd->host_or_ip : thd->priv_host, + (opt_old_style_user_limits ? sctx->user : sctx->priv_user), + (opt_old_style_user_limits ? sctx->host_or_ip : sctx->priv_host), &ur)) DBUG_RETURN(-1); if (thd->user_connect && @@ -439,12 +440,12 @@ int check_user(THD *thd, enum enum_server_command command, DBUG_RETURN(-1); } net_printf_error(thd, ER_ACCESS_DENIED_ERROR, - thd->user, - thd->host_or_ip, + sctx->user, + sctx->host_or_ip, passwd_len ? ER(ER_YES) : ER(ER_NO)); mysql_log.write(thd, COM_CONNECT, ER(ER_ACCESS_DENIED_ERROR), - thd->user, - thd->host_or_ip, + sctx->user, + sctx->host_or_ip, passwd_len ? ER(ER_YES) : ER(ER_NO)); DBUG_RETURN(-1); #endif /* NO_EMBEDDED_ACCESS_CHECKS */ @@ -764,45 +765,46 @@ static int check_connection(THD *thd) NET *net= &thd->net; ulong pkt_len= 0; char *end; + st_security_context *sctx= thd->security_ctx; DBUG_PRINT("info", ("New connection received on %s", vio_description(net->vio))); - if (!thd->host) // If TCP/IP connection + if (!sctx->host) // If TCP/IP connection { char ip[30]; if (vio_peer_addr(net->vio, ip, &thd->peer_port)) return (ER_BAD_HOST_ERROR); - if (!(thd->ip= my_strdup(ip,MYF(0)))) + if (!(sctx->ip= my_strdup(ip,MYF(0)))) return (ER_OUT_OF_RESOURCES); - thd->host_or_ip= thd->ip; + sctx->host_or_ip= sctx->ip; vio_in_addr(net->vio,&thd->remote.sin_addr); if (!(specialflag & SPECIAL_NO_RESOLVE)) { vio_in_addr(net->vio,&thd->remote.sin_addr); - thd->host=ip_to_hostname(&thd->remote.sin_addr,&connect_errors); + sctx->host=ip_to_hostname(&thd->remote.sin_addr,&connect_errors); /* Cut very long hostnames to avoid possible overflows */ - if (thd->host) + if (sctx->host) { - if (thd->host != my_localhost) - thd->host[min(strlen(thd->host), HOSTNAME_LENGTH)]= 0; - thd->host_or_ip= thd->host; + if (sctx->host != my_localhost) + sctx->host[min(strlen(sctx->host), HOSTNAME_LENGTH)]= 0; + sctx->host_or_ip= sctx->host; } if (connect_errors > max_connect_errors) return(ER_HOST_IS_BLOCKED); } DBUG_PRINT("info",("Host: %s ip: %s", - thd->host ? thd->host : "unknown host", - thd->ip ? thd->ip : "unknown ip")); - if (acl_check_host(thd->host,thd->ip)) + sctx->host ? sctx->host : "unknown host", + sctx->ip ? sctx->ip : "unknown ip")); + if (acl_check_host(sctx->host, sctx->ip)) return(ER_HOST_NOT_PRIVILEGED); } else /* Hostname given means that the connection was on a socket */ { - DBUG_PRINT("info",("Host: %s",thd->host)); - thd->host_or_ip= thd->host; - thd->ip= 0; + DBUG_PRINT("info",("Host: %s", sctx->host)); + sctx->host_or_ip= sctx->host; + sctx->ip= 0; /* Reset sin_addr */ bzero((char*) &thd->remote, sizeof(thd->remote)); } @@ -985,9 +987,9 @@ static int check_connection(THD *thd) thd->charset(), &dummy_errors)]= '\0'; user= user_buff; - if (thd->user) - x_free(thd->user); - if (!(thd->user= my_strdup(user, MYF(0)))) + if (sctx->user) + x_free(sctx->user); + if (!(sctx->user= my_strdup(user, MYF(0)))) return (ER_OUT_OF_RESOURCES); return check_user(thd, COM_CONNECT, passwd, passwd_len, db, TRUE); } @@ -1075,13 +1077,14 @@ pthread_handler_decl(handle_one_connection,arg) { int error; NET *net= &thd->net; + st_security_context *sctx= thd->security_ctx; thd->thread_stack= (char*) &thd; net->no_send_error= 0; if ((error=check_connection(thd))) { // Wrong permissions if (error > 0) - net_printf_error(thd, error, thd->host_or_ip); + net_printf_error(thd, error, sctx->host_or_ip); #ifdef __NT__ if (vio_type(net->vio) == VIO_TYPE_NAMEDPIPE) my_sleep(1000); /* must wait after eof() */ @@ -1090,7 +1093,7 @@ pthread_handler_decl(handle_one_connection,arg) goto end_thread; } #ifdef __NETWARE__ - netware_reg_user(thd->ip, thd->user, "MySQL"); + netware_reg_user(sctx->ip, sctx->user, "MySQL"); #endif if (thd->variables.max_join_size == HA_POS_ERROR) thd->options |= OPTION_BIG_SELECTS; @@ -1103,7 +1106,7 @@ pthread_handler_decl(handle_one_connection,arg) thd->set_time(); thd->init_for_queries(); - if (sys_init_connect.value_length && !(thd->master_access & SUPER_ACL)) + if (sys_init_connect.value_length && !(sctx->master_access & SUPER_ACL)) { execute_init_command(thd, &sys_init_connect, &LOCK_sys_init_connect); if (thd->query_error) @@ -1127,8 +1130,8 @@ pthread_handler_decl(handle_one_connection,arg) if (!thd->killed && thd->variables.log_warnings > 1) sql_print_warning(ER(ER_NEW_ABORTING_CONNECTION), thd->thread_id,(thd->db ? thd->db : "unconnected"), - thd->user ? thd->user : "unauthenticated", - thd->host_or_ip, + sctx->user ? sctx->user : "unauthenticated", + sctx->host_or_ip, (net->last_errno ? ER(net->last_errno) : ER(ER_UNKNOWN_ERROR))); net_send_error(thd, net->last_errno, NullS); @@ -1191,7 +1194,8 @@ extern "C" pthread_handler_decl(handle_bootstrap,arg) thd->proc_info=0; thd->version=refresh_version; - thd->priv_user=thd->user=(char*) my_strdup("boot", MYF(MY_WME)); + thd->security_ctx->priv_user= + thd->security_ctx->user= (char*) my_strdup("boot", MYF(MY_WME)); buff= (char*) thd->net.buff; thd->init_for_queries(); @@ -1586,17 +1590,14 @@ bool dispatch_command(enum enum_server_command command, THD *thd, db= db_buff; /* Save user and privileges */ - uint save_master_access= thd->master_access; - uint save_db_access= thd->db_access; uint save_db_length= thd->db_length; - char *save_user= thd->user; - char *save_priv_user= thd->priv_user; char *save_db= thd->db; + st_security_context save_security_ctx= *thd->security_ctx; USER_CONN *save_user_connect= thd->user_connect; - - if (!(thd->user= my_strdup(user, MYF(0)))) + + if (!(thd->security_ctx->user= my_strdup(user, MYF(0)))) { - thd->user= save_user; + thd->security_ctx->user= save_security_ctx.user; my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0)); break; } @@ -1610,12 +1611,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd, /* authentication failure, we shall restore old user */ if (res > 0) my_message(ER_UNKNOWN_COM_ERROR, ER(ER_UNKNOWN_COM_ERROR), MYF(0)); - x_free(thd->user); - thd->user= save_user; - thd->priv_user= save_priv_user; + x_free(thd->security_ctx->user); + *thd->security_ctx= save_security_ctx; thd->user_connect= save_user_connect; - thd->master_access= save_master_access; - thd->db_access= save_db_access; thd->db= save_db; thd->db_length= save_db_length; } @@ -1625,7 +1623,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, if (save_user_connect) decrease_user_connections(save_user_connect); x_free((gptr) save_db); - x_free((gptr) save_user); + x_free((gptr) save_security_ctx.user); } break; } @@ -1967,12 +1965,13 @@ bool dispatch_command(enum enum_server_command command, THD *thd, case COM_PROCESS_INFO: statistic_increment(thd->status_var.com_stat[SQLCOM_SHOW_PROCESSLIST], &LOCK_status); - if (!thd->priv_user[0] && check_global_access(thd,PROCESS_ACL)) + if (!thd->security_ctx->priv_user[0] && + check_global_access(thd, PROCESS_ACL)) break; mysql_log.write(thd,command,NullS); mysqld_list_processes(thd, - thd->master_access & PROCESS_ACL ? - NullS : thd->priv_user, 0); + thd->security_ctx->master_access & PROCESS_ACL ? + NullS : thd->security_ctx->priv_user, 0); break; case COM_PROCESS_KILL: { @@ -2140,7 +2139,8 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, if (!thd->col_access && check_grant_db(thd,db)) { my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), - thd->priv_user, thd->priv_host, db); + thd->security_ctx->priv_user, thd->security_ctx->priv_host, + db); DBUG_RETURN(1); } /* @@ -2398,7 +2398,8 @@ mysql_execute_command(THD *thd) Except for the replication thread and the 'super' users. */ if (opt_readonly && - !(thd->slave_thread || (thd->master_access & SUPER_ACL)) && + !(thd->slave_thread || + (thd->security_ctx->master_access & SUPER_ACL)) && uc_update_queries[lex->sql_command]) { my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--read-only"); @@ -3377,11 +3378,14 @@ end_with_restore_list: res = mysql_drop_index(thd, first_table, &lex->alter_info); break; case SQLCOM_SHOW_PROCESSLIST: - if (!thd->priv_user[0] && check_global_access(thd,PROCESS_ACL)) + if (!thd->security_ctx->priv_user[0] && + check_global_access(thd,PROCESS_ACL)) break; mysqld_list_processes(thd, - thd->master_access & PROCESS_ACL ? NullS : - thd->priv_user,lex->verbose); + (thd->security_ctx->master_access & PROCESS_ACL ? + NullS : + thd->security_ctx->priv_user), + lex->verbose); break; case SQLCOM_SHOW_STORAGE_ENGINES: res= mysqld_show_storage_engines(thd); @@ -3719,7 +3723,7 @@ end_with_restore_list: select_lex->db ? is_schema_db(select_lex->db) : 0)) goto error; - if (thd->user) // If not replication + if (thd->security_ctx->user) // If not replication { LEX_USER *user; uint counter; @@ -3735,9 +3739,9 @@ end_with_restore_list: user->host.str); // Are we trying to change a password of another user DBUG_ASSERT(user->host.str != 0); - if (strcmp(thd->user, user->user.str) || + if (strcmp(thd->security_ctx->user, user->user.str) || my_strcasecmp(system_charset_info, - user->host.str, thd->host_or_ip)) + user->host.str, thd->security_ctx->host_or_ip)) { // TODO: use check_change_password() if (check_acl_user(user, &counter) && user->password.str && @@ -3864,8 +3868,8 @@ end_with_restore_list: } #ifndef NO_EMBEDDED_ACCESS_CHECKS case SQLCOM_SHOW_GRANTS: - if ((thd->priv_user && - !strcmp(thd->priv_user,lex->grant_user->user.str)) || + if ((thd->security_ctx->priv_user && + !strcmp(thd->security_ctx->priv_user, lex->grant_user->user.str)) || !check_access(thd, SELECT_ACL, "mysql",0,1,0,0)) { res = mysql_show_grants(thd,lex->grant_user); @@ -4139,7 +4143,7 @@ end_with_restore_list: else { #ifndef NO_EMBEDDED_ACCESS_CHECKS - st_sp_security_context save_ctx; + st_security_context *save_ctx; #endif ha_rows select_limit; /* bits that should be cleared in thd->server_status */ @@ -4185,23 +4189,23 @@ end_with_restore_list: } #ifndef NO_EMBEDDED_ACCESS_CHECKS - if (check_routine_access(thd, EXECUTE_ACL, - sp->m_db.str, sp->m_name.str, TRUE, 0)) + if (check_routine_access(thd, EXECUTE_ACL, + sp->m_db.str, sp->m_name.str, TRUE, 0) || + sp_change_security_context(thd, sp, &save_ctx)) { #ifndef EMBEDDED_LIBRARY thd->net.no_send_ok= nsok; #endif goto error; } - sp_change_security_context(thd, sp, &save_ctx); - if (save_ctx.changed && - check_routine_access(thd, EXECUTE_ACL, - sp->m_db.str, sp->m_name.str, TRUE, 0)) + if (save_ctx && + check_routine_access(thd, EXECUTE_ACL, + sp->m_db.str, sp->m_name.str, TRUE, 0)) { #ifndef EMBEDDED_LIBRARY thd->net.no_send_ok= nsok; #endif - sp_restore_security_context(thd, sp, &save_ctx); + sp_restore_security_context(thd, save_ctx); goto error; } @@ -4241,7 +4245,7 @@ end_with_restore_list: thd->variables.select_limit= select_limit; #ifndef NO_EMBEDDED_ACCESS_CHECKS - sp_restore_security_context(thd, sp, &save_ctx); + sp_restore_security_context(thd, save_ctx); #endif #ifndef EMBEDDED_LIBRARY @@ -4803,6 +4807,7 @@ bool check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, bool dont_check_global_grants, bool no_errors, bool schema_db) { + st_security_context *sctx= thd->security_ctx; #ifndef NO_EMBEDDED_ACCESS_CHECKS ulong db_access; bool db_is_pattern= test(want_access & GRANT_ACL); @@ -4811,7 +4816,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, const char *db_name; DBUG_ENTER("check_access"); DBUG_PRINT("enter",("db: %s want_access: %lu master_access: %lu", - db ? db : "", want_access, thd->master_access)); + db ? db : "", want_access, sctx->master_access)); if (save_priv) *save_priv=0; else @@ -4833,7 +4838,8 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, { if (!no_errors) my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), - thd->priv_user, thd->priv_host, db_name); + thd->security_ctx->priv_user, + thd->security_ctx->priv_host, db_name); DBUG_RETURN(TRUE); } else @@ -4846,28 +4852,29 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, #ifdef NO_EMBEDDED_ACCESS_CHECKS DBUG_RETURN(0); #else - if ((thd->master_access & want_access) == want_access) + if ((sctx->master_access & want_access) == want_access) { /* If we don't have a global SELECT privilege, we have to get the database specific access rights to be able to handle queries of type UPDATE t1 SET a=1 WHERE b > 0 */ - db_access= thd->db_access; - if (!(thd->master_access & SELECT_ACL) && + db_access= sctx->db_access; + if (!(sctx->master_access & SELECT_ACL) && (db && (!thd->db || db_is_pattern || strcmp(db,thd->db)))) - db_access=acl_get(thd->host, thd->ip, thd->priv_user, db, db_is_pattern); - *save_priv=thd->master_access | db_access; + db_access=acl_get(sctx->host, sctx->ip, sctx->priv_user, db, + db_is_pattern); + *save_priv=sctx->master_access | db_access; DBUG_RETURN(FALSE); } - if (((want_access & ~thd->master_access) & ~(DB_ACLS | EXTRA_ACL)) || + if (((want_access & ~sctx->master_access) & ~(DB_ACLS | EXTRA_ACL)) || ! db && dont_check_global_grants) { // We can never grant this DBUG_PRINT("error",("No possible access")); if (!no_errors) my_error(ER_ACCESS_DENIED_ERROR, MYF(0), - thd->priv_user, - thd->priv_host, + sctx->priv_user, + sctx->priv_host, (thd->password ? ER(ER_YES) : ER(ER_NO))); /* purecov: tested */ @@ -4878,15 +4885,16 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, DBUG_RETURN(FALSE); // Allow select on anything if (db && (!thd->db || db_is_pattern || strcmp(db,thd->db))) - db_access=acl_get(thd->host, thd->ip, thd->priv_user, db, db_is_pattern); + db_access= acl_get(sctx->host, sctx->ip, sctx->priv_user, db, + db_is_pattern); else - db_access=thd->db_access; + db_access= sctx->db_access; DBUG_PRINT("info",("db_access: %lu", db_access)); /* Remove SHOW attribute and access rights we already have */ - want_access &= ~(thd->master_access | EXTRA_ACL); + want_access &= ~(sctx->master_access | EXTRA_ACL); DBUG_PRINT("info",("db_access: %lu want_access: %lu", db_access, want_access)); - db_access= ((*save_priv=(db_access | thd->master_access)) & want_access); + db_access= ((*save_priv=(db_access | sctx->master_access)) & want_access); /* grant_option is set if there exists a single table or column grant */ if (db_access == want_access || @@ -4897,8 +4905,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, DBUG_PRINT("error",("Access denied")); if (!no_errors) my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), - thd->priv_user, - thd->priv_host, + sctx->priv_user, sctx->priv_host, (db ? db : (thd->db ? thd->db : "unknown"))); /* purecov: tested */ @@ -4932,7 +4939,7 @@ bool check_global_access(THD *thd, ulong want_access) return 0; #else char command[128]; - if ((thd->master_access & want_access)) + if ((thd->security_ctx->master_access & want_access)) return 0; get_privilege_desc(command, sizeof(command), want_access); my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), command); @@ -4960,7 +4967,7 @@ check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables, { if (!no_errors) my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), - thd->priv_user, thd->priv_host, + thd->security_ctx->priv_user, thd->security_ctx->priv_host, information_schema_name.str); return TRUE; } @@ -4969,7 +4976,8 @@ check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables, my_tz_check_n_skip_implicit_tables(&tables, thd->lex->time_zone_tables_used)) continue; - if ((thd->master_access & want_access) == (want_access & ~EXTRA_ACL) && + if ((thd->security_ctx->master_access & want_access) == + (want_access & ~EXTRA_ACL) && thd->db) tables->grant.privilege= want_access; else if (tables->db && tables->db == thd->db) @@ -5006,7 +5014,8 @@ check_routine_access(THD *thd, ulong want_access,char *db, char *name, tables->db= db; tables->table_name= tables->alias= name; - if ((thd->master_access & want_access) == want_access && !thd->db) + if ((thd->security_ctx->master_access & want_access) == want_access && + !thd->db) tables->grant.privilege= want_access; else if (check_access(thd,want_access,db,&tables->grant.privilege, 0, no_errors, test(tables->schema_table))) @@ -5039,7 +5048,7 @@ bool check_some_routine_access(THD *thd, const char *db, const char *name, bool is_proc) { ulong save_priv; - if (thd->master_access & SHOW_PROC_ACLS) + if (thd->security_ctx->master_access & SHOW_PROC_ACLS) return FALSE; /* There are no routines in information_schema db. So we can safely @@ -5236,6 +5245,7 @@ void mysql_reset_thd_for_next_command(THD *thd) thd->server_status&= ~ (SERVER_MORE_RESULTS_EXISTS | SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED); + thd->security_ctx= &thd->main_security_ctx; thd->tmp_table_used= 0; if (!thd->in_sub_stmt) { @@ -6760,8 +6770,8 @@ void kill_one_thread(THD *thd, ulong id, bool only_kill_query) VOID(pthread_mutex_unlock(&LOCK_thread_count)); if (tmp) { - if ((thd->master_access & SUPER_ACL) || - !strcmp(thd->user,tmp->user)) + if ((thd->security_ctx->master_access & SUPER_ACL) || + !strcmp(thd->security_ctx->user, tmp->security_ctx->user)) { tmp->awake(only_kill_query ? THD::KILL_QUERY : THD::KILL_CONNECTION); error=0; @@ -7394,14 +7404,14 @@ Item *negate_expression(THD *thd, Item *expr) TRUE Error */ -bool default_view_definer(THD *thd, st_lex_user *definer) +bool default_view_definer(st_security_context *sctx, st_lex_user *definer) { - definer->user.str= thd->priv_user; - definer->user.length= strlen(thd->priv_user); - if (*thd->priv_host != 0) + definer->user.str= sctx->priv_user; + definer->user.length= strlen(sctx->priv_user); + if (*sctx->priv_host != 0) { - definer->host.str= thd->priv_host; - definer->host.length= strlen(thd->priv_host); + definer->host.str= sctx->priv_host; + definer->host.length= strlen(sctx->priv_host); } else { diff --git a/sql/sql_show.cc b/sql/sql_show.cc index e6a81538d90..528876a6bbb 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -415,8 +415,9 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list) bool mysqld_show_create_db(THD *thd, char *dbname, HA_CREATE_INFO *create_info) { + st_security_context *sctx= thd->security_ctx; int length; - char path[FN_REFLEN]; + char path[FN_REFLEN]; char buff[2048]; String buffer(buff, sizeof(buff), system_charset_info); #ifndef NO_EMBEDDED_ACCESS_CHECKS @@ -435,17 +436,17 @@ bool mysqld_show_create_db(THD *thd, char *dbname, } #ifndef NO_EMBEDDED_ACCESS_CHECKS - if (test_all_bits(thd->master_access,DB_ACLS)) + if (test_all_bits(sctx->master_access,DB_ACLS)) db_access=DB_ACLS; else - db_access= (acl_get(thd->host,thd->ip, thd->priv_user,dbname,0) | - thd->master_access); + db_access= (acl_get(sctx->host, sctx->ip, sctx->priv_user, dbname, 0) | + sctx->master_access); if (!(db_access & DB_ACLS) && (!grant_option || check_grant_db(thd,dbname))) { my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), - thd->priv_user, thd->host_or_ip, dbname); + sctx->priv_user, sctx->host_or_ip, dbname); mysql_log.write(thd,COM_INIT_DB,ER(ER_DBACCESS_DENIED_ERROR), - thd->priv_user, thd->host_or_ip, dbname); + sctx->priv_user, sctx->host_or_ip, dbname); DBUG_RETURN(TRUE); } #endif @@ -1185,24 +1186,26 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) THD *tmp; while ((tmp=it++)) { + st_security_context *tmp_sctx= tmp->security_ctx; struct st_my_thread_var *mysys_var; if ((tmp->vio_ok() || tmp->system_thread) && - (!user || (tmp->user && !strcmp(tmp->user,user)))) + (!user || (tmp_sctx->user && !strcmp(tmp_sctx->user, user)))) { - thread_info *thd_info=new thread_info; + thread_info *thd_info= new thread_info; thd_info->thread_id=tmp->thread_id; - thd_info->user=thd->strdup(tmp->user ? tmp->user : - (tmp->system_thread ? - "system user" : "unauthenticated user")); - if (tmp->peer_port && (tmp->host || tmp->ip) && thd->host_or_ip[0]) + thd_info->user= thd->strdup(tmp_sctx->user ? tmp_sctx->user : + (tmp->system_thread ? + "system user" : "unauthenticated user")); + if (tmp->peer_port && (tmp_sctx->host || tmp_sctx->ip) && + thd->security_ctx->host_or_ip[0]) { if ((thd_info->host= thd->alloc(LIST_PROCESS_HOST_LEN+1))) my_snprintf((char *) thd_info->host, LIST_PROCESS_HOST_LEN, - "%s:%u", tmp->host_or_ip, tmp->peer_port); + "%s:%u", tmp_sctx->host_or_ip, tmp->peer_port); } else - thd_info->host= thd->strdup(tmp->host_or_ip); + thd_info->host= thd->strdup(tmp_sctx->host_or_ip); if ((thd_info->db=tmp->db)) // Safe test thd_info->db=thd->strdup(thd_info->db); thd_info->command=(int) tmp->command; @@ -1253,6 +1256,9 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) VOID(pthread_mutex_unlock(&LOCK_thread_count)); thread_info *thd_info; +#ifndef NO_EMBEDDED_ACCESS_CHECKS + st_security_context *sctx; +#endif time_t now= time(0); while ((thd_info=thread_infos.get())) { @@ -1989,7 +1995,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) enum enum_schema_tables schema_table_idx; List bases; List_iterator_fast it(bases); - COND *partial_cond; + COND *partial_cond; + st_security_context *sctx= thd->security_ctx; uint derived_tables= lex->derived_tables; int error= 1; Open_tables_state open_tables_state_backup; @@ -2061,8 +2068,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) #ifndef NO_EMBEDDED_ACCESS_CHECKS if (!check_access(thd,SELECT_ACL, base_name, &thd->col_access, 0, 1, with_i_schema) || - thd->master_access & (DB_ACLS | SHOW_DB_ACL) || - acl_get(thd->host, thd->ip, thd->priv_user, base_name,0) || + sctx->master_access & (DB_ACLS | SHOW_DB_ACL) || + acl_get(sctx->host, sctx->ip, sctx->priv_user, base_name,0) || (grant_option && !check_grant_db(thd, base_name))) #endif { @@ -2194,6 +2201,7 @@ int fill_schema_shemata(THD *thd, TABLE_LIST *tables, COND *cond) bool with_i_schema; HA_CREATE_INFO create; TABLE *table= tables->table; + st_security_context *sctx= thd->security_ctx; DBUG_ENTER("fill_schema_shemata"); if (make_db_list(thd, &files, &idx_field_vals, @@ -2212,8 +2220,8 @@ int fill_schema_shemata(THD *thd, TABLE_LIST *tables, COND *cond) continue; } #ifndef NO_EMBEDDED_ACCESS_CHECKS - if (thd->master_access & (DB_ACLS | SHOW_DB_ACL) || - acl_get(thd->host, thd->ip, thd->priv_user, file_name,0) || + if (sctx->master_access & (DB_ACLS | SHOW_DB_ACL) || + acl_get(sctx->host, sctx->ip, sctx->priv_user, file_name,0) || (grant_option && !check_grant_db(thd, file_name))) #endif { @@ -2814,7 +2822,8 @@ int fill_schema_proc(THD *thd, TABLE_LIST *tables, COND *cond) Open_tables_state open_tables_state_backup; DBUG_ENTER("fill_schema_proc"); - strxmov(definer, thd->priv_user, "@", thd->priv_host, NullS); + strxmov(definer, thd->security_ctx->priv_user, "@", + thd->security_ctx->priv_host, NullS); /* We use this TABLE_LIST instance only for checking of privileges. */ bzero((char*) &proc_tables,sizeof(proc_tables)); proc_tables.db= (char*) "mysql"; diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index 7342c146045..df8de59508d 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -172,7 +172,7 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) stronger test will be removed, the test below will hold. */ if (!trust_routine_creators && mysql_bin_log.is_open() && - !(thd->master_access & SUPER_ACL)) + !(thd->security_ctx->master_access & SUPER_ACL)) { my_message(ER_BINLOG_CREATE_ROUTINE_NEED_SUPER, ER(ER_BINLOG_CREATE_ROUTINE_NEED_SUPER), MYF(0)); diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 5155e605ce0..62b5169a781 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -214,12 +214,13 @@ bool mysql_create_view(THD *thd, - same as current user - current user has SUPER_ACL */ - if (strcmp(lex->create_view_definer->user.str, thd->priv_user) != 0 || + if (strcmp(lex->create_view_definer->user.str, + thd->security_ctx->priv_user) != 0 || my_strcasecmp(system_charset_info, lex->create_view_definer->host.str, - thd->priv_host) != 0) + thd->security_ctx->priv_host) != 0) { - if (!(thd->master_access & SUPER_ACL)) + if (!(thd->security_ctx->master_access & SUPER_ACL)) { my_error(ER_VIEW_OTHER_USER, MYF(0), lex->create_view_definer->user.str, lex->create_view_definer->host.str); @@ -275,7 +276,8 @@ bool mysql_create_view(THD *thd, if (check_some_access(thd, VIEW_ANY_ACL, tbl)) { my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0), - "ANY", thd->priv_user, thd->host_or_ip, tbl->table_name); + "ANY", thd->security_ctx->priv_user, + thd->security_ctx->priv_host, tbl->table_name); res= TRUE; goto err; } @@ -441,7 +443,8 @@ bool mysql_create_view(THD *thd, { /* VIEW column has more privileges */ my_error(ER_COLUMNACCESS_DENIED_ERROR, MYF(0), - "create view", thd->priv_user, thd->host_or_ip, item->name, + "create view", thd->security_ctx->priv_user, + thd->security_ctx->priv_host, item->name, view->table_name); res= TRUE; goto err; @@ -786,7 +789,7 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table) push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_VIEW_FRM_NO_USER, ER(ER_VIEW_FRM_NO_USER), table->db, table->table_name); - if (default_view_definer(thd, &table->definer)) + if (default_view_definer(thd->security_ctx, &table->definer)) goto err; } diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 20a9d945a87..26f8e0dfbd9 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -6554,15 +6554,16 @@ show_param: LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_GRANTS; THD *thd= lex->thd; + st_security_context *sctx= thd->security_ctx; LEX_USER *curr_user; if (!(curr_user= (LEX_USER*) thd->alloc(sizeof(st_lex_user)))) YYABORT; - curr_user->user.str= thd->priv_user; - curr_user->user.length= strlen(thd->priv_user); - if (*thd->priv_host != 0) + curr_user->user.str= sctx->priv_user; + curr_user->user.length= strlen(sctx->priv_user); + if (*sctx->priv_host != 0) { - curr_user->host.str= thd->priv_host; - curr_user->host.length= strlen(thd->priv_host); + curr_user->host.str= sctx->priv_host; + curr_user->host.length= strlen(sctx->priv_host); } else { @@ -7463,14 +7464,15 @@ user: | CURRENT_USER optional_braces { THD *thd= YYTHD; + st_security_context *sctx= thd->security_ctx; if (!($$=(LEX_USER*) thd->alloc(sizeof(st_lex_user)))) YYABORT; - $$->user.str= thd->priv_user; - $$->user.length= strlen(thd->priv_user); - if (*thd->priv_host != 0) + $$->user.str= sctx->priv_user; + $$->user.length= strlen(sctx->priv_user); + if (*sctx->priv_host != 0) { - $$->host.str= thd->priv_host; - $$->host.length= strlen(thd->priv_host); + $$->host.str= sctx->priv_host; + $$->host.length= strlen(sctx->priv_host); } else { @@ -7986,7 +7988,7 @@ option_value: if (!(user=(LEX_USER*) thd->alloc(sizeof(LEX_USER)))) YYABORT; user->host=null_lex_str; - user->user.str=thd->priv_user; + user->user.str=thd->security_ctx->priv_user; thd->lex->var_list.push_back(new set_var_password(user, $3)); } | PASSWORD FOR_SYM user equal text_or_password @@ -8919,7 +8921,8 @@ view_user: if (!(thd->lex->create_view_definer= (LEX_USER*) thd->alloc(sizeof(st_lex_user)))) YYABORT; - if (default_view_definer(thd, thd->lex->create_view_definer)) + if (default_view_definer(thd->security_ctx, + thd->lex->create_view_definer)) YYABORT; } | CURRENT_USER optional_braces @@ -8928,7 +8931,8 @@ view_user: if (!(thd->lex->create_view_definer= (LEX_USER*) thd->alloc(sizeof(st_lex_user)))) YYABORT; - if (default_view_definer(thd, thd->lex->create_view_definer)) + if (default_view_definer(thd->security_ctx, + thd->lex->create_view_definer)) YYABORT; } | DEFINER_SYM EQ ident_or_text '@' ident_or_text From dc6b96dd465783ce2c4c4a596f813b094f2ea081 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Sep 2005 14:32:01 -0500 Subject: [PATCH 014/225] some last minute Windows compile fixes and makefile corrections VC++Files/libmysqld/libmysqld.vcproj: don't recall exactly what this change was. VC++Files/libmysqltest/myTest.vcproj: redirect to client_release and client_debug folders VC++Files/mysql.sln: remove bdb from embedded classic target VC++Files/mysqlserver/mysqlserver.vcproj: redirect to lib_release and lib_debug folders server-tools/instance-manager/mysqlmanager.vcproj: redirect to proper folders sql/ha_federated.cc: fix windows compile problems sql/sql_acl.cc: fix windows compile problems sql/table.cc: fix windows compile problems sql/unireg.cc: fix windows compile problems VC++Files/mysqlserver/dummy.cpp: added new file to make mysqlserver generate a lib --- VC++Files/libmysqld/libmysqld.vcproj | 2 +- VC++Files/libmysqltest/myTest.vcproj | 6 +++--- VC++Files/mysql.sln | 2 -- VC++Files/mysqlserver/dummy.cpp | 0 VC++Files/mysqlserver/mysqlserver.vcproj | 11 +++++++---- server-tools/instance-manager/mysqlmanager.vcproj | 4 ++-- sql/ha_federated.cc | 10 ++++++---- sql/sql_acl.cc | 2 +- sql/table.cc | 2 +- sql/unireg.cc | 4 ++-- 10 files changed, 23 insertions(+), 20 deletions(-) create mode 100755 VC++Files/mysqlserver/dummy.cpp diff --git a/VC++Files/libmysqld/libmysqld.vcproj b/VC++Files/libmysqld/libmysqld.vcproj index 187a63ece38..f1de8649fc7 100755 --- a/VC++Files/libmysqld/libmysqld.vcproj +++ b/VC++Files/libmysqld/libmysqld.vcproj @@ -24,7 +24,7 @@ AdditionalIncludeDirectories="../include,../libmysqld,../sql,../regex,../extra/yassl/include,../bdb/build_win32,../zlib" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;SAFEMALLOC;HAVE_BERKELEY_DB;USE_SYMDIR;SIGNAL_WITH_VIO_CLOSE;HAVE_DLOPEN;EMBEDDED_LIBRARY;HAVE_INNOBASE_DB;USE_TLS;__WIN__" BasicRuntimeChecks="3" - RuntimeLibrary="0" + RuntimeLibrary="1" PrecompiledHeaderFile=".\debug/libmysqld.pch" AssemblerListingLocation=".\debug/" ObjectFile=".\debug/" diff --git a/VC++Files/libmysqltest/myTest.vcproj b/VC++Files/libmysqltest/myTest.vcproj index 06ce20bf021..afc44b482c9 100755 --- a/VC++Files/libmysqltest/myTest.vcproj +++ b/VC++Files/libmysqltest/myTest.vcproj @@ -40,7 +40,7 @@ @@ -63,7 +63,7 @@ @@ -117,6 +117,9 @@ + + diff --git a/server-tools/instance-manager/mysqlmanager.vcproj b/server-tools/instance-manager/mysqlmanager.vcproj index a5ef7cb21e3..ef8b2dd017e 100644 --- a/server-tools/instance-manager/mysqlmanager.vcproj +++ b/server-tools/instance-manager/mysqlmanager.vcproj @@ -12,7 +12,7 @@ @@ -63,7 +63,7 @@ diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index 2590e7881a4..6230fa7bb3c 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -591,9 +591,10 @@ static int parse_url(FEDERATED_SHARE *share, TABLE *table, DBUG_PRINT("info", ("Length %d \n", table->s->connect_string.length)); DBUG_PRINT("info", ("String %.*s \n", table->s->connect_string.length, table->s->connect_string.str)); - share->scheme= my_strdup_with_length(table->s->connect_string.str, - table->s->connect_string.length+1, - MYF(0)); + share->scheme= my_strdup_with_length( + (const byte*)table->s->connect_string.str, + table->s->connect_string.length+1, MYF(0)); + // Add a null for later termination of table name share->scheme[table->s->connect_string.length]= 0; DBUG_PRINT("info",("parse_url alloced share->scheme %lx", share->scheme)); @@ -2626,7 +2627,8 @@ int ha_federated::stash_remote_error() { DBUG_ENTER("ha_federated::stash_remote_error()"); remote_error_number= mysql_errno(mysql); - snprintf(remote_error_buf, FEDERATED_QUERY_BUFFER_SIZE, mysql_error(mysql)); + my_snprintf(remote_error_buf, FEDERATED_QUERY_BUFFER_SIZE, + mysql_error(mysql)); DBUG_RETURN(HA_FEDERATED_ERROR_WITH_REMOTE_SYSTEM); } diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 5e2fd17377a..195d032b91a 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1473,7 +1473,7 @@ bool is_acl_user(const char *host, const char *user) { bool res; VOID(pthread_mutex_lock(&acl_cache->lock)); - res= find_acl_user(host, user, TRUE); + res= find_acl_user(host, user, TRUE) != NULL; VOID(pthread_mutex_unlock(&acl_cache->lock)); return res; } diff --git a/sql/table.cc b/sql/table.cc index 74ffe58e42e..c0d599bd8b4 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -351,7 +351,7 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, char *buff; if (!(buff= alloc_root(&outparam->mem_root, n_length))) goto err; - if (my_pread(file, buff, n_length, record_offset + share->reclength, + if (my_pread(file, (byte*)buff, n_length, record_offset + share->reclength, MYF(MY_NABP))) goto err; share->connect_string.length= uint2korr(buff); diff --git a/sql/unireg.cc b/sql/unireg.cc index 1ac8be0f49a..d297b143d3b 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -153,8 +153,8 @@ bool mysql_create_frm(THD *thd, my_string file_name, { char buff[2]; int2store(buff,create_info->connect_string.length); - if (my_write(file, buff, sizeof(buff), MYF(MY_NABP)) || - my_write(file, create_info->connect_string.str, + if (my_write(file, (const byte*)buff, sizeof(buff), MYF(MY_NABP)) || + my_write(file, (const byte*)create_info->connect_string.str, create_info->connect_string.length, MYF(MY_NABP))) goto err; } From 28028b5f07b0247b6b70ba96179acd96f9fb2f09 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Sep 2005 01:19:43 +0400 Subject: [PATCH 015/225] Fix bug #12291 Table wasn't reinited for index scan after sequential scan Optimizer did choose "Range checked for each record" for one of the tables. For first few loops over that table it choose sequential access, on later stage it choose to use index. Because table was previously initialized for sequential access, it skips intitialization for index access, and when server tries to retrieve data error occurs. QUICK_RANGE_SELECT::init() changes so if file already initialized for sequential access, it calls ha_rnd_end() and initializes file for index access. sql/opt_range.cc: Fix bug #12291 Table wasn't reinited for index scan after sequential scan mysql-test/t/select.test: Test case for bug #12291 Table wasn't reinited for index scan after sequential scan mysql-test/r/select.result: Test case for bug #12291 Table wasn't reinited for index scan after sequential scan --- mysql-test/r/select.result | 17 +++++++++++++++++ mysql-test/t/select.test | 12 ++++++++++++ sql/opt_range.cc | 7 +++---- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index d7de9b6509b..e3af75a4573 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2943,3 +2943,20 @@ select * from t1 join t2 join t4 using (c); c a b 1 1 1 drop table t1, t2, t3, t4; +create table t1(x int, y int); +create table t2(x int, y int); +create table t3(x int, primary key(x)); +insert into t1 values (1, 1), (2, 1), (3, 1), (4, 3), (5, 6), (6, 6); +insert into t2 values (1, 1), (2, 1), (3, 3), (4, 6), (5, 6); +insert into t3 values (1), (2), (3), (4), (5); +select t1.x, t3.x from t1, t2, t3 where t1.x = t2.x and t3.x >= t1.y and t3.x <= t2.y; +x x +1 1 +2 1 +3 1 +3 2 +3 3 +4 3 +4 4 +4 5 +drop table t1,t2,t3; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 61242b3d96e..620a9fb55b7 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2523,3 +2523,15 @@ select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); select * from t1 join t2 join t4 using (c); drop table t1, t2, t3, t4; + +# +# Bug #12291 Table wasn't reinited for index scan after sequential scan +# +create table t1(x int, y int); +create table t2(x int, y int); +create table t3(x int, primary key(x)); +insert into t1 values (1, 1), (2, 1), (3, 1), (4, 3), (5, 6), (6, 6); +insert into t2 values (1, 1), (2, 1), (3, 3), (4, 6), (5, 6); +insert into t3 values (1), (2), (3), (4), (5); +select t1.x, t3.x from t1, t2, t3 where t1.x = t2.x and t3.x >= t1.y and t3.x <= t2.y; +drop table t1,t2,t3; diff --git a/sql/opt_range.cc b/sql/opt_range.cc index cb250251155..edb4289e76f 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -750,10 +750,9 @@ int QUICK_RANGE_SELECT::init() { DBUG_ENTER("QUICK_RANGE_SELECT::init"); - if (file->inited == handler::NONE) - DBUG_RETURN(error= file->ha_index_init(index)); - error= 0; - DBUG_RETURN(0); + if (file->inited != handler::NONE) + file->ha_index_or_rnd_end(); + DBUG_RETURN(error= file->ha_index_init(index)); } From 627bf43d9ff9c4b1b5cde1463cf5d03cf5e92c3d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Sep 2005 01:56:16 +0400 Subject: [PATCH 016/225] Fixes bug #12929. Uses my_cgets instead of _cgets function, thus eliminating a restriction to 255 chars for editable buffer. VC++Files/mysys/mysys.dsp: Added my_conio.c VC++Files/mysys/mysys_ia64.dsp: Added my_conio.c include/my_sys.h: Added declarations for my_conio.c functions mysys/my_conio.c: Added _cgets() replacement that is not limited to 255 chars retrieval from win32 console. --- VC++Files/mysys/mysys.dsp | 4 + VC++Files/mysys/mysys_ia64.dsp | 4 + client/mysql.cc | 31 ++++++- include/my_sys.h | 3 + mysys/my_conio.c | 146 +++++++++++++++++++++++++++++++++ 5 files changed, 185 insertions(+), 3 deletions(-) create mode 100644 mysys/my_conio.c diff --git a/VC++Files/mysys/mysys.dsp b/VC++Files/mysys/mysys.dsp index f47203d37bf..2f3d7bb272c 100644 --- a/VC++Files/mysys/mysys.dsp +++ b/VC++Files/mysys/mysys.dsp @@ -361,6 +361,10 @@ SOURCE=.\my_compress.c # End Source File # Begin Source File +SOURCE=.\my_conio.c +# End Source File +# Begin Source File + SOURCE=.\my_copy.c # End Source File # Begin Source File diff --git a/VC++Files/mysys/mysys_ia64.dsp b/VC++Files/mysys/mysys_ia64.dsp index a0877457286..622ae1d5bce 100644 --- a/VC++Files/mysys/mysys_ia64.dsp +++ b/VC++Files/mysys/mysys_ia64.dsp @@ -362,6 +362,10 @@ SOURCE=.\my_compress.c # End Source File # Begin Source File +SOURCE=.\my_conio.c +# End Source File +# Begin Source File + SOURCE=.\my_copy.c # End Source File # Begin Source File diff --git a/client/mysql.cc b/client/mysql.cc index 51822b64c82..be1541faaf5 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -938,10 +938,15 @@ static int get_options(int argc, char **argv) static int read_lines(bool execute_commands) { -#if defined( __WIN__) || defined(OS2) || defined(__NETWARE__) +#if defined(OS2) || defined(__NETWARE__) char linebuffer[254]; String buffer; #endif +#if defined(__WIN__) + String tmpbuf; + String buffer; +#endif + char *line; char in_string=0; ulong line_number=0; @@ -972,7 +977,7 @@ static int read_lines(bool execute_commands) #if defined( __WIN__) || defined(OS2) || defined(__NETWARE__) tee_fputs(prompt, stdout); -#ifdef __NETWARE__ +#if defined(__NETWARE__) line=fgets(linebuffer, sizeof(linebuffer)-1, stdin); /* Remove the '\n' */ if (line) @@ -981,7 +986,22 @@ static int read_lines(bool execute_commands) if (p != NULL) *p = '\0'; } -#else +#elif defined(__WIN__) + if (!tmpbuf.is_alloced()) + tmpbuf.alloc(65535); + buffer.length(0); + unsigned long clen; + do + { + line= my_cgets(tmpbuf.c_ptr(), tmpbuf.alloced_length(), &clen); + buffer.append(line, clen); + /* + if we got buffer fully filled than there is a chance that + something else is still in console input buffer + */ + } while (tmpbuf.alloced_length() <= clen + 1); + line= buffer.c_ptr(); +#else /* OS2 */ buffer.length(0); /* _cgets() expects the buffer size - 3 as the first byte */ linebuffer[0]= (char) sizeof(linebuffer) - 3; @@ -1057,9 +1077,14 @@ static int read_lines(bool execute_commands) status.exit_status=0; } } + #if defined( __WIN__) || defined(OS2) || defined(__NETWARE__) buffer.free(); #endif +#if defined( __WIN__) + tmpbuf.free(); +#endif + return status.exit_status; } diff --git a/include/my_sys.h b/include/my_sys.h index 8752aa30772..ab0efe247ef 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -804,6 +804,9 @@ int my_security_attr_create(SECURITY_ATTRIBUTES **psa, const char **perror, void my_security_attr_free(SECURITY_ATTRIBUTES *sa); +/* implemented in my_conio.c */ +char* my_cgets(char *string, unsigned long clen, unsigned long* plen); + #endif #ifdef __NETWARE__ void netware_reg_user(const char *ip, const char *user, diff --git a/mysys/my_conio.c b/mysys/my_conio.c new file mode 100644 index 00000000000..2bf2c1cf1c0 --- /dev/null +++ b/mysys/my_conio.c @@ -0,0 +1,146 @@ +/* Copyright (C) 2000 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include "mysys_priv.h" + +#ifdef __WIN__ +static int my_coninpfh= 0; /* console input */ + +#define pthread_auto_mutex_decl(name) \ + HANDLE __h##name= NULL; \ + char __p##name[sizeof(#name)+16]; + +#define pthread_auto_mutex_lock(name, proc, time) \ + sprintf(__p##name, "%s-%08X", #name, (proc)); \ + __h##name= CreateMutex(NULL, FALSE, __p##name); \ + WaitForSingleObject(__h##name, (time)); + +#define pthread_auto_mutex_free(name) \ + if (__h##name) \ + { \ + ReleaseMutex(__h##name); \ + CloseHandle(__h##name); \ + } + + +/* + char* my_cgets(char *string, unsigned long clen, unsigned long* plen) + + NOTES + Replaces _cgets from libc to support input of more than 255 chars. + Reads from the console via ReadConsole into buffer which + should be at least clen characters. + Actual length of string returned in plen. + + WARNING + my_cgets() does NOT check the pushback character buffer (i.e., _chbuf). + Thus, my_cgets() will not return any character that is pushed back by + the _ungetch() call. + + RETURN + string pointer ok + NULL Error + +*/ +char* my_cgets(char *buffer, unsigned long clen, unsigned long* plen) +{ + ULONG state; + char *result; + CONSOLE_SCREEN_BUFFER_INFO csbi; + + pthread_auto_mutex_decl(my_conio_mutex); + + /* lock the console */ + pthread_auto_mutex_lock(my_conio_mutex, GetCurrentProcessId(), INFINITE); + + /* init console input */ + if (my_coninpfh == 0) + { + /* same handle will be used until process termination */ + my_coninpfh= (int)CreateFile("CONIN$", GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, 0, NULL); + } + + if (my_coninpfh == -1) + { + /* unlock the console */ + pthread_auto_mutex_free(my_conio_mutex); + return(NULL); + } + + GetConsoleMode((HANDLE)my_coninpfh, &state); + SetConsoleMode((HANDLE)my_coninpfh, ENABLE_LINE_INPUT | + ENABLE_PROCESSED_INPUT | ENABLE_ECHO_INPUT); + + GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi); + + /* + there is no known way to determine allowed buffer size for input + though it is known it should not be more than 64K + so we cut 64K and try first size of screen buffer + if it is still to large we cut half of it and try again + later we may want to cycle from min(clen, 65535) to allowed size + with small decrement to determine exact allowed buffer + */ + clen= min(clen, 65535); + do + { + clen= min(clen, (unsigned long)csbi.dwSize.X*csbi.dwSize.Y); + if (!ReadConsole((HANDLE)my_coninpfh, (LPVOID)buffer, clen - 1, plen, NULL)) + { + result= NULL; + clen>>= 1; + } + else + { + result= buffer; + break; + } + } + while (GetLastError() == ERROR_NOT_ENOUGH_MEMORY); + + + if (result != NULL) + { + if (buffer[*plen - 2] == '\r') + { + *plen= *plen - 2; + } + else + { + if (buffer[*plen - 1] == '\r') + { + char tmp[3]; + int tmplen= sizeof(tmp); + + *plen= *plen - 1; + /* read /n left in the buffer */ + ReadConsole((HANDLE)my_coninpfh, (LPVOID)tmp, tmplen, &tmplen, NULL); + } + } + buffer[*plen]= '\0'; + } + + SetConsoleMode((HANDLE)my_coninpfh, state); + /* unlock the console */ + pthread_auto_mutex_free(my_conio_mutex); + + return result; +} + +#endif /* __WIN__ */ From 2b6f6d6ce6e6371df91470af2777950a22c9ec62 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Sep 2005 00:15:47 +0200 Subject: [PATCH 017/225] compare host names by address lookup instead of simple string comparison --- ndb/tools/ndb_config.cpp | 48 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/ndb/tools/ndb_config.cpp b/ndb/tools/ndb_config.cpp index 725249a5af5..290dd440479 100644 --- a/ndb/tools/ndb_config.cpp +++ b/ndb/tools/ndb_config.cpp @@ -23,6 +23,8 @@ #include #include +#include + #include #include #include @@ -127,6 +129,11 @@ struct Match virtual int eval(NdbMgmHandle, const Iter&); }; +struct HostMatch : public Match +{ + virtual int eval(NdbMgmHandle, const Iter&); +}; + struct Apply { Apply() {} @@ -297,9 +304,10 @@ parse_where(Vector& where, int &argc, char**& argv) Match m; if(g_host) { - m.m_key = CFG_NODE_HOST; - m.m_value.assfmt("%s", g_host); - where.push_back(new Match(m)); + HostMatch *m = new HostMatch; + m->m_key = CFG_NODE_HOST; + m->m_value.assfmt("%s", g_host); + where.push_back(m); } if(g_type) @@ -375,6 +383,40 @@ Match::eval(NdbMgmHandle h, const Iter& iter) return 1; } +int +HostMatch::eval(NdbMgmHandle h, const Iter& iter) +{ + const char* valc; + + if(iter.get(m_key, &valc) == 0) + { + struct hostent *h1, *h2; + + h1 = gethostbyname(m_value.c_str()); + if (h1 == NULL) { + return 0; + } + + h2 = gethostbyname(valc); + if (h2 == NULL) { + return 0; + } + + if (h1->h_addrtype != h2->h_addrtype) { + return 0; + } + + if (h1->h_length != h2->h_length) + { + return 0; + } + + return 0 == memcmp(h1->h_addr, h2->h_addr, h1->h_length); + } + + return 0; +} + int Apply::apply(NdbMgmHandle h, const Iter& iter) { From 149b3761f26080afa7cfb3d289cc30b47918943e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Sep 2005 10:24:37 +0500 Subject: [PATCH 018/225] Bug#10504 Character set does not support traditional mode ctype_utf8.result, ctype_utf8.test: adding test case. password.c, mysql_com.h Changeing octet2hex availability from static to public. item_strfunc.cc: Result string is now checked to be well-formed. Warning/error is generated, depending on sql_mode. include/mysql_com.h: Bug#10504 Character set does not support traditional mode Changeing octet2hex from static to public. sql/item_strfunc.cc: Result string is now checked to be well-formed. Warning/error is generated, depending on sql_mode. sql/password.c: Changeing octet2hex from static to public. mysql-test/t/ctype_utf8.test: adding test case. mysql-test/r/ctype_utf8.result: adding test case. --- include/mysql_com.h | 1 + mysql-test/r/ctype_utf8.result | 33 +++++++++++++++++++++++++++++++++ mysql-test/t/ctype_utf8.test | 16 ++++++++++++++++ sql/item_strfunc.cc | 27 +++++++++++++++++++++++++++ sql/password.c | 4 ++-- 5 files changed, 79 insertions(+), 2 deletions(-) diff --git a/include/mysql_com.h b/include/mysql_com.h index 969fba4a433..c4eb33a6c9a 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -409,6 +409,7 @@ my_bool check_scramble(const char *reply, const char *message, const unsigned char *hash_stage2); void get_salt_from_password(unsigned char *res, const char *password); void make_password_from_salt(char *to, const unsigned char *hash_stage2); +void octet2hex(char *to, const unsigned char *str, unsigned int len); /* end of password.c */ diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 844750e3fed..eeeb0897b88 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -1028,6 +1028,39 @@ xxx yyy DROP TABLE t1; set names utf8; +select hex(char(1)); +hex(char(1)) +01 +select char(0xd1,0x8f); +char(0xd1,0x8f) +я▐ +select char(0xff,0x8f); +char(0xff,0x8f) +Ъ▐ +Warnings: +Warning 1300 Invalid utf8 character string: 'FF8F' +set sql_mode=traditional; +select char(0xff,0x8f); +char(0xff,0x8f) +NULL +Warnings: +Error 1300 Invalid utf8 character string: 'FF8F' +select char(195); +char(195) +NULL +Warnings: +Error 1300 Invalid utf8 character string: 'C3' +select char(196); +char(196) +NULL +Warnings: +Error 1300 Invalid utf8 character string: 'C4' +select char(2557); +char(2557) +NULL +Warnings: +Error 1300 Invalid utf8 character string: 'FD' +set names utf8; create table t1 (a char(1)) default character set utf8; create table t2 (a char(1)) default character set utf8; insert into t1 values('a'),('a'),(0xE38182),(0xE38182); diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 3a89da3a41e..920506a0eb9 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -864,6 +864,22 @@ SELECT DISTINCT id FROM t1 ORDER BY id; DROP TABLE t1; +# +# Bugs#10504: Character set does not support traditional mode +# +set names utf8; +# correct value +select hex(char(1)); +select char(0xd1,0x8f); +# incorrect value: return with warning +select char(0xff,0x8f); +# incorrect value in strict mode: return NULL with "Error" level warning +set sql_mode=traditional; +select char(0xff,0x8f); +select char(195); +select char(196); +select char(2557); + # # Bug#12891: UNION doesn't return DISTINCT result for multi-byte characters # diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 4fd33c06095..309e6dcdcd2 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1980,6 +1980,33 @@ b1: str->append((char)(num>>8)); } str->set_charset(collation.collation); str->realloc(str->length()); // Add end 0 (for Purify) + + /* Check whether we got a well-formed string */ + CHARSET_INFO *cs= collation.collation; + int well_formed_error; + uint wlen= cs->cset->well_formed_len(cs, + str->ptr(), str->ptr() + str->length(), + str->length(), &well_formed_error); + if (wlen < str->length()) + { + THD *thd= current_thd; + char hexbuf[7]; + enum MYSQL_ERROR::enum_warning_level level; + uint diff= str->length() - wlen; + set_if_smaller(diff, 3); + octet2hex(hexbuf, (const uchar*) str->ptr() + wlen, diff); + if (thd->variables.sql_mode & + (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)) + { + level= MYSQL_ERROR::WARN_LEVEL_ERROR; + null_value= 1; + str= 0; + } + else + level= MYSQL_ERROR::WARN_LEVEL_WARN; + push_warning_printf(thd, level, ER_INVALID_CHARACTER_STRING, + ER(ER_INVALID_CHARACTER_STRING), cs->csname, hexbuf); + } return str; } diff --git a/sql/password.c b/sql/password.c index 60cc0ac0c97..aa05be8c740 100644 --- a/sql/password.c +++ b/sql/password.c @@ -318,8 +318,8 @@ void create_random_string(char *to, uint length, struct rand_struct *rand_st) str, len IN the beginning and the length of the input string */ -static void -octet2hex(char *to, const uint8 *str, uint len) +void +octet2hex(char *to, const unsigned char *str, uint len) { const uint8 *str_end= str + len; for (; str != str_end; ++str) From e1ff851ec94eefa820335a09577b50df783486ff Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Sep 2005 09:15:45 +0300 Subject: [PATCH 019/225] fixed length detection sql/sql_show.cc: fixed typo fixed length detection --- mysql-test/r/information_schema.result | 16 ++++++++-------- sql/sql_show.cc | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index d506aa69488..1407c17f623 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -361,11 +361,11 @@ show keys from v4; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment select * from information_schema.views where TABLE_NAME like "v%"; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE -NULL test v0 select sql_no_cache `schemata`.`SCHEMA_NAME` AS `c` from `information_schema`.`schemata` NONE NO root@localhos DEFINER -NULL test v1 select sql_no_cache `tables`.`TABLE_NAME` AS `c` from `information_schema`.`tables` where (`tables`.`TABLE_NAME` = _utf8'v1') NONE NO root@localhos DEFINER -NULL test v2 select sql_no_cache `columns`.`COLUMN_NAME` AS `c` from `information_schema`.`columns` where (`columns`.`TABLE_NAME` = _utf8'v2') NONE NO root@localhos DEFINER -NULL test v3 select sql_no_cache `character_sets`.`CHARACTER_SET_NAME` AS `c` from `information_schema`.`character_sets` where (`character_sets`.`CHARACTER_SET_NAME` like _utf8'latin1%') NONE NO root@localhos DEFINER -NULL test v4 select sql_no_cache `collations`.`COLLATION_NAME` AS `c` from `information_schema`.`collations` where (`collations`.`COLLATION_NAME` like _utf8'latin1%') NONE NO root@localhos DEFINER +NULL test v0 select sql_no_cache `schemata`.`SCHEMA_NAME` AS `c` from `information_schema`.`schemata` NONE NO root@localhost DEFINER +NULL test v1 select sql_no_cache `tables`.`TABLE_NAME` AS `c` from `information_schema`.`tables` where (`tables`.`TABLE_NAME` = _utf8'v1') NONE NO root@localhost DEFINER +NULL test v2 select sql_no_cache `columns`.`COLUMN_NAME` AS `c` from `information_schema`.`columns` where (`columns`.`TABLE_NAME` = _utf8'v2') NONE NO root@localhost DEFINER +NULL test v3 select sql_no_cache `character_sets`.`CHARACTER_SET_NAME` AS `c` from `information_schema`.`character_sets` where (`character_sets`.`CHARACTER_SET_NAME` like _utf8'latin1%') NONE NO root@localhost DEFINER +NULL test v4 select sql_no_cache `collations`.`COLLATION_NAME` AS `c` from `information_schema`.`collations` where (`collations`.`COLLATION_NAME` like _utf8'latin1%') NONE NO root@localhost DEFINER drop view v0, v1, v2, v3, v4; create table t1 (a int); grant select,update,insert on t1 to mysqltest_1@localhost; @@ -456,9 +456,9 @@ create view v2 (c) as select a from t1 WITH LOCAL CHECK OPTION; create view v3 (c) as select a from t1 WITH CASCADED CHECK OPTION; select * from information_schema.views; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE -NULL test v1 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhos DEFINER -NULL test v2 select `test`.`t1`.`a` AS `c` from `test`.`t1` LOCAL YES root@localhos DEFINER -NULL test v3 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhos DEFINER +NULL test v1 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER +NULL test v2 select `test`.`t1`.`a` AS `c` from `test`.`t1` LOCAL YES root@localhost DEFINER +NULL test v3 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER grant select (a) on test.t1 to joe@localhost with grant option; select * from INFORMATION_SCHEMA.COLUMN_PRIVILEGES; GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 929bf36d305..2b941474de8 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2952,7 +2952,7 @@ static int get_schema_views_record(THD *thd, struct st_table_list *tables, CHARSET_INFO *cs= system_charset_info; DBUG_ENTER("get_schema_views_record"); char definer[HOSTNAME_LENGTH + USERNAME_LENGTH + 2]; - uint defiler_len; + uint definer_len; if (!res) { if (tables->view) @@ -2977,9 +2977,9 @@ static int get_schema_views_record(THD *thd, struct st_table_list *tables, table->field[5]->store(STRING_WITH_LEN("YES"), cs); else table->field[5]->store(STRING_WITH_LEN("NO"), cs); - defiler_len= (strxmov(definer, tables->definer.user.str, "@", - tables->definer.host.str, NullS) - definer) - 1; - table->field[6]->store(definer, defiler_len, cs); + definer_len= (strxmov(definer, tables->definer.user.str, "@", + tables->definer.host.str, NullS) - definer); + table->field[6]->store(definer, definer_len, cs); if (tables->view_suid) table->field[7]->store(STRING_WITH_LEN("DEFINER"), cs); else From 979563399be65bffbf91db244717e777abeaca63 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Sep 2005 11:26:34 +0200 Subject: [PATCH 020/225] ndb impl support for querying resource usage in ndb api to help track down mem leaks ndb/include/ndbapi/Ndb.hpp: Impl. reporting of free list usage Put free list into handler class ndb/include/ndbapi/NdbBlob.hpp: Impl. reporting of free list usage Put free list into handler class ndb/include/ndbapi/NdbConnection.hpp: Impl. reporting of free list usage Put free list into handler class ndb/include/ndbapi/NdbIndexOperation.hpp: Impl. reporting of free list usage Put free list into handler class ndb/include/ndbapi/NdbIndexScanOperation.hpp: Impl. reporting of free list usage Put free list into handler class ndb/include/ndbapi/NdbOperation.hpp: Impl. reporting of free list usage Put free list into handler class ndb/include/ndbapi/NdbRecAttr.hpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/NdbApiSignal.cpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/NdbApiSignal.hpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/NdbBlob.cpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/NdbImpl.hpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/NdbRecAttr.cpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/NdbUtil.cpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/NdbUtil.hpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/Ndbif.cpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/Ndbinit.cpp: Impl. reporting of free list usage Put free list into handler class ndb/src/ndbapi/Ndblist.cpp: Impl. reporting of free list usage Put free list into handler class ndb/tools/restore/Restore.cpp: Impl. reporting of free list usage Put free list into handler class --- ndb/include/ndbapi/Ndb.hpp | 28 +- ndb/include/ndbapi/NdbBlob.hpp | 6 +- ndb/include/ndbapi/NdbConnection.hpp | 12 +- ndb/include/ndbapi/NdbIndexOperation.hpp | 1 + ndb/include/ndbapi/NdbIndexScanOperation.hpp | 2 + ndb/include/ndbapi/NdbOperation.hpp | 8 +- ndb/include/ndbapi/NdbRecAttr.hpp | 7 +- ndb/src/ndbapi/NdbApiSignal.cpp | 19 + ndb/src/ndbapi/NdbApiSignal.hpp | 3 +- ndb/src/ndbapi/NdbBlob.cpp | 2 +- ndb/src/ndbapi/NdbImpl.hpp | 119 +++++ ndb/src/ndbapi/NdbRecAttr.cpp | 4 +- ndb/src/ndbapi/NdbUtil.cpp | 16 +- ndb/src/ndbapi/NdbUtil.hpp | 40 +- ndb/src/ndbapi/Ndbif.cpp | 9 - ndb/src/ndbapi/Ndbinit.cpp | 39 -- ndb/src/ndbapi/Ndblist.cpp | 519 +++++-------------- ndb/tools/restore/Restore.cpp | 2 +- 18 files changed, 348 insertions(+), 488 deletions(-) diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp index 766409d64e2..e905a304c97 100644 --- a/ndb/include/ndbapi/Ndb.hpp +++ b/ndb/include/ndbapi/Ndb.hpp @@ -882,10 +882,10 @@ class BaseString; class NdbEventOperation; class NdbBlob; class NdbReceiver; +template struct Ndb_free_list_t; typedef void (* NdbEventCallback)(NdbEventOperation*, Ndb*, void*); - #if defined NDB_OSE /** * Default time to wait for response after request has been sent to @@ -1386,8 +1386,20 @@ public: */ NdbConnection* hupp( NdbConnection* ); Uint32 getReference() const { return theMyRef;} + + struct Free_list_usage + { + const char * m_name; + Uint32 m_created; + Uint32 m_free; + Uint32 m_sizeof; + }; + + Free_list_usage * get_free_list_usage(Free_list_usage*); #endif + + /***************************************************************************** * These are service routines used by the other classes in the NDBAPI. ****************************************************************************/ @@ -1562,22 +1574,8 @@ private: class NdbDictionaryImpl* theDictionary; class NdbGlobalEventBufferHandle* theGlobalEventBufferHandle; - NdbConnection* theConIdleList; // First connection in idle list. - - NdbOperation* theOpIdleList; // First operation in the idle list. - - NdbIndexScanOperation* theScanOpIdleList; // First scan operation in the idle list. - NdbIndexOperation* theIndexOpIdleList; // First index operation in the idle list. NdbConnection* theTransactionList; NdbConnection** theConnectionArray; - NdbRecAttr* theRecAttrIdleList; - NdbApiSignal* theSignalIdleList; // First signal in idlelist. - NdbLabel* theLabelList; // First label descriptor in list - NdbBranch* theBranchList; // First branch descriptor in list - NdbSubroutine* theSubroutineList; // First subroutine descriptor in - NdbCall* theCallList; // First call descriptor in list - NdbReceiver* theScanList; - NdbBlob* theNdbBlobIdleList; Uint32 theMyRef; // My block reference Uint32 theNode; // The node number of our node diff --git a/ndb/include/ndbapi/NdbBlob.hpp b/ndb/include/ndbapi/NdbBlob.hpp index b145c69b04b..a04f4f72bc9 100644 --- a/ndb/include/ndbapi/NdbBlob.hpp +++ b/ndb/include/ndbapi/NdbBlob.hpp @@ -262,7 +262,7 @@ private: // for keeping in lists NdbBlob* theNext; // initialization - NdbBlob(); + NdbBlob(Ndb*); void init(); void release(); // classify operations @@ -314,6 +314,10 @@ private: int getOperationType() const; friend class NdbOut& operator<<(NdbOut&, const NdbBlob&); #endif + + void next(NdbBlob* obj) { theNext= obj;} + NdbBlob* next() { return theNext;} + friend struct Ndb_free_list_t; }; #endif diff --git a/ndb/include/ndbapi/NdbConnection.hpp b/ndb/include/ndbapi/NdbConnection.hpp index 2ab6f7d6f64..75c3f80121d 100644 --- a/ndb/include/ndbapi/NdbConnection.hpp +++ b/ndb/include/ndbapi/NdbConnection.hpp @@ -18,8 +18,9 @@ #define NdbConnection_H #include -#include -#include +#include "NdbError.hpp" +#include "NdbDictionary.hpp" +#include "Ndb.hpp" class NdbConnection; class NdbOperation; @@ -465,10 +466,10 @@ private: /************************************************************************** * These are the create and delete methods of this class. * **************************************************************************/ - NdbConnection(Ndb* aNdb); - ~NdbConnection(); + NdbConnection* next(); // Returns the next pointer + void next(NdbConnection*); // Sets the next pointer void init(); // Initialize connection object for new transaction @@ -487,8 +488,6 @@ private: int getTC_ConnectPtr(); // Gets TC Connect pointer void setBuddyConPtr(Uint32); // Sets Buddy Con Ptr Uint32 getBuddyConPtr(); // Gets Buddy Con Ptr - NdbConnection* next(); // Returns the next pointer - void next(NdbConnection*); // Sets the next pointer enum ConStatusType { NotConnected, @@ -691,6 +690,7 @@ private: void define_scan_op(NdbIndexScanOperation*); friend class HugoOperations; + friend struct Ndb_free_list_t; }; inline diff --git a/ndb/include/ndbapi/NdbIndexOperation.hpp b/ndb/include/ndbapi/NdbIndexOperation.hpp index 1472f1b249e..2ab63cfc4f9 100644 --- a/ndb/include/ndbapi/NdbIndexOperation.hpp +++ b/ndb/include/ndbapi/NdbIndexOperation.hpp @@ -200,6 +200,7 @@ private: Uint32 m_theIndexDefined[NDB_MAX_ATTRIBUTES_IN_INDEX][3]; Uint32 m_theIndexLen; // Length of the index in words Uint32 m_theNoOfIndexDefined; // The number of index attributes + friend struct Ndb_free_list_t; }; #endif diff --git a/ndb/include/ndbapi/NdbIndexScanOperation.hpp b/ndb/include/ndbapi/NdbIndexScanOperation.hpp index a3388f62f58..7cd2daea6a6 100644 --- a/ndb/include/ndbapi/NdbIndexScanOperation.hpp +++ b/ndb/include/ndbapi/NdbIndexScanOperation.hpp @@ -132,6 +132,8 @@ private: int compare(Uint32 key, Uint32 cols, const NdbReceiver*, const NdbReceiver*); Uint32 m_sort_columns; + + friend struct Ndb_free_list_t; }; #endif diff --git a/ndb/include/ndbapi/NdbOperation.hpp b/ndb/include/ndbapi/NdbOperation.hpp index 46d4ddab0f5..46e44226e18 100644 --- a/ndb/include/ndbapi/NdbOperation.hpp +++ b/ndb/include/ndbapi/NdbOperation.hpp @@ -22,6 +22,7 @@ #include "NdbError.hpp" #include "NdbReceiver.hpp" #include "NdbDictionary.hpp" +#include "Ndb.hpp" class Ndb; class NdbApiSignal; @@ -723,8 +724,6 @@ protected: /****************************************************************************** * These are the methods used to create and delete the NdbOperation objects. *****************************************************************************/ - NdbOperation(Ndb* aNdb); - virtual ~NdbOperation(); bool needReply(); /****************************************************************************** @@ -736,8 +735,9 @@ protected: int init(const class NdbTableImpl*, NdbConnection* aCon); void initInterpreter(); + NdbOperation(Ndb* aNdb); + virtual ~NdbOperation(); void next(NdbOperation*); // Set next pointer - NdbOperation* next(); // Get next pointer enum OperationStatus{ @@ -925,6 +925,8 @@ protected: * IgnoreError on connection level. */ Int8 m_abortOption; + + friend struct Ndb_free_list_t; }; #ifdef NDB_NO_DROPPED_SIGNAL diff --git a/ndb/include/ndbapi/NdbRecAttr.hpp b/ndb/include/ndbapi/NdbRecAttr.hpp index 05635a99385..741ea3d52e2 100644 --- a/ndb/include/ndbapi/NdbRecAttr.hpp +++ b/ndb/include/ndbapi/NdbRecAttr.hpp @@ -17,7 +17,8 @@ #ifndef NdbRecAttr_H #define NdbRecAttr_H -#include +#include "NdbDictionary.hpp" +#include "Ndb.hpp" class NdbOperation; @@ -242,7 +243,6 @@ public: */ ~NdbRecAttr(); private: - NdbRecAttr(); Uint32 attrId() const; /* Get attribute id */ bool setNULL(); /* Set NULL indicator */ @@ -251,6 +251,7 @@ private: void release(); /* Release memory if allocated */ void init(); /* Initialise object when allocated */ + NdbRecAttr(Ndb*); void next(NdbRecAttr* aRecAttr); NdbRecAttr* next() const; @@ -273,6 +274,8 @@ private: Uint32 theAttrSize; Uint32 theArraySize; const NdbDictionary::Column* m_column; + + friend struct Ndb_free_list_t; }; inline diff --git a/ndb/src/ndbapi/NdbApiSignal.cpp b/ndb/src/ndbapi/NdbApiSignal.cpp index a1d34896968..953d87ac7b0 100644 --- a/ndb/src/ndbapi/NdbApiSignal.cpp +++ b/ndb/src/ndbapi/NdbApiSignal.cpp @@ -62,6 +62,25 @@ NdbApiSignal::NdbApiSignal(BlockReference ref) theNextSignal = 0; } +NdbApiSignal::NdbApiSignal(Ndb* ndb) +{ + BlockReference ref = ndb->theMyRef; + theVerId_signalNumber = 0; // 4 bit ver id - 16 bit gsn + theReceiversBlockNumber = 0; // Only 16 bit blocknum + theSendersBlockRef = refToBlock(ref); + theLength = 0; + theSendersSignalId = 0; + theSignalId = 0; + theTrace = 0; + m_noOfSections = 0; + m_fragmentInfo = 0; + for (int i = 0; i < 25; i++) + theData[i] = 0x13579753; + + setDataPtr(&theData[0]); + theNextSignal = 0; +} + /** * Copy constructor */ diff --git a/ndb/src/ndbapi/NdbApiSignal.hpp b/ndb/src/ndbapi/NdbApiSignal.hpp index 52c3be2256c..9a8326bd666 100644 --- a/ndb/src/ndbapi/NdbApiSignal.hpp +++ b/ndb/src/ndbapi/NdbApiSignal.hpp @@ -46,7 +46,8 @@ class NdbApiSignal : public SignalHeader { public: - NdbApiSignal(BlockReference myRef); + NdbApiSignal(Ndb* ndb); + NdbApiSignal(BlockReference ref); NdbApiSignal(const NdbApiSignal &); NdbApiSignal(const SignalHeader &header) : SignalHeader(header), theNextSignal(0), theRealData(0) {}; diff --git a/ndb/src/ndbapi/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp index f72361b86ac..c5692d79e83 100644 --- a/ndb/src/ndbapi/NdbBlob.cpp +++ b/ndb/src/ndbapi/NdbBlob.cpp @@ -137,7 +137,7 @@ NdbBlob::getBlobTable(NdbTableImpl& bt, const NdbTableImpl* t, const NdbColumnIm // initialization -NdbBlob::NdbBlob() +NdbBlob::NdbBlob(Ndb*) { init(); } diff --git a/ndb/src/ndbapi/NdbImpl.hpp b/ndb/src/ndbapi/NdbImpl.hpp index 00a8ef19f3a..33aaca8de96 100644 --- a/ndb/src/ndbapi/NdbImpl.hpp +++ b/ndb/src/ndbapi/NdbImpl.hpp @@ -32,6 +32,21 @@ #include "NdbDictionaryImpl.hpp" #include "ObjectMap.hpp" +template +struct Ndb_free_list_t +{ + Ndb_free_list_t(); + ~Ndb_free_list_t(); + + void fill(Ndb*, Uint32 cnt); + T* seize(Ndb*); + void release(T*); + void clear(); + Uint32 get_sizeof() const { return sizeof(T); } + T * m_free_list; + Uint32 m_alloc_cnt, m_free_cnt; +}; + /** * Private parts of the Ndb object (corresponding to Ndb.hpp in public API) */ @@ -59,6 +74,23 @@ public: NdbWaiter theWaiter; int m_optimized_node_selection; + + /** + * NOTE free lists must be _after_ theNdbObjectIdMap take + * assure that destructors are run in correct order + */ + Ndb_free_list_t theConIdleList; + Ndb_free_list_t theOpIdleList; + Ndb_free_list_t theScanOpIdleList; + Ndb_free_list_t theIndexOpIdleList; + Ndb_free_list_t theRecAttrIdleList; + Ndb_free_list_t theSignalIdleList; + Ndb_free_list_t theLabelList; + Ndb_free_list_t theBranchList; + Ndb_free_list_t theSubroutineList; + Ndb_free_list_t theCallList; + Ndb_free_list_t theNdbBlobIdleList; + Ndb_free_list_t theScanList; }; #ifdef VM_TRACE @@ -133,4 +165,91 @@ enum LockMode { Delete }; +template +inline +Ndb_free_list_t::Ndb_free_list_t() +{ + m_free_list= 0; + m_alloc_cnt= m_free_cnt= 0; +} + +template +inline +Ndb_free_list_t::~Ndb_free_list_t() +{ + clear(); +} + +template +inline +void +Ndb_free_list_t::fill(Ndb* ndb, Uint32 cnt) +{ + if (m_free_list == 0) + { + m_free_cnt++; + m_alloc_cnt++; + m_free_list = new T(ndb); + } + while(m_alloc_cnt < cnt) + { + T* obj= new T(ndb); + if(obj == 0) + return; + + obj->next(m_free_list); + m_free_cnt++; + m_alloc_cnt++; + m_free_list = obj; + } +} + +template +inline +T* +Ndb_free_list_t::seize(Ndb* ndb) +{ + T* tmp = m_free_list; + if (tmp) + { + m_free_list = (T*)tmp->next(); + tmp->next(NULL); + m_free_cnt--; + return tmp; + } + + if((tmp = new T(ndb))) + { + m_alloc_cnt++; + } + + return tmp; +} + +template +inline +void +Ndb_free_list_t::release(T* obj) +{ + obj->next(m_free_list); + m_free_list = obj; + m_free_cnt++; +} + + +template +inline +void +Ndb_free_list_t::clear() +{ + T* obj = m_free_list; + while(obj) + { + T* curr = obj; + obj = (T*)obj->next(); + delete curr; + m_alloc_cnt--; + } +} + #endif diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp index db83e9c5fcf..f993c652bf9 100644 --- a/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/ndb/src/ndbapi/NdbRecAttr.cpp @@ -33,7 +33,7 @@ Adjust: 971206 UABRONM First version #include "NdbDictionaryImpl.hpp" #include -NdbRecAttr::NdbRecAttr() +NdbRecAttr::NdbRecAttr(Ndb*) { init(); } @@ -109,7 +109,7 @@ NdbRecAttr::copyout() NdbRecAttr * NdbRecAttr::clone() const { - NdbRecAttr * ret = new NdbRecAttr(); + NdbRecAttr * ret = new NdbRecAttr(0); ret->theAttrId = theAttrId; ret->theNULLind = theNULLind; diff --git a/ndb/src/ndbapi/NdbUtil.cpp b/ndb/src/ndbapi/NdbUtil.cpp index 5c74d251ff9..6019ea675a1 100644 --- a/ndb/src/ndbapi/NdbUtil.cpp +++ b/ndb/src/ndbapi/NdbUtil.cpp @@ -30,8 +30,7 @@ Comment: #include "NdbUtil.hpp" -NdbLabel::NdbLabel() : - theNext(NULL) +NdbLabel::NdbLabel(Ndb*) { } @@ -39,8 +38,7 @@ NdbLabel::~NdbLabel() { } -NdbSubroutine::NdbSubroutine() : - theNext(NULL) +NdbSubroutine::NdbSubroutine(Ndb*) { } @@ -48,9 +46,8 @@ NdbSubroutine::~NdbSubroutine() { } -NdbBranch::NdbBranch() : - theSignal(NULL), - theNext(NULL) +NdbBranch::NdbBranch(Ndb*) : + theSignal(NULL) { } @@ -58,9 +55,8 @@ NdbBranch::~NdbBranch() { } -NdbCall::NdbCall() : - theSignal(NULL), - theNext(NULL) +NdbCall::NdbCall(Ndb*) : + theSignal(NULL) { } diff --git a/ndb/src/ndbapi/NdbUtil.hpp b/ndb/src/ndbapi/NdbUtil.hpp index 80fc15ddd8c..d14ac65ddef 100644 --- a/ndb/src/ndbapi/NdbUtil.hpp +++ b/ndb/src/ndbapi/NdbUtil.hpp @@ -34,41 +34,49 @@ Comment: class NdbApiSignal; class NdbOperation; -class NdbLabel +template +struct Free_list_element +{ + Free_list_element() { theNext = 0;} + void next(T* obj) { theNext = obj;} + T* next() { return theNext;} + + T* theNext; +}; + +class NdbLabel : public Free_list_element { friend class NdbOperation; friend class Ndb; - -private: - NdbLabel(); +public: + NdbLabel(Ndb*); ~NdbLabel(); - NdbLabel* theNext; +private: Uint32 theSubroutine[16]; Uint32 theLabelAddress[16]; Uint32 theLabelNo[16]; }; -class NdbSubroutine +class NdbSubroutine : public Free_list_element { friend class NdbOperation; friend class Ndb; -private: - NdbSubroutine(); +public: + NdbSubroutine(Ndb*); ~NdbSubroutine(); - NdbSubroutine* theNext; Uint32 theSubroutineAddress[16]; }; -class NdbBranch +class NdbBranch : public Free_list_element { friend class NdbOperation; friend class Ndb; -private: - NdbBranch(); +public: + NdbBranch(Ndb*); ~NdbBranch(); NdbApiSignal* theSignal; @@ -76,22 +84,20 @@ private: Uint32 theBranchAddress; Uint32 theBranchLabel; Uint32 theSubroutine; - NdbBranch* theNext; }; -class NdbCall +class NdbCall : public Free_list_element { friend class NdbOperation; friend class Ndb; -private: - NdbCall(); +public: + NdbCall(Ndb*); ~NdbCall(); NdbApiSignal* theSignal; Uint32 theSignalAddress; Uint32 theSubroutine; - NdbCall* theNext; }; #endif diff --git a/ndb/src/ndbapi/Ndbif.cpp b/ndb/src/ndbapi/Ndbif.cpp index 1caebe436ef..3ebba7e1c4a 100644 --- a/ndb/src/ndbapi/Ndbif.cpp +++ b/ndb/src/ndbapi/Ndbif.cpp @@ -143,15 +143,6 @@ Ndb::init(int aMaxNoOfTransactions) error_handler: ndbout << "error_handler" << endl; releaseTransactionArrays(); - while ( theConIdleList != NULL ) - freeNdbCon(); - while ( theSignalIdleList != NULL ) - freeSignal(); - while (theRecAttrIdleList != NULL) - freeRecAttr(); - while (theOpIdleList != NULL) - freeOperation(); - delete theDictionary; TransporterFacade::instance()->close(theNdbBlockNumber, 0); DBUG_RETURN(-1); diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp index a11dd842495..24daa27d6a3 100644 --- a/ndb/src/ndbapi/Ndbinit.cpp +++ b/ndb/src/ndbapi/Ndbinit.cpp @@ -99,20 +99,8 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, theMaxNoOfTransactions= 0; theMinNoOfEventsToWakeUp= 0; prefixEnd= NULL; - theConIdleList= NULL; - theOpIdleList= NULL; - theScanOpIdleList= NULL; - theIndexOpIdleList= NULL; theTransactionList= NULL; theConnectionArray= NULL; - theRecAttrIdleList= NULL; - theSignalIdleList= NULL; - theLabelList= NULL; - theBranchList= NULL; - theSubroutineList= NULL; - theCallList= NULL; - theScanList= NULL; - theNdbBlobIdleList= NULL; the_last_check_time= 0; theFirstTransId= 0; theRestartGCI= 0; @@ -204,33 +192,6 @@ Ndb::~Ndb() TransporterFacade::instance()->close(theNdbBlockNumber, theFirstTransId); } -// if (theSchemaConToNdbList != NULL) -// closeSchemaTransaction(theSchemaConToNdbList); - while ( theConIdleList != NULL ) - freeNdbCon(); - while (theOpIdleList != NULL) - freeOperation(); - while (theScanOpIdleList != NULL) - freeScanOperation(); - while (theIndexOpIdleList != NULL) - freeIndexOperation(); - while (theLabelList != NULL) - freeNdbLabel(); - while (theBranchList != NULL) - freeNdbBranch(); - while (theSubroutineList != NULL) - freeNdbSubroutine(); - while (theCallList != NULL) - freeNdbCall(); - while (theScanList != NULL) - freeNdbScanRec(); - while (theNdbBlobIdleList != NULL) - freeNdbBlob(); - while (theRecAttrIdleList != NULL) - freeRecAttr(); - while ( theSignalIdleList != NULL ) - freeSignal(); - releaseTransactionArrays(); delete []theConnectionArray; diff --git a/ndb/src/ndbapi/Ndblist.cpp b/ndb/src/ndbapi/Ndblist.cpp index 5902aa413dc..3001561a73a 100644 --- a/ndb/src/ndbapi/Ndblist.cpp +++ b/ndb/src/ndbapi/Ndblist.cpp @@ -76,25 +76,7 @@ Ndb::checkFailedNode() int Ndb::createConIdleList(int aNrOfCon) { - for (int i = 0; i < aNrOfCon; i++) - { - NdbConnection* tNdbCon = new NdbConnection(this); - if (tNdbCon == NULL) - { - return -1; - } - if (theConIdleList == NULL) - { - theConIdleList = tNdbCon; - theConIdleList->next(NULL); - } else - { - tNdbCon->next(theConIdleList); - theConIdleList = tNdbCon; - } - tNdbCon->Status(NdbConnection::NotConnected); - } - theNoOfAllocatedTransactions = aNrOfCon; + theImpl->theConIdleList.fill(this, aNrOfCon); return aNrOfCon; } @@ -110,19 +92,7 @@ Ndb::createConIdleList(int aNrOfCon) int Ndb::createOpIdleList(int aNrOfOp) { - for (int i = 0; i < aNrOfOp; i++){ - NdbOperation* tOp = new NdbOperation(this); - if ( tOp == NULL ){ - return -1; - } - if (theOpIdleList == NULL){ - theOpIdleList = tOp; - theOpIdleList->next(NULL); - } else{ - tOp->next(theOpIdleList); - theOpIdleList = tOp; - } - } + theImpl->theOpIdleList.fill(this, aNrOfOp); return aNrOfOp; } @@ -136,22 +106,7 @@ Ndb::createOpIdleList(int aNrOfOp) NdbBranch* Ndb::getNdbBranch() { - NdbBranch* tNdbBranch; - if ( theBranchList == NULL ) - { - tNdbBranch = new NdbBranch; - if (tNdbBranch == NULL) - { - return NULL; - } - tNdbBranch->theNext = NULL; - } else - { - tNdbBranch = theBranchList; - theBranchList = tNdbBranch->theNext; - tNdbBranch->theNext = NULL; - } - return tNdbBranch; + return theImpl->theBranchList.seize(this); } /*************************************************************************** @@ -164,22 +119,7 @@ Ndb::getNdbBranch() NdbCall* Ndb::getNdbCall() { - NdbCall* tNdbCall; - if ( theCallList == NULL ) - { - tNdbCall = new NdbCall; - if (tNdbCall == NULL) - { - return NULL; - } - tNdbCall->theNext = NULL; - } else - { - tNdbCall = theCallList; - theCallList = tNdbCall->theNext; - tNdbCall->theNext = NULL; - } - return tNdbCall; + return theImpl->theCallList.seize(this); } /*************************************************************************** @@ -192,25 +132,14 @@ Ndb::getNdbCall() NdbConnection* Ndb::getNdbCon() { - NdbConnection* tNdbCon; - if ( theConIdleList == NULL ) { - if (theNoOfAllocatedTransactions < theMaxNoOfTransactions) { - tNdbCon = new NdbConnection(this); - if (tNdbCon == NULL) { - return NULL; - }//if - theNoOfAllocatedTransactions++; - } else { - ndbout << "theNoOfAllocatedTransactions = " << theNoOfAllocatedTransactions << " theMaxNoOfTransactions = " << theMaxNoOfTransactions << endl; - return NULL; - }//if - tNdbCon->next(NULL); - } else + NdbConnection* tNdbCon = theImpl->theConIdleList.seize(this); + if (unlikely(theImpl->theConIdleList.m_alloc_cnt > theMaxNoOfTransactions)) { - tNdbCon = theConIdleList; - theConIdleList = tNdbCon->next(); - tNdbCon->next(NULL); - } + theImpl->theConIdleList.release(tNdbCon); + ndbout << "theNoOfAllocatedTransactions = " << theNoOfAllocatedTransactions << " theMaxNoOfTransactions = " << theMaxNoOfTransactions << endl; + return NULL; + }//if + tNdbCon->theMagicNumber = 0x37412619; return tNdbCon; } @@ -225,22 +154,7 @@ Ndb::getNdbCon() NdbLabel* Ndb::getNdbLabel() { - NdbLabel* tNdbLabel; - if ( theLabelList == NULL ) - { - tNdbLabel = new NdbLabel; - if (tNdbLabel == NULL) - { - return NULL; - } - tNdbLabel->theNext = NULL; - } else - { - tNdbLabel = theLabelList; - theLabelList = tNdbLabel->theNext; - tNdbLabel->theNext = NULL; - } - return tNdbLabel; + return theImpl->theLabelList.seize(this); } /*************************************************************************** @@ -254,23 +168,7 @@ Ndb::getNdbLabel() NdbReceiver* Ndb::getNdbScanRec() { - NdbReceiver* tNdbScanRec; - if ( theScanList == NULL ) - { - tNdbScanRec = new NdbReceiver(this); - if (tNdbScanRec == NULL) - { - return NULL; - } - tNdbScanRec->next(NULL); - } else - { - tNdbScanRec = theScanList; - theScanList = tNdbScanRec->next(); - tNdbScanRec->next(NULL); - } - - return tNdbScanRec; + return theImpl->theScanList.seize(this); } /*************************************************************************** @@ -283,22 +181,7 @@ Ndb::getNdbScanRec() NdbSubroutine* Ndb::getNdbSubroutine() { - NdbSubroutine* tNdbSubroutine; - if ( theSubroutineList == NULL ) - { - tNdbSubroutine = new NdbSubroutine; - if (tNdbSubroutine == NULL) - { - return NULL; - } - tNdbSubroutine->theNext = NULL; - } else - { - tNdbSubroutine = theSubroutineList; - theSubroutineList = tNdbSubroutine->theNext; - tNdbSubroutine->theNext = NULL; - } - return tNdbSubroutine; + return theImpl->theSubroutineList.seize(this); } /*************************************************************************** @@ -311,18 +194,7 @@ Remark: Get an operation from theOpIdleList and return the object . NdbOperation* Ndb::getOperation() { - NdbOperation* tOp = theOpIdleList; - if (tOp != NULL ) { - NdbOperation* tOpNext = tOp->next(); - tOp->next(NULL); - theOpIdleList = tOpNext; - return tOp; - } else { - tOp = new NdbOperation(this); - if (tOp != NULL) - tOp->next(NULL); - } - return tOp; + return theImpl->theOpIdleList.seize(this); } /*************************************************************************** @@ -335,18 +207,7 @@ Remark: Get an operation from theScanOpIdleList and return the object . NdbIndexScanOperation* Ndb::getScanOperation() { - NdbIndexScanOperation* tOp = theScanOpIdleList; - if (tOp != NULL ) { - NdbIndexScanOperation* tOpNext = (NdbIndexScanOperation*)tOp->next(); - tOp->next(NULL); - theScanOpIdleList = tOpNext; - return tOp; - } else { - tOp = new NdbIndexScanOperation(this); - if (tOp != NULL) - tOp->next(NULL); - } - return tOp; + return theImpl->theScanOpIdleList.seize(this); } /*************************************************************************** @@ -359,18 +220,7 @@ Remark: Get an operation from theIndexOpIdleList and return the object . NdbIndexOperation* Ndb::getIndexOperation() { - NdbIndexOperation* tOp = theIndexOpIdleList; - if (tOp != NULL ) { - NdbIndexOperation* tOpNext = (NdbIndexOperation*) tOp->next(); - tOp->next(NULL); - theIndexOpIdleList = tOpNext; - return tOp; - } else { - tOp = new NdbIndexOperation(this); - if (tOp != NULL) - tOp->next(NULL); - } - return tOp; + return theImpl->theIndexOpIdleList.seize(this); } /*************************************************************************** @@ -382,21 +232,14 @@ Return Value: Return a reference to a receive attribute object. NdbRecAttr* Ndb::getRecAttr() { - NdbRecAttr* tRecAttr; - tRecAttr = theRecAttrIdleList; - if (tRecAttr != NULL) { - NdbRecAttr* tRecAttrNext = tRecAttr->next(); + NdbRecAttr* tRecAttr = theImpl->theRecAttrIdleList.seize(this); + if (tRecAttr != NULL) + { tRecAttr->init(); - theRecAttrIdleList = tRecAttrNext; return tRecAttr; - } else { - tRecAttr = new NdbRecAttr; - if (tRecAttr == NULL) - return NULL; - tRecAttr->next(NULL); - }//if - tRecAttr->init(); - return tRecAttr; + } + + return NULL; } /*************************************************************************** @@ -408,34 +251,16 @@ Return Value: Return a reference to a signal object. NdbApiSignal* Ndb::getSignal() { - NdbApiSignal* tSignal = theSignalIdleList; - if (tSignal != NULL){ - NdbApiSignal* tSignalNext = tSignal->next(); - tSignal->next(NULL); - theSignalIdleList = tSignalNext; - } else { - tSignal = new NdbApiSignal(theMyRef); -#ifdef POORMANSPURIFY - cnewSignals++; -#endif - if (tSignal != NULL) - tSignal->next(NULL); - } -#ifdef POORMANSPURIFY - cgetSignals++; -#endif - return tSignal; + return theImpl->theSignalIdleList.seize(this); } NdbBlob* Ndb::getNdbBlob() { - NdbBlob* tBlob = theNdbBlobIdleList; - if (tBlob != NULL) { - theNdbBlobIdleList = tBlob->theNext; + NdbBlob* tBlob = theImpl->theNdbBlobIdleList.seize(this); + if(tBlob) + { tBlob->init(); - } else { - tBlob = new NdbBlob; } return tBlob; } @@ -449,8 +274,7 @@ Remark: Add a NdbBranch object into the Branch idlelist. void Ndb::releaseNdbBranch(NdbBranch* aNdbBranch) { - aNdbBranch->theNext = theBranchList; - theBranchList = aNdbBranch; + theImpl->theBranchList.release(aNdbBranch); } /*************************************************************************** @@ -462,8 +286,7 @@ Remark: Add a NdbBranch object into the Branch idlelist. void Ndb::releaseNdbCall(NdbCall* aNdbCall) { - aNdbCall->theNext = theCallList; - theCallList = aNdbCall; + theImpl->theCallList.release(aNdbCall); } /*************************************************************************** @@ -475,9 +298,8 @@ Remark: Add a Connection object into the signal idlelist. void Ndb::releaseNdbCon(NdbConnection* aNdbCon) { - aNdbCon->next(theConIdleList); aNdbCon->theMagicNumber = 0xFE11DD; - theConIdleList = aNdbCon; + theImpl->theConIdleList.release(aNdbCon); } /*************************************************************************** @@ -489,8 +311,7 @@ Remark: Add a NdbLabel object into the Label idlelist. void Ndb::releaseNdbLabel(NdbLabel* aNdbLabel) { - aNdbLabel->theNext = theLabelList; - theLabelList = aNdbLabel; + theImpl->theLabelList.release(aNdbLabel); } /*************************************************************************** @@ -502,8 +323,7 @@ Remark: Add a NdbScanReceiver object into the Scan idlelist. void Ndb::releaseNdbScanRec(NdbReceiver* aNdbScanRec) { - aNdbScanRec->next(theScanList); - theScanList = aNdbScanRec; + theImpl->theScanList.release(aNdbScanRec); } /*************************************************************************** @@ -515,8 +335,7 @@ Remark: Add a NdbSubroutine object into theSubroutine idlelist. void Ndb::releaseNdbSubroutine(NdbSubroutine* aNdbSubroutine) { - aNdbSubroutine->theNext = theSubroutineList; - theSubroutineList = aNdbSubroutine; + theImpl->theSubroutineList.release(aNdbSubroutine); } /*************************************************************************** @@ -529,16 +348,14 @@ void Ndb::releaseOperation(NdbOperation* anOperation) { if(anOperation->m_tcReqGSN == GSN_TCKEYREQ){ - anOperation->next(theOpIdleList); anOperation->theNdbCon = NULL; anOperation->theMagicNumber = 0xFE11D0; - theOpIdleList = anOperation; + theImpl->theOpIdleList.release(anOperation); } else { assert(anOperation->m_tcReqGSN == GSN_TCINDXREQ); - anOperation->next(theIndexOpIdleList); anOperation->theNdbCon = NULL; anOperation->theMagicNumber = 0xFE11D1; - theIndexOpIdleList = (NdbIndexOperation*)anOperation; + theImpl->theIndexOpIdleList.release((NdbIndexOperation*)anOperation); } } @@ -551,10 +368,9 @@ Remark: Add a NdbScanOperation object into the signal idlelist. void Ndb::releaseScanOperation(NdbIndexScanOperation* aScanOperation) { - aScanOperation->next(theScanOpIdleList); aScanOperation->theNdbCon = NULL; aScanOperation->theMagicNumber = 0xFE11D2; - theScanOpIdleList = aScanOperation; + theImpl->theScanOpIdleList.release(aScanOperation); } /*************************************************************************** @@ -567,8 +383,7 @@ void Ndb::releaseRecAttr(NdbRecAttr* aRecAttr) { aRecAttr->release(); - aRecAttr->next(theRecAttrIdleList); - theRecAttrIdleList = aRecAttr; + theImpl->theRecAttrIdleList.release(aRecAttr); } /*************************************************************************** @@ -595,8 +410,7 @@ Ndb::releaseSignal(NdbApiSignal* aSignal) #ifdef POORMANSPURIFY creleaseSignals++; #endif - aSignal->next(theSignalIdleList); - theSignalIdleList = aSignal; + theImpl->theSignalIdleList.release(aSignal); } void @@ -612,163 +426,7 @@ Ndb::releaseSignalsInList(NdbApiSignal** pList){ void Ndb::releaseNdbBlob(NdbBlob* aBlob) { - aBlob->release(); - aBlob->theNext = theNdbBlobIdleList; - theNdbBlobIdleList = aBlob; -} - -/*************************************************************************** -void freeOperation(); - -Remark: Always release the first item in the free list -***************************************************************************/ -void -Ndb::freeOperation() -{ - NdbOperation* tOp = theOpIdleList; - theOpIdleList = theOpIdleList->next(); - delete tOp; -} - -/*************************************************************************** -void freeScanOperation(); - -Remark: Always release the first item in the free list -***************************************************************************/ -void -Ndb::freeScanOperation() -{ - NdbIndexScanOperation* tOp = theScanOpIdleList; - theScanOpIdleList = (NdbIndexScanOperation *)tOp->next(); - delete tOp; -} - -/*************************************************************************** -void freeIndexOperation(); - -Remark: Always release the first item in the free list -***************************************************************************/ -void -Ndb::freeIndexOperation() -{ - NdbIndexOperation* tOp = theIndexOpIdleList; - theIndexOpIdleList = (NdbIndexOperation *) theIndexOpIdleList->next(); - delete tOp; -} - -/*************************************************************************** -void freeNdbBranch(); - -Remark: Always release the first item in the free list -***************************************************************************/ -void -Ndb::freeNdbBranch() -{ - NdbBranch* tNdbBranch = theBranchList; - theBranchList = theBranchList->theNext; - delete tNdbBranch; -} - -/*************************************************************************** -void freeNdbCall(); - -Remark: Always release the first item in the free list -***************************************************************************/ -void -Ndb::freeNdbCall() -{ - NdbCall* tNdbCall = theCallList; - theCallList = theCallList->theNext; - delete tNdbCall; -} - -/*************************************************************************** -void freeNdbScanRec(); - -Remark: Always release the first item in the free list -***************************************************************************/ -void -Ndb::freeNdbScanRec() -{ - NdbReceiver* tNdbScanRec = theScanList; - theScanList = theScanList->next(); - delete tNdbScanRec; -} - -/*************************************************************************** -void freeNdbCon(); - -Remark: Always release the first item in the free list -***************************************************************************/ -void -Ndb::freeNdbCon() -{ - NdbConnection* tNdbCon = theConIdleList; - theConIdleList = theConIdleList->next(); - delete tNdbCon; -} - -/*************************************************************************** -void freeNdbLabel(); - -Remark: Always release the first item in the free list -***************************************************************************/ -void -Ndb::freeNdbLabel() -{ - NdbLabel* tNdbLabel = theLabelList; - theLabelList = theLabelList->theNext; - delete tNdbLabel; -} - -/*************************************************************************** -void freeNdbSubroutine(); - -Remark: Always release the first item in the free list -***************************************************************************/ -void -Ndb::freeNdbSubroutine() -{ - NdbSubroutine* tNdbSubroutine = theSubroutineList; - theSubroutineList = theSubroutineList->theNext; - delete tNdbSubroutine; -} - -/*************************************************************************** -void freeRecAttr(); - -Remark: Always release the first item in the free list -***************************************************************************/ -void -Ndb::freeRecAttr() -{ - NdbRecAttr* tRecAttr = theRecAttrIdleList; - theRecAttrIdleList = theRecAttrIdleList->next(); - delete tRecAttr; -} - -/*************************************************************************** -void freeSignal(); - -Remark: Delete a signal object from the signal idlelist. -***************************************************************************/ -void -Ndb::freeSignal() -{ - NdbApiSignal* tSignal = theSignalIdleList; - theSignalIdleList = tSignal->next(); - delete tSignal; -#ifdef POORMANSPURIFY - cfreeSignals++; -#endif -} - -void -Ndb::freeNdbBlob() -{ - NdbBlob* tBlob = theNdbBlobIdleList; - theNdbBlobIdleList = tBlob->theNext; - delete tBlob; + theImpl->theNdbBlobIdleList.release(aBlob); } /**************************************************************************** @@ -823,3 +481,102 @@ Ndb::releaseConnectToNdb(NdbConnection* a_con) DBUG_VOID_RETURN; } +template +static +Ndb::Free_list_usage* +update(Ndb::Free_list_usage* curr, + Ndb_free_list_t & list, + const char * name) +{ + curr->m_name = name; + curr->m_created = list.m_alloc_cnt; + curr->m_free = list.m_free_cnt; + curr->m_sizeof = sizeof(T); + return curr; +} + +Ndb::Free_list_usage* +Ndb::get_free_list_usage(Ndb::Free_list_usage* curr) +{ + if (curr == 0) + { + return 0; + } + + if(curr->m_name == 0) + { + update(curr, theImpl->theConIdleList, "NdbTransaction"); + } + else if(!strcmp(curr->m_name, "NdbTransaction")) + { + update(curr, theImpl->theOpIdleList, "NdbOperation"); + } + else if(!strcmp(curr->m_name, "NdbOperation")) + { + update(curr, theImpl->theScanOpIdleList, "NdbIndexScanOperation"); + } + else if(!strcmp(curr->m_name, "NdbIndexScanOperation")) + { + update(curr, theImpl->theIndexOpIdleList, "NdbIndexOperation"); + } + else if(!strcmp(curr->m_name, "NdbIndexOperation")) + { + update(curr, theImpl->theRecAttrIdleList, "NdbRecAttr"); + } + else if(!strcmp(curr->m_name, "NdbRecAttr")) + { + update(curr, theImpl->theSignalIdleList, "NdbApiSignal"); + } + else if(!strcmp(curr->m_name, "NdbApiSignal")) + { + update(curr, theImpl->theLabelList, "NdbLabel"); + } + else if(!strcmp(curr->m_name, "NdbLabel")) + { + update(curr, theImpl->theBranchList, "NdbBranch"); + } + else if(!strcmp(curr->m_name, "NdbBranch")) + { + update(curr, theImpl->theSubroutineList, "NdbSubroutine"); + } + else if(!strcmp(curr->m_name, "NdbSubroutine")) + { + update(curr, theImpl->theCallList, "NdbCall"); + } + else if(!strcmp(curr->m_name, "NdbCall")) + { + update(curr, theImpl->theNdbBlobIdleList, "NdbBlob"); + } + else if(!strcmp(curr->m_name, "NdbBlob")) + { + update(curr, theImpl->theScanList, "NdbReceiver"); + } + else if(!strcmp(curr->m_name, "NdbReceiver")) + { + return 0; + } + else + { + update(curr, theImpl->theConIdleList, "NdbTransaction"); + } + + return curr; +} + +#define TI(T) \ + template Ndb::Free_list_usage* \ + update(Ndb::Free_list_usage*, Ndb_free_list_t &, const char * name);\ + template struct Ndb_free_list_t + +TI(NdbBlob); +TI(NdbCall); +TI(NdbLabel); +TI(NdbBranch); +TI(NdbSubroutine); +TI(NdbApiSignal); +TI(NdbRecAttr); +TI(NdbOperation); +TI(NdbReceiver); +TI(NdbConnection); +TI(NdbIndexOperation); +TI(NdbIndexScanOperation); diff --git a/ndb/tools/restore/Restore.cpp b/ndb/tools/restore/Restore.cpp index 26bc08c63a9..79df49c6f26 100644 --- a/ndb/tools/restore/Restore.cpp +++ b/ndb/tools/restore/Restore.cpp @@ -869,7 +869,7 @@ operator<<(NdbOut& ndbout, const AttributeS& attr){ return ndbout; } - NdbRecAttr tmprec; + NdbRecAttr tmprec(0); tmprec.setup(desc.m_column, (char *)data.void_value); ndbout << tmprec; From a12f1d0ef1730a3bebb4afd19bbaddd122227c17 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Sep 2005 12:02:19 +0200 Subject: [PATCH 021/225] log.cc: Cast my_munmap() argument to be able to compile on Solaris sql/log.cc: Cast my_munmap() argument to be able to compile on Solaris --- sql/log.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/log.cc b/sql/log.cc index 920a3fcff42..7d38a630afd 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2790,7 +2790,7 @@ void TC_LOG_MMAP::close() case 3: my_free((gptr)pages, MYF(0)); case 2: - my_munmap(data, (size_t)file_length); + my_munmap((byte*)data, (size_t)file_length); case 1: my_close(fd, MYF(0)); } From d0eb3e284294bc6326b1f2b4b6013052460213c5 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Sep 2005 14:18:27 +0200 Subject: [PATCH 022/225] ndb remove extra ";" from test programs ndb/test/include/NDBT_Test.hpp: Remove extra ";" ndb/test/ndbapi/bank/BankLoad.cpp: Remove extra ";" ndb/test/ndbapi/testOIBasic.cpp: Remove extra ";" ndb/test/src/HugoCalculator.cpp: Remove extra ";" ndb/test/src/NDBT_Test.cpp: Remove extra ";" ndb/test/src/NdbBackup.cpp: Remove extra ";" ndb/test/src/NdbRestarts.cpp: Remove extra ";" --- ndb/test/include/NDBT_Test.hpp | 2 +- ndb/test/ndbapi/bank/BankLoad.cpp | 4 ++-- ndb/test/ndbapi/testOIBasic.cpp | 6 +++--- ndb/test/src/HugoCalculator.cpp | 6 +++--- ndb/test/src/NDBT_Test.cpp | 2 +- ndb/test/src/NdbBackup.cpp | 2 +- ndb/test/src/NdbRestarts.cpp | 30 +++++++++++++++--------------- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/ndb/test/include/NDBT_Test.hpp b/ndb/test/include/NDBT_Test.hpp index bcaa0bf4d40..44eb24cd87e 100644 --- a/ndb/test/include/NDBT_Test.hpp +++ b/ndb/test/include/NDBT_Test.hpp @@ -426,7 +426,7 @@ C##suitname():NDBT_TestSuite(#suitname){ \ pt->addTable(tableName, false); #define NDBT_TESTSUITE_END(suitname) \ - } } ; C##suitname suitname; + } } ; C##suitname suitname // Helper functions for retrieving variables from NDBT_Step #define GETNDB(ps) ((NDBT_NdbApiStep*)ps)->getNdb() diff --git a/ndb/test/ndbapi/bank/BankLoad.cpp b/ndb/test/ndbapi/bank/BankLoad.cpp index 39dc8097115..2cc42240234 100644 --- a/ndb/test/ndbapi/bank/BankLoad.cpp +++ b/ndb/test/ndbapi/bank/BankLoad.cpp @@ -321,7 +321,7 @@ int Bank::loadGl(){ m_ndb.closeTransaction(pTrans); return NDBT_OK; -}; +} int Bank::getBalanceForAccountType(const Uint32 accountType, @@ -460,7 +460,7 @@ int Bank::loadAccountType(){ m_ndb.closeTransaction(pTrans); return NDBT_OK; -}; +} /** * Load ACCOUNT table diff --git a/ndb/test/ndbapi/testOIBasic.cpp b/ndb/test/ndbapi/testOIBasic.cpp index 9f8da850ff4..30a76da306a 100644 --- a/ndb/test/ndbapi/testOIBasic.cpp +++ b/ndb/test/ndbapi/testOIBasic.cpp @@ -2187,7 +2187,7 @@ pkinsert(Par par) } con.closeTransaction(); return 0; -}; +} static int pkupdate(Par par) @@ -2250,7 +2250,7 @@ pkupdate(Par par) } con.closeTransaction(); return 0; -}; +} static int pkdelete(Par par) @@ -2306,7 +2306,7 @@ pkdelete(Par par) } con.closeTransaction(); return 0; -}; +} static int pkread(Par par) diff --git a/ndb/test/src/HugoCalculator.cpp b/ndb/test/src/HugoCalculator.cpp index 62c35c54a7a..86ff76831d7 100644 --- a/ndb/test/src/HugoCalculator.cpp +++ b/ndb/test/src/HugoCalculator.cpp @@ -51,7 +51,7 @@ HugoCalculator::HugoCalculator(const NdbDictionary::Table& tab) : m_tab(tab) { #endif // Check that idCol is not conflicting with updatesCol assert(m_idCol != m_updatesCol && m_idCol != -1 && m_updatesCol != -1); -}; +} Int32 HugoCalculator::calcValue(int record, @@ -73,7 +73,7 @@ HugoCalculator::calcValue(int record, else val = record + attrib + updates; return val; -}; +} #if 0 HugoCalculator::U_Int32 calcValue(int record, int attrib, int updates) const; HugoCalculator::U_Int64 calcValue(int record, int attrib, int updates) const; @@ -123,7 +123,7 @@ HugoCalculator::calcValue(int record, buf[len] = 0; } return buf; -}; +} int HugoCalculator::verifyRowValues(NDBT_ResultRow* const pRow) const{ diff --git a/ndb/test/src/NDBT_Test.cpp b/ndb/test/src/NDBT_Test.cpp index 6355c21c997..42bae193b35 100644 --- a/ndb/test/src/NDBT_Test.cpp +++ b/ndb/test/src/NDBT_Test.cpp @@ -624,7 +624,7 @@ int NDBT_TestCase::execute(NDBT_Context* ctx){ << endl; } return res; -}; +} void NDBT_TestCase::startTimer(NDBT_Context* ctx){ diff --git a/ndb/test/src/NdbBackup.cpp b/ndb/test/src/NdbBackup.cpp index 1e56db83c11..9f65fe6b3bc 100644 --- a/ndb/test/src/NdbBackup.cpp +++ b/ndb/test/src/NdbBackup.cpp @@ -345,7 +345,7 @@ NdbBackup::NF(NdbRestarter& _restarter, int *NFDuringBackup_codes, const int sz, } return NDBT_OK; -}; +} int FailS_codes[] = { diff --git a/ndb/test/src/NdbRestarts.cpp b/ndb/test/src/NdbRestarts.cpp index 607e48c4126..c0f31af84ce 100644 --- a/ndb/test/src/NdbRestarts.cpp +++ b/ndb/test/src/NdbRestarts.cpp @@ -213,7 +213,7 @@ NdbRestarts::NdbRestart::NdbRestart(const char* _name, m_restartFunc = _func; m_numRequiredNodes = _requiredNodes; // m_arg1 = arg1; -}; +} int NdbRestarts::getNumRestarts(){ @@ -367,7 +367,7 @@ int restartRandomNodeGraceful(NdbRestarter& _restarter, "Could not restart node "<m_name << endl; return NDBT_OK; -}; +} int NFDuringNR_codes[] = { @@ -713,7 +713,7 @@ int restartNFDuringNR(NdbRestarter& _restarter, } return NDBT_OK; -}; +} int NRDuringLCP_Master_codes[] = { @@ -864,7 +864,7 @@ int stopOnError(NdbRestarter& _restarter, } while (false); return NDBT_OK; -}; +} int getRandomNodeId(NdbRestarter& _restarter) { myRandom48Init(NdbTick_CurrentMillisecond()); From 1d169a8e258612b98cffd536a8238108360cc522 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Sep 2005 15:33:38 +0300 Subject: [PATCH 023/225] InnoDB: Remove unused #defines BTR_PAGE_MAX_KEY_SIZE and BTR_COMPRESS_LIMIT. --- innobase/include/btr0btr.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/innobase/include/btr0btr.h b/innobase/include/btr0btr.h index 1f3a32fa70c..d28b0b129a1 100644 --- a/innobase/include/btr0btr.h +++ b/innobase/include/btr0btr.h @@ -23,16 +23,6 @@ special big record storage structure */ #define BTR_PAGE_MAX_REC_SIZE (UNIV_PAGE_SIZE / 2 - 200) -/* Maximum key size in a B-tree: the records on non-leaf levels must be -shorter than this */ - -#define BTR_PAGE_MAX_KEY_SIZE 1024 - -/* If data in page drops below this limit, we try to compress it. -NOTE! The value has to be > 2 * BTR_MAX_KEY_SIZE */ - -#define BTR_COMPRESS_LIMIT (UNIV_PAGE_SIZE / 4 + 1); - /* Latching modes for the search function (in btr0cur.*) */ #define BTR_SEARCH_LEAF RW_S_LATCH #define BTR_MODIFY_LEAF RW_X_LATCH From bf58b698e22efe0849fc8ee18fc30e3914d73409 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Sep 2005 17:13:21 +0200 Subject: [PATCH 024/225] Fix for bug#5508 after Sanja's review mysql-test/r/view.result: test results for rename table view1 to view2 mysql-test/t/view.test: tests for rename table view1 to view2 sql/share/errmsg.txt: added new errormessage (schema change not allowed in rename table view) sql/sql_rename.cc: added support for renaming views sql/sql_view.cc: added new function mysql_rename_view sql/sql_view.h: added prototype mysql_rename_view --- mysql-test/r/view.result | 9 ++++ mysql-test/t/view.test | 13 +++++ sql/share/errmsg.txt | 2 + sql/sql_rename.cc | 34 +++++++++---- sql/sql_view.cc | 100 ++++++++++++++++++++++++++++++++++++++- sql/sql_view.h | 1 + 6 files changed, 150 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 4cb3db2e4aa..b4451a670d2 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -845,6 +845,15 @@ select * from v1; cast(1 as char(3)) 1 drop view v1; +create table t1 (a int); +create view v1 as select a from t1; +create database seconddb; +rename table v1 to seconddb.v1; +ERROR HY000: Changing schema from 'test' to 'seconddb' is not allowed. +rename table v1 to v2; +drop table t1; +drop view v2; +drop database seconddb; create view v1 as select 'a',1; create view v2 as select * from v1 union all select * from v1; create view v3 as select * from v2 where 1 = (select `1` from v2); diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 0e3a7b8aeac..b9c300132cf 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -785,6 +785,19 @@ show create view v1; select * from v1; drop view v1; +# +# renaming views +# +create table t1 (a int); +create view v1 as select a from t1; +create database seconddb; +-- error 1450 +rename table v1 to seconddb.v1; +rename table v1 to v2; +drop table t1; +drop view v2; +drop database seconddb; + # # bug handling from VIEWs # diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 9f6bc72ab81..09589c98dce 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5413,3 +5413,5 @@ ER_VIEW_OTHER_USER eng "You need the SUPER privilege for creation view with %-.64s@%-.64s definer" ER_NO_SUCH_USER eng "There is not %-.64s@%-.64s registered" +ER_FORBID_SCHEMA_CHANGE + eng "Changing schema from '%-.64s' to '%-.64s' is not allowed." diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index 3880aa428b9..b848809ccc9 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -133,6 +133,7 @@ static TABLE_LIST * rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error) { TABLE_LIST *ren_table,*new_table; + frm_type_enum frm_type; DBUG_ENTER("rename_tables"); for (ren_table= table_list; ren_table; ren_table= new_table->next_local) @@ -164,18 +165,35 @@ rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error) ren_table->db, old_alias, reg_ext); unpack_filename(name, name); - if ((table_type=get_table_type(thd, name)) == DB_TYPE_UNKNOWN) + if ((frm_type= mysql_frm_type(name)) == FRMTYPE_TABLE && + (table_type= get_table_type(thd, name)) == DB_TYPE_UNKNOWN) { my_error(ER_FILE_NOT_FOUND, MYF(0), name, my_errno); if (!skip_error) - DBUG_RETURN(ren_table); + DBUG_RETURN(ren_table); } - else if (mysql_rename_table(table_type, - ren_table->db, old_alias, - new_table->db, new_alias)) - { - if (!skip_error) - DBUG_RETURN(ren_table); + else { + int rc= 1; + switch (frm_type) + { + case FRMTYPE_TABLE: + rc= mysql_rename_table(table_type, ren_table->db, old_alias, + new_table->db, new_alias); + break; + case FRMTYPE_VIEW: + /* change of schema is not allowed */ + if (strcmp(ren_table->db, new_table->db)) + my_error(ER_FORBID_SCHEMA_CHANGE, MYF(0), ren_table->db, + new_table->db); + else + rc= mysql_rename_view(thd, new_alias, ren_table); + break; + case FRMTYPE_ERROR: + default: + my_error(ER_FILE_NOT_FOUND, MYF(0), name, my_errno); + } + if (rc && !skip_error) + DBUG_RETURN(ren_table); } } DBUG_RETURN(0); diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 5155e605ce0..2e4e9c54b01 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -479,8 +479,12 @@ err: /* index of revision number in following table */ static const int revision_number_position= 8; +/* index of source */ +static const int source_number_position= 11; /* index of last required parameter for making view */ static const int required_view_parameters= 10; +/* number of backups */ +static const int num_view_backups= 3; /* table of VIEW .frm field descriptors @@ -708,7 +712,7 @@ loop_out: } if (sql_create_definition_file(&dir, &file, view_file_type, - (gptr)view, view_parameters, 3)) + (gptr)view, view_parameters, num_view_backups)) { DBUG_RETURN(thd->net.report_error? -1 : 1); } @@ -1367,3 +1371,97 @@ int view_checksum(THD *thd, TABLE_LIST *view) HA_ADMIN_WRONG_CHECKSUM : HA_ADMIN_OK); } + +bool rename_view_files(const char *schema, const char *old_name, + const char *new_name, ulonglong revision) +{ + char old_path[FN_REFLEN], new_path[FN_REFLEN], arc_path[FN_REFLEN]; + + strxnmov(old_path, FN_REFLEN, mysql_data_home, "/", schema, "/", + old_name, reg_ext, NullS); + (void) unpack_filename(old_path, old_path); + + strxnmov(new_path, FN_REFLEN, mysql_data_home, "/", schema, "/", + new_name, reg_ext, NullS); + (void) unpack_filename(new_path, new_path); + + if (my_rename(old_path, new_path, MYF(MY_WME))) + return 1; + + /* check if arc_dir exists */ + strxnmov(arc_path, FN_REFLEN, mysql_data_home, "/", schema, "/arc", NullS); + (void) unpack_filename(arc_path, arc_path); + + if (revision && !access(arc_path, F_OK)) + { + while (revision) { + my_snprintf(old_path, FN_REFLEN, "%s/%s%s-%04lu", + arc_path, old_name, reg_ext, (ulong)revision); + (void) unpack_filename(old_path, old_path); + my_snprintf(new_path, FN_REFLEN, "%s/%s%s-%04lu", + arc_path, new_name, reg_ext, (ulong)revision); + (void) unpack_filename(new_path, new_path); + if (my_rename(old_path, new_path, MYF(0))) + return 0; + revision--; + } + } + return 0; +} + +bool +mysql_rename_view(THD *thd, + const char *new_name, + TABLE_LIST *view) +{ + LEX_STRING pathstr, file; + File_parser *parser; + char view_path[FN_REFLEN]; + + DBUG_ENTER("mysql_rename_view"); + + strxnmov(view_path, FN_REFLEN, mysql_data_home, "/", view->db, "/", + view->table_name, reg_ext, NullS); + (void) unpack_filename(view_path, view_path); + + pathstr.str= (char *)view_path; + pathstr.length= strlen(view_path); + + if ((parser= sql_parse_prepare(&pathstr, thd->mem_root, 1)) && + is_equal(&view_type, parser->type())) { + char dir_buff[FN_REFLEN], file_buff[FN_REFLEN]; + + /* get view definition and source */ + if (mysql_make_view(parser, view) || + parser->parse((gptr)view, thd->mem_root, + view_parameters + source_number_position, 1)) + DBUG_RETURN(1); + + /* rename view and it's backups */ + if (rename_view_files(view->db, view->table_name, new_name, view->revision - 1)) + DBUG_RETURN(1); + + strxnmov(dir_buff, FN_REFLEN, mysql_data_home, "/", view->db, "/", NullS); + (void) unpack_filename(dir_buff, dir_buff); + + pathstr.str= (char*)dir_buff; + pathstr.length= strlen(dir_buff); + + file.str= file_buff; + file.length= (strxnmov(file_buff, FN_REFLEN, new_name, reg_ext, NullS) + - file_buff); + + if (sql_create_definition_file(&pathstr, &file, view_file_type, + (gptr)view, view_parameters, num_view_backups)) { + /* restore renamed view in case of error */ + rename_view_files(view->db, new_name, view->table_name, view->revision - 1); + DBUG_RETURN(1); + } + } else + DBUG_RETURN(1); + + /* remove cache entries */ + query_cache_invalidate3(thd, view, 0); + sp_cache_invalidate(); + DBUG_RETURN(0); +} diff --git a/sql/sql_view.h b/sql/sql_view.h index 9d961feb143..4cc9eb454fb 100644 --- a/sql/sql_view.h +++ b/sql/sql_view.h @@ -34,6 +34,7 @@ int view_checksum(THD *thd, TABLE_LIST *view); extern TYPELIB updatable_views_with_limit_typelib; bool check_duplicate_names(List& item_list, bool gen_unique_view_names); +bool mysql_rename_view(THD *thd, const char *new_name, TABLE_LIST *view); #define VIEW_ANY_ACL (SELECT_ACL | UPDATE_ACL | INSERT_ACL | DELETE_ACL) From d6afdcb77c3e7959705259f33ed1ab2b73ec6ad7 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 17 Sep 2005 01:09:32 +0200 Subject: [PATCH 025/225] mysql-test-run.pl: Enabled --valgrind to work (bug#13280) mysql-test/mysql-test-run.pl: Enabled --valgrind to work (bug#13280) --- mysql-test/mysql-test-run.pl | 122 +++++++++++++++++++++-------------- 1 file changed, 73 insertions(+), 49 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 013b8d49967..cfb67dcae7c 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -237,8 +237,10 @@ our $opt_ps_protocol; our $opt_sleep_time_after_restart= 1; our $opt_sleep_time_for_delete= 10; -our $opt_testcase_timeout= 5; # 5 min max -our $opt_suite_timeout= 120; # 2 hours max +our $opt_testcase_timeout; +our $opt_suite_timeout; +my $default_testcase_timeout= 10; # 10 min max +my $default_suite_timeout= 120; # 2 hours max our $opt_socket; @@ -509,8 +511,8 @@ sub command_line_setup () { # Coverage, profiling etc 'gcov' => \$opt_gcov, 'gprof' => \$opt_gprof, - 'valgrind' => \$opt_valgrind, - 'valgrind-all' => \$opt_valgrind_all, + 'valgrind:s' => \$opt_valgrind, + 'valgrind-all:s' => \$opt_valgrind_all, 'valgrind-options=s' => \$opt_valgrind_options, # Misc @@ -688,29 +690,36 @@ sub command_line_setup () { $opt_with_ndbcluster= 0; } - # FIXME + # The ":s" in the argument spec, means we have three different cases + # + # undefined option not set + # "" option set with no argument + # "somestring" option is name/path of valgrind executable - #if ( $opt_valgrind or $opt_valgrind_all ) - #{ - # VALGRIND=`which valgrind` # this will print an error if not found FIXME - # Give good warning to the user and stop - # if ( ! $VALGRIND ) - # { - # print "You need to have the 'valgrind' program in your PATH to run mysql-test-run with option --valgrind. Valgrind's home page is http://valgrind.kde.org.\n" - # exit 1 - # } + if ( defined $opt_valgrind_all and ! $opt_valgrind ) + { + $opt_valgrind= $opt_valgrind_all; + } + + if ( ! $opt_testcase_timeout ) + { + $opt_testcase_timeout= $default_testcase_timeout; + $opt_testcase_timeout*= 10 if defined $opt_valgrind; + } + + if ( ! $opt_suite_timeout ) + { + $opt_suite_timeout= $default_suite_timeout; + $opt_suite_timeout*= 4 if defined $opt_valgrind; + } + + if ( defined $opt_valgrind ) + { + $opt_sleep_time_after_restart= 10; + $opt_sleep_time_for_delete= 60; # >=2.1.2 requires the --tool option, some versions write to stdout, some to stderr - # valgrind --help 2>&1 | grep "\-\-tool" > /dev/null && VALGRIND="$VALGRIND --tool=memcheck" - # VALGRIND="$VALGRIND --alignment=8 --leak-check=yes --num-callers=16" - # $opt_extra_mysqld_opt.= " --skip-safemalloc --skip-bdb"; - # SLEEP_TIME_AFTER_RESTART=10 - # $opt_sleep_time_for_delete= 60 - # $glob_use_running_server= "" - # if ( "$1"= "--valgrind-all" ) - # { - # VALGRIND="$VALGRIND -v --show-reachable=yes" - # } - #} + # valgrind --help 2>&1 | grep "\-\-tool" > /dev/null && VALGRIND="$VALGRIND --tool=memcheck" + } if ( ! $opt_user ) { @@ -1703,7 +1712,7 @@ sub mysqld_arguments ($$$$$) { mtr_add_arg($args, "%s--language=%s", $prefix, $path_language); mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix); - if ( $opt_valgrind ) + if ( defined $opt_valgrind ) { mtr_add_arg($args, "%s--skip-safemalloc", $prefix); mtr_add_arg($args, "%s--skip-bdb", $prefix); @@ -1928,29 +1937,9 @@ sub mysqld_start ($$$$) { mtr_init_args(\$args); - if ( $opt_valgrind ) + if ( defined $opt_valgrind ) { - - mtr_add_arg($args, "--tool=memcheck"); - mtr_add_arg($args, "--alignment=8"); - mtr_add_arg($args, "--leak-check=yes"); - mtr_add_arg($args, "--num-callers=16"); - - if ( $opt_valgrind_all ) - { - mtr_add_arg($args, "-v"); - mtr_add_arg($args, "--show-reachable=yes"); - } - - if ( $opt_valgrind_options ) - { - # FIXME split earlier and put into @glob_valgrind_* - mtr_add_arg($args, split(' ', $opt_valgrind_options)); - } - - mtr_add_arg($args, $exe); - - $exe= $opt_valgrind; + valgrind_arguments($args, \$exe); } mysqld_arguments($args,$type,$idx,$extra_opt,$slave_master_info); @@ -2121,6 +2110,11 @@ sub run_mysqltest ($) { mtr_init_args(\$args); + if ( defined $opt_valgrind ) + { + valgrind_arguments($args, \$exe); + } + mtr_add_arg($args, "--no-defaults"); mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_mysock'}); mtr_add_arg($args, "--database=test"); @@ -2205,6 +2199,34 @@ sub run_mysqltest ($) { return mtr_run_test($exe,$args,$tinfo->{'path'},"",$path_timefile,""); } + +sub valgrind_arguments { + my $args= shift; + my $exe= shift; + + mtr_add_arg($args, "--tool=memcheck"); # From >= 2.1.2 needs this option + mtr_add_arg($args, "--alignment=8"); + mtr_add_arg($args, "--leak-check=yes"); + mtr_add_arg($args, "--num-callers=16"); + + if ( defined $opt_valgrind_all ) + { + mtr_add_arg($args, "-v"); + mtr_add_arg($args, "--show-reachable=yes"); + } + + if ( $opt_valgrind_options ) + { + # FIXME split earlier and put into @glob_valgrind_* + mtr_add_arg($args, split(' ', $opt_valgrind_options)); + } + + mtr_add_arg($args, $$exe); + + $$exe= $opt_valgrind || "valgrind"; +} + + ############################################################################## # # Usage @@ -2271,7 +2293,9 @@ Options for coverage, profiling etc gcov FIXME gprof FIXME - valgrind FIXME + valgrind[=exe] Run the "mysqltest" executable as well as the "mysqld" + server using valgrind, optionally specifying the + executable path/name valgrind-all FIXME valgrind-options=ARGS Extra options to give valgrind From 7e138425f7c4d28c90b0a134ec112b03892bc974 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Sep 2005 16:17:44 -0700 Subject: [PATCH 026/225] Added testcase for BUG#13118 --- mysql-test/r/federated_bug_13118.result | 39 +++++++++++++++++++++++ mysql-test/t/federated_bug_13118.test | 42 +++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 mysql-test/r/federated_bug_13118.result create mode 100644 mysql-test/t/federated_bug_13118.test diff --git a/mysql-test/r/federated_bug_13118.result b/mysql-test/r/federated_bug_13118.result new file mode 100644 index 00000000000..cc14dae87d9 --- /dev/null +++ b/mysql-test/r/federated_bug_13118.result @@ -0,0 +1,39 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +stop slave; +DROP DATABASE IF EXISTS federated; +CREATE DATABASE federated; +DROP DATABASE IF EXISTS federated; +CREATE DATABASE federated; +DROP TABLE IF EXISTS federated.bug_13118_table; +CREATE TABLE federated.bug_13118_table ( +`foo` integer, +`bar` integer +); +DROP TABLE IF EXISTS federated.t1; +CREATE TABLE federated.t1 ( +`foo` integer, +`bar` integer +) ENGINE="FEDERATED" + CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/bug_13118_table'; +SELECT * from federated.t1; +foo bar +INSERT INTO federated.t1 VALUES (1,1); +SELECT * FROM federated.t1; +foo bar +1 1 +INSERT INTO federated.t1 VALUES (1,1); +SELECT * FROM federated.t1; +foo bar +1 1 +1 1 +DROP TABLE federated.t1; +DROP TABLE federated.bug_13118_table; +DROP TABLE IF EXISTS federated.t1; +DROP DATABASE IF EXISTS federated; +DROP TABLE IF EXISTS federated.t1; +DROP DATABASE IF EXISTS federated; diff --git a/mysql-test/t/federated_bug_13118.test b/mysql-test/t/federated_bug_13118.test new file mode 100644 index 00000000000..deec79becd2 --- /dev/null +++ b/mysql-test/t/federated_bug_13118.test @@ -0,0 +1,42 @@ +source include/federated.inc; + + +connection slave; +--disable_warnings +DROP TABLE IF EXISTS federated.bug_13118_table; +--enable_warnings + +CREATE TABLE federated.bug_13118_table ( + `foo` integer, + `bar` integer + ); + + +connection master; +--disable_warnings +DROP TABLE IF EXISTS federated.t1; +--enable_warnings + +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE federated.t1 ( + `foo` integer, + `bar` integer + ) ENGINE="FEDERATED" + CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/bug_13118_table'; + +SELECT * from federated.t1; + +INSERT INTO federated.t1 VALUES (1,1); +SELECT * FROM federated.t1; + +INSERT INTO federated.t1 VALUES (1,1); +SELECT * FROM federated.t1; + + +DROP TABLE federated.t1; +connection slave; +DROP TABLE federated.bug_13118_table; + + +source include/federated_cleanup.inc; + From 723236944f608f1cc07013a8ab957d35d15fdc27 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Sep 2005 20:07:39 -0500 Subject: [PATCH 027/225] more fixes to the vcproj build process VC++Files/libmysqld/libmysqld.vcproj: cleaned up the dependencies on the embedded server VC++Files/mysql.sln: fixed up more of the inter-project dependencies --- VC++Files/libmysqld/libmysqld.vcproj | 10 +++++----- VC++Files/mysql.sln | 28 +++++++++++++++++++++------- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/VC++Files/libmysqld/libmysqld.vcproj b/VC++Files/libmysqld/libmysqld.vcproj index f1de8649fc7..4dcd6f0714c 100755 --- a/VC++Files/libmysqld/libmysqld.vcproj +++ b/VC++Files/libmysqld/libmysqld.vcproj @@ -37,11 +37,11 @@ Name="VCCustomBuildTool"/> Date: Fri, 16 Sep 2005 18:10:36 -0700 Subject: [PATCH 028/225] Brian's "he is too lazy to commit this so Eric is going to have to do it" environmental variable hack for prefix. This allows you to just set a prefix in your profile which will be used in all of your builds. AKA you can be even lazier(!) about calling BUILD scripts. Don't blame Eric, Brian borrowed his keyboard. BUILD/SETUP.sh: Added option to set environmental variable in case you are lazy about setting prefix (ala Brian) BUILD/autorun.sh: Change of syntax --- BUILD/SETUP.sh | 5 +++++ BUILD/autorun.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 1603cfadbed..1bf3bad5abe 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -10,6 +10,11 @@ prefix_configs="--prefix=/usr/local/mysql" just_print= just_configure= full_debug= +if test -n $MYSQL_BUILD_PREFIX +then + prefix_configs="--prefix=$MYSQL_BUILD_PREFIX" +fi + while test $# -gt 0 do case "$1" in diff --git a/BUILD/autorun.sh b/BUILD/autorun.sh index 47a80a709a8..f5986720b48 100755 --- a/BUILD/autorun.sh +++ b/BUILD/autorun.sh @@ -7,7 +7,7 @@ aclocal || die "Can't execute aclocal" autoheader || die "Can't execute autoheader" # --force means overwrite ltmain.sh script if it already exists # Added glibtoolize reference to make native OSX autotools work -if [ -f /usr/bin/glibtoolize ] ; then +if test -f /usr/bin/glibtoolize ; then glibtoolize --automake --force || die "Can't execute glibtoolize" else libtoolize --automake --force || die "Can't execute libtoolize" From ec71d8854b56f29562b028009b356fef3c9bd07b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Sep 2005 22:51:34 -0500 Subject: [PATCH 029/225] hopefully final set of changes to the libmysqld targets VC++Files/mysql.sln: fixed embedded targets --- VC++Files/mysql.sln | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/VC++Files/mysql.sln b/VC++Files/mysql.sln index 04359d7e9c1..0c800c1a2d3 100755 --- a/VC++Files/mysql.sln +++ b/VC++Files/mysql.sln @@ -310,11 +310,14 @@ Global {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.classic nt.ActiveCfg = Debug|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Debug.ActiveCfg = Debug|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Debug.Build.0 = Debug|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Classic.ActiveCfg = Debug|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Classic.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Classic.Build.0 = Max|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Debug.ActiveCfg = Debug|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Debug.Build.0 = Debug|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Pro.ActiveCfg = Debug|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Pro.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Pro.Build.0 = Max|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Release.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Release.Build.0 = Max|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Max.ActiveCfg = Max|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Max.Build.0 = Max|Win32 {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Max nt.ActiveCfg = Max|Win32 @@ -356,6 +359,7 @@ Global {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Pro.ActiveCfg = Release|Win32 {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Pro.Build.0 = Release|Win32 {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Release.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Release.Build.0 = Release|Win32 {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Max.ActiveCfg = Release|Win32 {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Max.Build.0 = Release|Win32 {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Max nt.ActiveCfg = Release|Win32 @@ -399,6 +403,7 @@ Global {13D37150-54D0-46C5-9519-03923243C7C7}.Debug.ActiveCfg = Debug|Win32 {13D37150-54D0-46C5-9519-03923243C7C7}.Debug.Build.0 = Debug|Win32 {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Classic.ActiveCfg = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Classic.Build.0 = Release|Win32 {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Debug.ActiveCfg = Debug|Win32 {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Debug.Build.0 = Debug|Win32 {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Pro.ActiveCfg = Release|Win32 @@ -1123,6 +1128,7 @@ Global {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Pro.ActiveCfg = Release|Win32 {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Pro.Build.0 = Release|Win32 {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Release.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Release.Build.0 = Release|Win32 {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Max.ActiveCfg = Release|Win32 {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Max.Build.0 = Release|Win32 {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Max nt.ActiveCfg = Release|Win32 From 8618ea6321af617410e8910caad4babe85d67827 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 18 Sep 2005 13:16:32 -0500 Subject: [PATCH 030/225] .del-which.2~463417adb2e37122: Delete: man/which.2 BitKeeper/deleted/.del-which.2~463417adb2e37122: Delete: man/which.2 --- man/which.2 | 54 ----------------------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 man/which.2 diff --git a/man/which.2 b/man/which.2 deleted file mode 100644 index 30d5557ed01..00000000000 --- a/man/which.2 +++ /dev/null @@ -1,54 +0,0 @@ -.TH WHICH 1 "20 December 2000" -.SH NAME -which - Jani please supply one. -.SH USAGE -which [options] [--] programname [...] -.SH SYNOPSIS -.B which -.RB [ \-\-version | \-[vV] ] -.RB [ \-\-skip\-dot ] -.RB [ \-\-skip\-tilde ] -.RB [ \-\-show\-dot ] -.RB [ \-\-show\-tilde ] -.RB [ \-\-tty\-only ] -.RB [ \-\-all | \-a ] -.RB [ \-\-read\-alias | \-i ] -.RB [ \-\-skip\-alias ] -.SH DESCRIPTION -.TP -.BR which -supports by executing -.TP -.BR \-\-version | \-[vV] -Print version and exit successfully. -.TP -.BR \-\-skip\-dot -Skip directories in PATH that start with a dot. -.TP -.BR \-\-skip\-tilde -Skip directories in PATH that start with a tilde. -.TP -.BR \-\-show\-dot -Don\'t expand a dot to current directory in output. -.TP -.BR \-\-show\-tilde -Output a tilde for HOME directory for non-root. -.TP -.BR \-\-tty\-only -Stop processing options on the right if not on tty. -.TP -.BR \-\-all | \-a -Print all matches in PATH, not just the first -.TP -.BR \-\-read\-alias | \-i -Read list of aliases from stdin. -.TP -.BR \-\-skip\-alias -Ignore option -.BR --read-alias; -don\'t read stdin. -.SH "SEE ALSO" -isamchk (1), isamlog (1), mysqlaccess (1), mysqladmin (1), mysqlbug (1), mysqld (1), mysqldump (1), mysqlshow (1), msql2mysql (1), perror (1), replace (1), mysqld_safe (1), which1 (1), zap (1), -.SH AUTHOR -Ver 1.0, distribution 3.23.29a Michael (Monty) Widenius (monty@tcx.se), TCX Datakonsult AB (http://www.tcx.se). This software comes with no warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercurmedia.com) -.\" end of man page \ No newline at end of file From 458aa0e34b3f4f6f5ccac6b03502e88864a2a18b Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 18 Sep 2005 21:43:28 +0200 Subject: [PATCH 031/225] Changes after discussion/review with Sanja sql/parse_file.cc: Fix after discussion/review with Sanja: removed rename_view from sql_view to general function rename_in_schema_file (so it can be used for other .frm types like triggers too) sql/parse_file.h: added prototype for rename_in_schema_file sql/sql_rename.cc: simplified code (thanks to Sanja) sql/sql_view.cc: moved rename_view_files to rename_in_schema_file (parse_file.cc) corrected MYF parameter from MY_WME to 0. --- sql/parse_file.cc | 53 ++++++++++++++++++++++++++++++++++++++++++++++ sql/parse_file.h | 3 +++ sql/sql_rename.cc | 50 +++++++++++++++++++++---------------------- sql/sql_view.cc | 54 +++++++++++++++-------------------------------- 4 files changed, 98 insertions(+), 62 deletions(-) diff --git a/sql/parse_file.cc b/sql/parse_file.cc index 82ce2f2d7b5..5c7053e6e2a 100644 --- a/sql/parse_file.cc +++ b/sql/parse_file.cc @@ -333,6 +333,59 @@ err_w_file: DBUG_RETURN(TRUE); } +/* + Renames a frm file (including backups) in same schema + + SYNOPSIS + rename_in_schema_file + schema name of given schema + old_name original file name + new_name new file name + revision revision number + num_view_backups number of backups + + RETURN + 0 - OK + 1 - Error (only if renaming of frm failed) + +*/ +my_bool rename_in_schema_file(const char *schema, const char *old_name, + const char *new_name, ulonglong revision, + uint num_view_backups) +{ + char old_path[FN_REFLEN], new_path[FN_REFLEN], arc_path[FN_REFLEN]; + + strxnmov(old_path, FN_REFLEN, mysql_data_home, "/", schema, "/", + old_name, reg_ext, NullS); + (void) unpack_filename(old_path, old_path); + + strxnmov(new_path, FN_REFLEN, mysql_data_home, "/", schema, "/", + new_name, reg_ext, NullS); + (void) unpack_filename(new_path, new_path); + + if (my_rename(old_path, new_path, MYF(MY_WME))) + return 1; + + /* check if arc_dir exists */ + strxnmov(arc_path, FN_REFLEN, mysql_data_home, "/", schema, "/arc", NullS); + (void) unpack_filename(arc_path, arc_path); + + if (revision > 0 && !access(arc_path, F_OK)) + { + ulonglong limit= (revision > num_view_backups) ? revision - num_view_backups : 0; + while (revision > limit) { + my_snprintf(old_path, FN_REFLEN, "%s/%s%s-%04lu", + arc_path, old_name, reg_ext, (ulong)revision); + (void) unpack_filename(old_path, old_path); + my_snprintf(new_path, FN_REFLEN, "%s/%s%s-%04lu", + arc_path, new_name, reg_ext, (ulong)revision); + (void) unpack_filename(new_path, new_path); + my_rename(old_path, new_path, MYF(0)); + revision--; + } + } + return 0; +} /* Prepare frm to parse (read to memory) diff --git a/sql/parse_file.h b/sql/parse_file.h index cc0aa6556f6..b4199e4fbf1 100644 --- a/sql/parse_file.h +++ b/sql/parse_file.h @@ -48,6 +48,9 @@ my_bool sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name, const LEX_STRING *type, gptr base, File_option *parameters, uint versions); +my_bool rename_in_schema_file(const char *schema, const char *old_name, + const char *new_name, ulonglong revision, + uint num_view_backups); class File_parser: public Sql_alloc { diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index b848809ccc9..154e828b47e 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -138,7 +138,7 @@ rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error) for (ren_table= table_list; ren_table; ren_table= new_table->next_local) { - db_type table_type; + int rc= 1; char name[FN_REFLEN]; const char *new_alias, *old_alias; @@ -165,36 +165,36 @@ rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error) ren_table->db, old_alias, reg_ext); unpack_filename(name, name); - if ((frm_type= mysql_frm_type(name)) == FRMTYPE_TABLE && - (table_type= get_table_type(thd, name)) == DB_TYPE_UNKNOWN) + + frm_type= mysql_frm_type(name); + switch (frm_type) { - my_error(ER_FILE_NOT_FOUND, MYF(0), name, my_errno); - if (!skip_error) - DBUG_RETURN(ren_table); - } - else { - int rc= 1; - switch (frm_type) + case FRMTYPE_TABLE: { - case FRMTYPE_TABLE: + db_type table_type; + if ((table_type= get_table_type(thd, name)) == DB_TYPE_UNKNOWN) + my_error(ER_FILE_NOT_FOUND, MYF(0), name, my_errno); + else rc= mysql_rename_table(table_type, ren_table->db, old_alias, new_table->db, new_alias); - break; - case FRMTYPE_VIEW: - /* change of schema is not allowed */ - if (strcmp(ren_table->db, new_table->db)) - my_error(ER_FORBID_SCHEMA_CHANGE, MYF(0), ren_table->db, - new_table->db); - else - rc= mysql_rename_view(thd, new_alias, ren_table); - break; - case FRMTYPE_ERROR: - default: - my_error(ER_FILE_NOT_FOUND, MYF(0), name, my_errno); + break; } - if (rc && !skip_error) - DBUG_RETURN(ren_table); + case FRMTYPE_VIEW: + /* change of schema is not allowed */ + if (strcmp(ren_table->db, new_table->db)) + my_error(ER_FORBID_SCHEMA_CHANGE, MYF(0), ren_table->db, + new_table->db); + else + rc= mysql_rename_view(thd, new_alias, ren_table); + break; + default: + DBUG_ASSERT(0); // should never happen + case FRMTYPE_ERROR: + my_error(ER_FILE_NOT_FOUND, MYF(0), name, my_errno); + break; } + if (rc && !skip_error) + DBUG_RETURN(ren_table); } DBUG_RETURN(0); } diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 2e4e9c54b01..b742ec49922 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1167,7 +1167,7 @@ frm_type_enum mysql_frm_type(char *path) int length; DBUG_ENTER("mysql_frm_type"); - if ((file= my_open(path, O_RDONLY | O_SHARE, MYF(MY_WME))) < 0) + if ((file= my_open(path, O_RDONLY | O_SHARE, MYF(0))) < 0) { DBUG_RETURN(FRMTYPE_ERROR); } @@ -1372,43 +1372,21 @@ int view_checksum(THD *thd, TABLE_LIST *view) HA_ADMIN_OK); } -bool rename_view_files(const char *schema, const char *old_name, - const char *new_name, ulonglong revision) -{ - char old_path[FN_REFLEN], new_path[FN_REFLEN], arc_path[FN_REFLEN]; +/* + rename view - strxnmov(old_path, FN_REFLEN, mysql_data_home, "/", schema, "/", - old_name, reg_ext, NullS); - (void) unpack_filename(old_path, old_path); + Synopsis: + renames a view - strxnmov(new_path, FN_REFLEN, mysql_data_home, "/", schema, "/", - new_name, reg_ext, NullS); - (void) unpack_filename(new_path, new_path); - - if (my_rename(old_path, new_path, MYF(MY_WME))) - return 1; - - /* check if arc_dir exists */ - strxnmov(arc_path, FN_REFLEN, mysql_data_home, "/", schema, "/arc", NullS); - (void) unpack_filename(arc_path, arc_path); - - if (revision && !access(arc_path, F_OK)) - { - while (revision) { - my_snprintf(old_path, FN_REFLEN, "%s/%s%s-%04lu", - arc_path, old_name, reg_ext, (ulong)revision); - (void) unpack_filename(old_path, old_path); - my_snprintf(new_path, FN_REFLEN, "%s/%s%s-%04lu", - arc_path, new_name, reg_ext, (ulong)revision); - (void) unpack_filename(new_path, new_path); - if (my_rename(old_path, new_path, MYF(0))) - return 0; - revision--; - } - } - return 0; -} + Parameters: + thd thread handler + new_name new name of view + view view + Return values: + FALSE Ok + TRUE Error +*/ bool mysql_rename_view(THD *thd, const char *new_name, @@ -1438,7 +1416,8 @@ mysql_rename_view(THD *thd, DBUG_RETURN(1); /* rename view and it's backups */ - if (rename_view_files(view->db, view->table_name, new_name, view->revision - 1)) + if (rename_in_schema_file(view->db, view->table_name, new_name, + view->revision - 1, num_view_backups)) DBUG_RETURN(1); strxnmov(dir_buff, FN_REFLEN, mysql_data_home, "/", view->db, "/", NullS); @@ -1454,7 +1433,8 @@ mysql_rename_view(THD *thd, if (sql_create_definition_file(&pathstr, &file, view_file_type, (gptr)view, view_parameters, num_view_backups)) { /* restore renamed view in case of error */ - rename_view_files(view->db, new_name, view->table_name, view->revision - 1); + rename_in_schema_file(view->db, new_name, view->table_name, + view->revision - 1, num_view_backups); DBUG_RETURN(1); } } else From 5bc4501259fff34c4afa15478f715d098f55c584 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Sep 2005 04:39:49 +0400 Subject: [PATCH 032/225] Fix bug #13218: InnoDB: using a partial-field key prefix in search This is backport from 5.0 of fix for bug #11039 mysql-test/t/innodb.test: Backport from 5.0 of test case for bug#11039 mysql-test/r/innodb.result: Backport from 5.0 of test case for bug#11039 sql/opt_sum.cc: Fix bug #13218: backport from 5.0 of bug #11039 fix --- mysql-test/r/innodb.result | 9 +++++++++ mysql-test/t/innodb.test | 9 +++++++++ sql/opt_sum.cc | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index f47c78c9768..c7aef8ed792 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1685,3 +1685,12 @@ explain select * from t1 order by a,b,c,d; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using filesort drop table t1; +create table t1 (a char(1), b char(1), key(a, b)) engine=innodb; +insert into t1 values ('8', '6'), ('4', '7'); +select min(a) from t1; +min(a) +4 +select min(b) from t1 where a='8'; +min(b) +6 +drop table t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index a14370c6543..b966ea5b281 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1230,4 +1230,13 @@ select * from t1 order by a,b,c,d; explain select * from t1 order by a,b,c,d; drop table t1; +# +# BUG#11039,#13218 Wrong key length in min() +# + +create table t1 (a char(1), b char(1), key(a, b)) engine=innodb; +insert into t1 values ('8', '6'), ('4', '7'); +select min(a) from t1; +select min(b) from t1 where a='8'; +drop table t1; # End of 4.1 tests diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index 4ab506cc4e1..cb8e3c2d273 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -661,7 +661,8 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref, If key_part2 may be NULL, then we want to find the first row that is not null */ - ref->key_buff[ref->key_length++]= 1; + ref->key_buff[ref->key_length]= 1; + ref->key_length+= part->store_length; *range_fl&= ~NO_MIN_RANGE; *range_fl|= NEAR_MIN; // > NULL } From cb0a436c1eca7f2f47b9b3b659da3a745abbff75 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Sep 2005 09:48:03 +0500 Subject: [PATCH 033/225] ctype_utf8.result, ctype_utf8.test: Bug#10504: additional test mysql-test/t/ctype_utf8.test: Bug#10504: additional test mysql-test/r/ctype_utf8.result: Bug#10504: additional test --- mysql-test/r/ctype_utf8.result | 6 ++++++ mysql-test/t/ctype_utf8.test | 2 ++ 2 files changed, 8 insertions(+) diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index eeeb0897b88..8e10e97d49d 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -1034,6 +1034,12 @@ hex(char(1)) select char(0xd1,0x8f); char(0xd1,0x8f) я▐ +select char(0xd18f); +char(0xd18f) +я▐ +select char(53647); +char(53647) +я▐ select char(0xff,0x8f); char(0xff,0x8f) Ъ▐ diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 920506a0eb9..b009e13874f 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -871,6 +871,8 @@ set names utf8; # correct value select hex(char(1)); select char(0xd1,0x8f); +select char(0xd18f); +select char(53647); # incorrect value: return with warning select char(0xff,0x8f); # incorrect value in strict mode: return NULL with "Error" level warning From 56f457b67f01a87c2828920040767d302f7b79cb Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Sep 2005 12:24:59 +0200 Subject: [PATCH 034/225] Clean up printout of line numbers client/mysqltest.c: Only print line no if start_lineno > 0 Remove lineno in calls to verbose_msg and die, this is handled by the function. --- client/mysqltest.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 3e2cde92aa9..19c74629a55 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -610,7 +610,9 @@ static void verbose_msg(const char *fmt, ...) va_start(args, fmt); - fprintf(stderr, "mysqltest: At line %u: ", start_lineno); + fprintf(stderr, "mysqltest: "); + if (start_lineno > 0) + fprintf(stderr, "At line %u: ", start_lineno); vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); va_end(args); @@ -1345,9 +1347,7 @@ int do_sync_with_master2(long offset) int rpl_parse; if (!master_pos.file[0]) - { - die("Line %u: Calling 'sync_with_master' without calling 'save_master_pos'", start_lineno); - } + die("Calling 'sync_with_master' without calling 'save_master_pos'"); rpl_parse= mysql_rpl_parse_enabled(mysql); mysql_disable_rpl_parse(mysql); @@ -1357,14 +1357,13 @@ int do_sync_with_master2(long offset) wait_for_position: if (mysql_query(mysql, query_buf)) - die("line %u: failed in %s: %d: %s", start_lineno, query_buf, - mysql_errno(mysql), mysql_error(mysql)); + die("failed in %s: %d: %s", query_buf, mysql_errno(mysql), + mysql_error(mysql)); if (!(last_result= res= mysql_store_result(mysql))) - die("line %u: mysql_store_result() returned NULL for '%s'", start_lineno, - query_buf); + die("mysql_store_result() returned NULL for '%s'", query_buf); if (!(row= mysql_fetch_row(res))) - die("line %u: empty result in %s", start_lineno, query_buf); + die("empty result in %s", query_buf); if (!row[0]) { /* @@ -1372,10 +1371,7 @@ wait_for_position: SLAVE has been issued ? */ if (tries++ == 3) - { - die("line %u: could not sync with master ('%s' returned NULL)", - start_lineno, query_buf); - } + die("could not sync with master ('%s' returned NULL)", query_buf); sleep(1); /* So at most we will wait 3 seconds and make 4 tries */ mysql_free_result(res); goto wait_for_position; @@ -1421,10 +1417,9 @@ int do_save_master_pos() mysql_errno(mysql), mysql_error(mysql)); if (!(last_result =res = mysql_store_result(mysql))) - die("line %u: mysql_store_result() retuned NULL for '%s'", start_lineno, - query); + die("mysql_store_result() retuned NULL for '%s'", query); if (!(row = mysql_fetch_row(res))) - die("line %u: empty result in show master status", start_lineno); + die("empty result in show master status"); strnmov(master_pos.file, row[0], sizeof(master_pos.file)-1); master_pos.pos = strtoul(row[1], (char**) 0, 10); mysql_free_result(res); last_result=0; From 7150244e506bfa55fc9c2fbbaf6c1cb1d2bb72e6 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Sep 2005 14:05:54 +0200 Subject: [PATCH 035/225] bug#9282 - ndb big delete from causing NdbObjectIdMap::expand at same time as receiver thread perform getObjectId ndb/src/ndbapi/Ndbinit.cpp: Protect NdbObjectIdMap::expand from getObjectId ndb/src/ndbapi/ObjectMap.hpp: Protect NdbObjectIdMap::expand from getObjectId --- ndb/src/ndbapi/Ndbinit.cpp | 3 ++- ndb/src/ndbapi/ObjectMap.hpp | 33 ++++++++++++++++++++------------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp index a11dd842495..cbb344d3680 100644 --- a/ndb/src/ndbapi/Ndbinit.cpp +++ b/ndb/src/ndbapi/Ndbinit.cpp @@ -296,7 +296,8 @@ NdbImpl::NdbImpl(Ndb_cluster_connection *ndb_cluster_connection, : m_ndb_cluster_connection(ndb_cluster_connection->m_impl), m_dictionary(ndb), theCurrentConnectIndex(0), - theNdbObjectIdMap(1024,1024), + theNdbObjectIdMap(ndb_cluster_connection->m_impl.m_transporter_facade->theMutexPtr, + 1024,1024), theNoOfDBnodes(0) { int i; diff --git a/ndb/src/ndbapi/ObjectMap.hpp b/ndb/src/ndbapi/ObjectMap.hpp index 21407279f0b..c730d1ce6b1 100644 --- a/ndb/src/ndbapi/ObjectMap.hpp +++ b/ndb/src/ndbapi/ObjectMap.hpp @@ -30,7 +30,7 @@ class NdbObjectIdMap //: NdbLockable { public: STATIC_CONST( InvalidId = ~(Uint32)0 ); - NdbObjectIdMap(Uint32 initalSize = 128, Uint32 expandSize = 10); + NdbObjectIdMap(NdbMutex*, Uint32 initalSize = 128, Uint32 expandSize = 10); ~NdbObjectIdMap(); Uint32 map(void * object); @@ -46,14 +46,16 @@ private: void * m_obj; } * m_map; + NdbMutex * m_mutex; void expand(Uint32 newSize); }; inline -NdbObjectIdMap::NdbObjectIdMap(Uint32 sz, Uint32 eSz) { +NdbObjectIdMap::NdbObjectIdMap(NdbMutex* mutex, Uint32 sz, Uint32 eSz) { m_size = 0; m_firstFree = InvalidId; m_map = 0; + m_mutex = mutex; m_expandSize = eSz; expand(sz); #ifdef DEBUG_OBJECTMAP @@ -131,21 +133,26 @@ NdbObjectIdMap::getObject(Uint32 id){ inline void NdbObjectIdMap::expand(Uint32 incSize){ + NdbMutex_Lock(m_mutex); Uint32 newSize = m_size + incSize; - MapEntry * tmp = (MapEntry*)malloc(newSize * sizeof(MapEntry)); + MapEntry * tmp = (MapEntry*)realloc(m_map, newSize * sizeof(MapEntry)); - if (m_map) { - memcpy(tmp, m_map, m_size * sizeof(MapEntry)); - free((void*)m_map); + if (likely(tmp != 0)) + { + m_map = tmp; + + for(Uint32 i = m_size; i Date: Mon, 19 Sep 2005 14:58:06 +0200 Subject: [PATCH 036/225] mysql-test-run.pl: Added flag --valgrind-mysqltest mysql-test/mysql-test-run.pl: Added flag --valgrind-mysqltest --- mysql-test/mysql-test-run.pl | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index cfb67dcae7c..cd182e8fc73 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -258,6 +258,7 @@ our $opt_user; our $opt_user_test; our $opt_valgrind; +our $opt_valgrind_mysqltest; our $opt_valgrind_all; our $opt_valgrind_options; @@ -512,6 +513,7 @@ sub command_line_setup () { 'gcov' => \$opt_gcov, 'gprof' => \$opt_gprof, 'valgrind:s' => \$opt_valgrind, + 'valgrind-mysqltest:s' => \$opt_valgrind_mysqltest, 'valgrind-all:s' => \$opt_valgrind_all, 'valgrind-options=s' => \$opt_valgrind_options, @@ -696,9 +698,15 @@ sub command_line_setup () { # "" option set with no argument # "somestring" option is name/path of valgrind executable - if ( defined $opt_valgrind_all and ! $opt_valgrind ) + # Take executable path from any of them, if any + $opt_valgrind= $opt_valgrind_mysqltest if $opt_valgrind_mysqltest; + $opt_valgrind= $opt_valgrind_all if $opt_valgrind_all; + + # If valgrind flag not defined, define if other valgrind flags are + unless ( defined $opt_valgrind ) { - $opt_valgrind= $opt_valgrind_all; + $opt_valgrind= "" + if defined $opt_valgrind_mysqltest or defined $opt_valgrind_all; } if ( ! $opt_testcase_timeout ) @@ -2110,7 +2118,7 @@ sub run_mysqltest ($) { mtr_init_args(\$args); - if ( defined $opt_valgrind ) + if ( defined $opt_valgrind_mysqltest ) { valgrind_arguments($args, \$exe); } @@ -2208,6 +2216,8 @@ sub valgrind_arguments { mtr_add_arg($args, "--alignment=8"); mtr_add_arg($args, "--leak-check=yes"); mtr_add_arg($args, "--num-callers=16"); + mtr_add_arg($args, "--suppressions=%s/valgrind.supp", $glob_mysql_test_dir) + if -f "$glob_mysql_test_dir/valgrind.supp"; if ( defined $opt_valgrind_all ) { @@ -2293,10 +2303,11 @@ Options for coverage, profiling etc gcov FIXME gprof FIXME - valgrind[=exe] Run the "mysqltest" executable as well as the "mysqld" + valgrind[=EXE] Run the "mysqltest" executable as well as the "mysqld" server using valgrind, optionally specifying the executable path/name - valgrind-all FIXME + valgrind-mysqltest[=EXE] In addition, run the "mysqltest" executable with valgrind + valgrind-all[=EXE] Adds verbose flag, and --show-reachable to valgrind valgrind-options=ARGS Extra options to give valgrind Misc options From b390a1a4000d15588162cddc445fb9663ae3c089 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Sep 2005 15:35:07 +0200 Subject: [PATCH 037/225] ndb - imlp. show engine ndb status; that dump free list allocation per connection sql/ha_ndbcluster.cc: imlp. show engine ndb status; that dump free list allocation per connection sql/ha_ndbcluster.h: imlp. show engine ndb status; that dump free list allocation per connection sql/mysqld.cc: imlp. show engine ndb status; that dump free list allocation per connection sql/sql_lex.h: imlp. show engine ndb status; that dump free list allocation per connection sql/sql_parse.cc: imlp. show engine ndb status; that dump free list allocation per connection sql/sql_yacc.yy: imlp. show engine ndb status; that dump free list allocation per connection --- sql/ha_ndbcluster.cc | 46 ++++++++++++++++++++++++++++++++++++++++++++ sql/ha_ndbcluster.h | 2 ++ sql/mysqld.cc | 1 + sql/sql_lex.h | 2 +- sql/sql_parse.cc | 11 +++++++++++ sql/sql_yacc.yy | 3 +++ 6 files changed, 64 insertions(+), 1 deletion(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index d1de0bd100e..cc60c807bc9 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -5096,4 +5096,50 @@ int ha_ndbcluster::write_ndb_file() DBUG_RETURN(error); } +int +ndbcluster_show_status(THD* thd) +{ + Protocol *protocol= thd->protocol; + + DBUG_ENTER("ndbcluster_show_status"); + + if (have_ndbcluster != SHOW_OPTION_YES) + { + my_message(ER_NOT_SUPPORTED_YET, + "Cannot call SHOW NDBCLUSTER STATUS because skip-ndbcluster is defined", + MYF(0)); + DBUG_RETURN(TRUE); + } + + List field_list; + field_list.push_back(new Item_empty_string("free_list", 255)); + field_list.push_back(new Item_return_int("created", 10,MYSQL_TYPE_LONG)); + field_list.push_back(new Item_return_int("free", 10,MYSQL_TYPE_LONG)); + field_list.push_back(new Item_return_int("sizeof", 10,MYSQL_TYPE_LONG)); + + if (protocol->send_fields(&field_list, 1)) + DBUG_RETURN(TRUE); + + if (thd->transaction.thd_ndb && + ((Thd_ndb*)thd->transaction.thd_ndb)->ndb) + { + Ndb* ndb= ((Thd_ndb*)thd->transaction.thd_ndb)->ndb; + Ndb::Free_list_usage tmp; tmp.m_name= 0; + while (ndb->get_free_list_usage(&tmp)) + { + protocol->prepare_for_resend(); + + protocol->store(tmp.m_name, &my_charset_bin); + protocol->store((uint)tmp.m_created); + protocol->store((uint)tmp.m_free); + protocol->store((uint)tmp.m_sizeof); + if (protocol->write()) + DBUG_RETURN(TRUE); + } + } + send_eof(thd); + + DBUG_RETURN(FALSE); +} + #endif /* HAVE_NDBCLUSTER_DB */ diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 4b3a30fb9b9..90d5d59cabe 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -279,3 +279,5 @@ int ndbcluster_table_exists_in_engine(THD* thd, int ndbcluster_drop_database(const char* path); void ndbcluster_print_error(int error, const NdbOperation *error_op); + +int ndbcluster_show_status(THD*); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 86ba437596d..c67cd45ab63 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5492,6 +5492,7 @@ struct show_var_st status_vars[]= { {"Com_show_fields", (char*) (com_stat+(uint) SQLCOM_SHOW_FIELDS),SHOW_LONG}, {"Com_show_grants", (char*) (com_stat+(uint) SQLCOM_SHOW_GRANTS),SHOW_LONG}, {"Com_show_innodb_status", (char*) (com_stat+(uint) SQLCOM_SHOW_INNODB_STATUS),SHOW_LONG}, + {"Com_show_ndb_status", (char*) (com_stat+(uint) SQLCOM_SHOW_NDBCLUSTER_STATUS),SHOW_LONG}, {"Com_show_keys", (char*) (com_stat+(uint) SQLCOM_SHOW_KEYS),SHOW_LONG}, {"Com_show_logs", (char*) (com_stat+(uint) SQLCOM_SHOW_LOGS),SHOW_LONG}, {"Com_show_master_status", (char*) (com_stat+(uint) SQLCOM_SHOW_MASTER_STAT),SHOW_LONG}, diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 07b5c9d8edf..8d919f12563 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -49,7 +49,7 @@ enum enum_sql_command { SQLCOM_SHOW_DATABASES, SQLCOM_SHOW_TABLES, SQLCOM_SHOW_FIELDS, SQLCOM_SHOW_KEYS, SQLCOM_SHOW_VARIABLES, SQLCOM_SHOW_LOGS, SQLCOM_SHOW_STATUS, - SQLCOM_SHOW_INNODB_STATUS, + SQLCOM_SHOW_INNODB_STATUS,SQLCOM_SHOW_NDBCLUSTER_STATUS, SQLCOM_SHOW_PROCESSLIST, SQLCOM_SHOW_MASTER_STAT, SQLCOM_SHOW_SLAVE_STAT, SQLCOM_SHOW_GRANTS, SQLCOM_SHOW_CREATE, SQLCOM_SHOW_CHARSETS, SQLCOM_SHOW_COLLATIONS, SQLCOM_SHOW_CREATE_DB, diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 131fe3d691d..efc18c68ec7 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -25,6 +25,10 @@ #include "ha_innodb.h" #endif +#ifdef HAVE_NDBCLUSTER_DB +#include "ha_ndbcluster.h" +#endif + #ifdef HAVE_OPENSSL /* Without SSL the handshake consists of one packet. This packet @@ -2386,6 +2390,13 @@ mysql_execute_command(THD *thd) res = load_master_data(thd); break; #endif /* HAVE_REPLICATION */ +#ifdef HAVE_NDBCLUSTER_DB + case SQLCOM_SHOW_NDBCLUSTER_STATUS: + { + res = ndbcluster_show_status(thd); + break; + } +#endif #ifdef HAVE_INNOBASE_DB case SQLCOM_SHOW_INNODB_STATUS: { diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 6283cad7cc8..57a06943454 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -4533,6 +4533,9 @@ show_engine_param: STATUS_SYM { switch (Lex->create_info.db_type) { + case DB_TYPE_NDBCLUSTER: + Lex->sql_command = SQLCOM_SHOW_NDBCLUSTER_STATUS; + break; case DB_TYPE_INNODB: Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS; break; From 380db36804e5bdda741c0cbe96579b174561547e Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Sep 2005 15:52:57 +0200 Subject: [PATCH 038/225] Corrected last fix for Bug #13152 bit fields and fields that follow become corrupted when dumped from NDB tables --- sql/table.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sql/table.cc b/sql/table.cc index 74ffe58e42e..67d4ebd713b 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -287,8 +287,6 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, keynames=(char*) key_part; strpos+= (strmov(keynames, (char *) strpos) - keynames)+1; - share->null_bytes= null_pos - (uchar*) outparam->null_flags + (null_bit_pos + 7) / 8; - share->reclength = uint2korr((head+16)); if (*(head+26) == 1) share->system= 1; /* one-record-database */ @@ -459,6 +457,9 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, { outparam->null_flags=null_pos=(uchar*) record+1; null_bit_pos= (db_create_options & HA_OPTION_PACK_RECORD) ? 0 : 1; + /* null_bytes below is only correct under the condition that + there are no bit fields. Correct values is set below after the + table struct is initialized */ share->null_bytes= (share->null_fields + null_bit_pos + 7) / 8; } else @@ -871,6 +872,9 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, } } + /* the correct null_bytes can now be set, since bitfields have been taken into account */ + share->null_bytes= null_pos - (uchar*) outparam->null_flags + (null_bit_pos + 7) / 8; + /* The table struct is now initialized; Open the table */ error=2; if (db_stat) From a89807336f8fa8b39bd519198f26db6c2b1fb247 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Sep 2005 18:45:22 +0300 Subject: [PATCH 039/225] Fixed Bug#13275 mysqltest empty file bug --- client/mysqltest.c | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 582ce7c37ad..9633dd189b5 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -92,6 +92,9 @@ #define SLAVE_POLL_INTERVAL 300000 /* 0.3 of a sec */ +#define RESULT_OK 0 +#define RESULT_CONTENT_MISMATCH 1 +#define RESULT_LENGTH_MISMATCH 2 enum {OPT_MANAGER_USER=256,OPT_MANAGER_HOST,OPT_MANAGER_PASSWD, OPT_MANAGER_PORT,OPT_MANAGER_WAIT_TIMEOUT, OPT_SKIP_SAFEMALLOC, @@ -546,7 +549,7 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char* fname) { DBUG_PRINT("info",("Size differs: result size: %u file size: %u", ds->length, stat_info.st_size)); - DBUG_RETURN(2); + DBUG_RETURN(RESULT_LENGTH_MISMATCH); } if (!(tmp = (char*) my_malloc(stat_info.st_size + 1, MYF(MY_WME)))) die(NullS); @@ -563,7 +566,7 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char* fname) res_ptr = res_ds.str; if ((res_len = res_ds.length) != ds->length) { - res = 2; + res= RESULT_LENGTH_MISMATCH; goto err; } } @@ -573,7 +576,8 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char* fname) res_len = stat_info.st_size; } - res = (memcmp(res_ptr, ds->str, res_len)) ? 1 : 0; + res= (memcmp(res_ptr, ds->str, res_len)) ? + RESULT_CONTENT_MISMATCH : RESULT_OK; err: if (res && eval_result) @@ -590,21 +594,21 @@ err: static int check_result(DYNAMIC_STRING* ds, const char* fname, my_bool require_option) { - int error = 0; - int res=dyn_string_cmp(ds, fname); + int error= RESULT_OK; + int res= dyn_string_cmp(ds, fname); if (res && require_option) abort_not_supported_test(); switch (res) { - case 0: + case RESULT_OK: break; /* ok */ - case 2: + case RESULT_LENGTH_MISMATCH: verbose_msg("Result length mismatch"); - error = 1; + error= RESULT_LENGTH_MISMATCH; break; - case 1: + case RESULT_CONTENT_MISMATCH: verbose_msg("Result content mismatch"); - error = 1; + error= RESULT_CONTENT_MISMATCH; break; default: /* impossible */ die("Unknown error code from dyn_string_cmp()"); @@ -2451,8 +2455,9 @@ int main(int argc, char **argv) { int error = 0; struct st_query *q; - my_bool require_file=0, q_send_flag=0; + my_bool require_file=0, q_send_flag=0, query_executed= 0; char save_file[FN_REFLEN]; + MY_STAT res_info; MY_INIT(argv[0]); { DBUG_ENTER("main"); @@ -2577,6 +2582,7 @@ int main(int argc, char **argv) save_file[0]=0; } error |= run_query(&cur_con->mysql, q, flags); + query_executed= 1; break; } case Q_SEND: @@ -2596,6 +2602,7 @@ int main(int argc, char **argv) is given on this connection. */ error |= run_query(&cur_con->mysql, q, QUERY_SEND); + query_executed= 1; break; case Q_RESULT: get_file_name(save_file,q); @@ -2637,6 +2644,7 @@ int main(int argc, char **argv) break; case Q_EXEC: (void) do_exec(q); + query_executed= 1; break; default: processed = 0; break; } @@ -2655,6 +2663,18 @@ int main(int argc, char **argv) parser.current_line += current_line_inc; } + if (!query_executed && result_file && my_stat(result_file, &res_info, 0)) + { + /* + my_stat() successful on result file. Check if we have not run a + single query, but we do have a result file that contains data. + Note that we don't care, if my_stat() fails. For example for + non-existing or non-readable file we assume it's fine to have + no query output from the test file, e.g. regarded as no error. + */ + if (res_info.st_size) + error|= (RESULT_CONTENT_MISMATCH | RESULT_LENGTH_MISMATCH); + } if (result_file && ds_res.length) { if (!record) From fa8fcecb8eb1dafeb51b69901fbf53682f81f4dc Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Sep 2005 12:06:23 -0700 Subject: [PATCH 040/225] Cleanup for handlerton structure to allow for loadable engine work. This is the first in a series of patches. sql/examples/ha_archive.cc: Now declared externally. sql/examples/ha_example.cc: Now declared externally sql/examples/ha_tina.cc: Now declared externally sql/ha_berkeley.cc: Now declared externally sql/ha_blackhole.cc: Now declared externally sql/ha_federated.cc: Now declared externally. sql/ha_heap.cc: Now declared externally. sql/ha_innodb.cc: Now declared externally. sql/ha_myisam.cc: Now declared externally sql/ha_myisammrg.cc: Now declared externally. sql/ha_ndbcluster.cc: Now declared externally. sql/handler.cc: Changes for eventual loadable engines. This will allow us to gain faster access to the handlerton (eventually this will just be a handlteron array). sql/handler.h: New alias structure and change to show_table_st to place handlerton in the structure. --- sql/examples/ha_archive.cc | 2 +- sql/examples/ha_example.cc | 2 +- sql/examples/ha_tina.cc | 2 +- sql/ha_berkeley.cc | 2 +- sql/ha_blackhole.cc | 2 +- sql/ha_federated.cc | 2 +- sql/ha_heap.cc | 2 +- sql/ha_innodb.cc | 2 +- sql/ha_myisam.cc | 2 +- sql/ha_myisammrg.cc | 4 +- sql/ha_ndbcluster.cc | 2 +- sql/handler.cc | 286 ++++++++++++++++++++++++++----------- sql/handler.h | 21 ++- 13 files changed, 227 insertions(+), 104 deletions(-) diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index 85104405024..7a0c957e5c3 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -136,7 +136,7 @@ static HASH archive_open_tables; #define ARCHIVE_CHECK_HEADER 254 // The number we use to determine corruption /* dummy handlerton - only to have something to return from archive_db_init */ -static handlerton archive_hton = { +handlerton archive_hton = { "archive", 0, /* slot */ 0, /* savepoint size. */ diff --git a/sql/examples/ha_example.cc b/sql/examples/ha_example.cc index dfc2fa7a260..cc4ad3eb535 100644 --- a/sql/examples/ha_example.cc +++ b/sql/examples/ha_example.cc @@ -73,7 +73,7 @@ #include "ha_example.h" -static handlerton example_hton= { +handlerton example_hton= { "CSV", 0, /* slot */ 0, /* savepoint size. */ diff --git a/sql/examples/ha_tina.cc b/sql/examples/ha_tina.cc index 5c3cbdcf2ca..e01cc7cc980 100644 --- a/sql/examples/ha_tina.cc +++ b/sql/examples/ha_tina.cc @@ -54,7 +54,7 @@ pthread_mutex_t tina_mutex; static HASH tina_open_tables; static int tina_init= 0; -static handlerton tina_hton= { +handlerton tina_hton= { "CSV", 0, /* slot */ 0, /* savepoint size. */ diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index b8a779c08cf..2f47b03de9d 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -107,7 +107,7 @@ static int berkeley_close_connection(THD *thd); static int berkeley_commit(THD *thd, bool all); static int berkeley_rollback(THD *thd, bool all); -static handlerton berkeley_hton = { +handlerton berkeley_hton = { "BerkeleyDB", 0, /* slot */ 0, /* savepoint size */ diff --git a/sql/ha_blackhole.cc b/sql/ha_blackhole.cc index a287d6e446b..f089b67d678 100644 --- a/sql/ha_blackhole.cc +++ b/sql/ha_blackhole.cc @@ -26,7 +26,7 @@ /* Blackhole storage engine handlerton */ -static handlerton blackhole_hton= { +handlerton blackhole_hton= { "BLACKHOLE", 0, /* slot */ 0, /* savepoint size. */ diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index 83224649842..aac43647e15 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -690,7 +690,7 @@ error: /* Federated storage engine handlerton */ -static handlerton federated_hton= { +handlerton federated_hton= { "FEDERATED", 0, /* slot */ 0, /* savepoint size. */ diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 94ee3f8e656..fafd597e858 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -23,7 +23,7 @@ #include #include "ha_heap.h" -static handlerton heap_hton= { +handlerton heap_hton= { "MEMORY", 0, /* slot */ 0, /* savepoint size. */ diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 4ed5fadb603..491aaf5a226 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -206,7 +206,7 @@ static int innobase_rollback_to_savepoint(THD* thd, void *savepoint); static int innobase_savepoint(THD* thd, void *savepoint); static int innobase_release_savepoint(THD* thd, void *savepoint); -static handlerton innobase_hton = { +handlerton innobase_hton = { "InnoDB", 0, /* slot */ sizeof(trx_named_savept_t), /* savepoint size. TODO: use it */ diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 8f3970d69e6..bd4717eb02f 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -46,7 +46,7 @@ TYPELIB myisam_recover_typelib= {array_elements(myisam_recover_names)-1,"", /* MyISAM handlerton */ -static handlerton myisam_hton= { +handlerton myisam_hton= { "MyISAM", 0, /* slot */ 0, /* savepoint size. */ diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index f92717e11eb..8347dcdaa3e 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -34,8 +34,8 @@ /* MyISAM MERGE handlerton */ -static handlerton myisammrg_hton= { - "MRG_MyISAM", +handlerton myisammrg_hton= { + "MRG_MYISAM", 0, /* slot */ 0, /* savepoint size. */ NULL, /* close_connection */ diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index ff631ac9db8..f069db09382 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -49,7 +49,7 @@ static int ndbcluster_close_connection(THD *thd); static int ndbcluster_commit(THD *thd, bool all); static int ndbcluster_rollback(THD *thd, bool all); -static handlerton ndbcluster_hton = { +handlerton ndbcluster_hton = { "ndbcluster", 0, /* slot */ 0, /* savepoint size */ diff --git a/sql/handler.cc b/sql/handler.cc index b3754891d05..543d4a5877c 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -27,31 +27,44 @@ #include "ha_myisammrg.h" #ifdef HAVE_BERKELEY_DB #include "ha_berkeley.h" +extern handlerton berkeley_hton; #endif #ifdef HAVE_BLACKHOLE_DB #include "ha_blackhole.h" +extern handlerton blackhole_hton; #endif #ifdef HAVE_EXAMPLE_DB #include "examples/ha_example.h" +extern handlerton example_hton; #endif #ifdef HAVE_ARCHIVE_DB #include "examples/ha_archive.h" +extern handlerton archive_hton; #endif #ifdef HAVE_CSV_DB #include "examples/ha_tina.h" +extern handlerton tina_hton; #endif #ifdef HAVE_INNOBASE_DB #include "ha_innodb.h" +extern handlerton innobase_hton; #endif #ifdef HAVE_NDBCLUSTER_DB #include "ha_ndbcluster.h" +extern handlerton ndbcluster_hton; #endif #ifdef HAVE_FEDERATED_DB #include "ha_federated.h" +extern handlerton federated_hton; #endif #include #include +extern handlerton myisam_hton; +extern handlerton myisammrg_hton; +extern handlerton heap_hton; + + /* static functions defined in this file */ static SHOW_COMP_OPTION have_yes= SHOW_OPTION_YES; @@ -66,46 +79,53 @@ ulong total_ha_2pc; /* size of savepoint storage area (see ha_init) */ ulong savepoint_alloc_size; +/* + This structure will go away with loadable storeage engines, we will instead + build it dynamically from the configure script. +*/ struct show_table_type_st sys_table_types[]= { {"MyISAM", &have_yes, - "Default engine as of MySQL 3.23 with great performance", DB_TYPE_MYISAM}, + "Default engine as of MySQL 3.23 with great performance", DB_TYPE_MYISAM, + NULL}, {"MEMORY", &have_yes, - "Hash based, stored in memory, useful for temporary tables", DB_TYPE_HEAP}, - {"HEAP", &have_yes, - "Alias for MEMORY", DB_TYPE_HEAP}, - {"MERGE", &have_yes, - "Collection of identical MyISAM tables", DB_TYPE_MRG_MYISAM}, - {"MRG_MYISAM",&have_yes, - "Alias for MERGE", DB_TYPE_MRG_MYISAM}, + "Hash based, stored in memory, useful for temporary tables", DB_TYPE_HEAP, + NULL}, + {"MRG_MYISAM", &have_yes, + "Collection of identical MyISAM tables", DB_TYPE_MRG_MYISAM, NULL}, {"ISAM", &have_isam, - "Obsolete storage engine, now replaced by MyISAM", DB_TYPE_ISAM}, + "Obsolete storage engine, now replaced by MyISAM", DB_TYPE_ISAM, NULL}, {"MRG_ISAM", &have_isam, - "Obsolete storage engine, now replaced by MERGE", DB_TYPE_MRG_ISAM}, + "Obsolete storage engine, now replaced by MERGE", DB_TYPE_MRG_ISAM, NULL}, {"InnoDB", &have_innodb, - "Supports transactions, row-level locking, and foreign keys", DB_TYPE_INNODB}, - {"INNOBASE", &have_innodb, - "Alias for INNODB", DB_TYPE_INNODB}, - {"BDB", &have_berkeley_db, - "Supports transactions and page-level locking", DB_TYPE_BERKELEY_DB}, - {"BERKELEYDB",&have_berkeley_db, - "Alias for BDB", DB_TYPE_BERKELEY_DB}, + "Supports transactions, row-level locking, and foreign keys", DB_TYPE_INNODB, + NULL}, + {"BERKELEYDB", &have_berkeley_db, + "Supports transactions and page-level locking", DB_TYPE_BERKELEY_DB, NULL}, {"NDBCLUSTER", &have_ndbcluster, - "Clustered, fault-tolerant, memory-based tables", DB_TYPE_NDBCLUSTER}, - {"NDB", &have_ndbcluster, - "Alias for NDBCLUSTER", DB_TYPE_NDBCLUSTER}, + "Clustered, fault-tolerant, memory-based tables", DB_TYPE_NDBCLUSTER, NULL}, {"EXAMPLE",&have_example_db, - "Example storage engine", DB_TYPE_EXAMPLE_DB}, + "Example storage engine", DB_TYPE_EXAMPLE_DB, NULL}, {"ARCHIVE",&have_archive_db, - "Archive storage engine", DB_TYPE_ARCHIVE_DB}, + "Archive storage engine", DB_TYPE_ARCHIVE_DB, NULL}, {"CSV",&have_csv_db, - "CSV storage engine", DB_TYPE_CSV_DB}, + "CSV storage engine", DB_TYPE_CSV_DB, NULL}, {"FEDERATED",&have_federated_db, - "Federated MySQL storage engine", DB_TYPE_FEDERATED_DB}, + "Federated MySQL storage engine", DB_TYPE_FEDERATED_DB, NULL}, {"BLACKHOLE",&have_blackhole_db, "/dev/null storage engine (anything you write to it disappears)", - DB_TYPE_BLACKHOLE_DB}, - {NullS, NULL, NullS, DB_TYPE_UNKNOWN} + DB_TYPE_BLACKHOLE_DB, NULL}, + {NullS, NULL, NullS, DB_TYPE_UNKNOWN, NULL} +}; + +struct show_table_alias_st sys_table_aliases[]= +{ + {"INNOBASE", "InnoDB", NULL }, + {"NDB", "NDBCLUSTER", NULL}, + {"BDB", "BERKELEYDB", NULL}, + {"HEAP", "MEMORY", NULL}, + {"MERGE", "MRG_MYISAM", NULL}, + {NullS, NullS, NULL} }; const char *ha_row_type[] = { @@ -124,16 +144,27 @@ uint known_extensions_id= 0; enum db_type ha_resolve_by_name(const char *name, uint namelen) { THD *thd= current_thd; + show_table_alias_st *table_alias; + show_table_type_st *types; + if (thd && !my_strcasecmp(&my_charset_latin1, name, "DEFAULT")) { return (enum db_type) thd->variables.table_type; } - show_table_type_st *types; for (types= sys_table_types; types->type; types++) { if (!my_strcasecmp(&my_charset_latin1, name, types->type)) return (enum db_type) types->db_type; } + + /* + We check for the historical aliases next. + */ + for (table_alias= sys_table_aliases; table_alias->type; table_alias++) + { + if (!my_strcasecmp(&my_charset_latin1, name, table_alias->alias) && table_alias->st) + return (enum db_type) table_alias->st->db_type; + } return DB_TYPE_UNKNOWN; } @@ -361,11 +392,154 @@ int ha_init() { int error= 0; handlerton **ht= handlertons; + show_table_type_st *types; + show_table_alias_st *table_alias; total_ha= savepoint_alloc_size= 0; if (ha_init_errors()) return 1; + for (types= sys_table_types; types->type; types++) + { + switch (types->db_type) { + case DB_TYPE_HEAP: + types->ht= &heap_hton; + for (table_alias= sys_table_aliases; table_alias->type; table_alias++) + { + if (!my_strcasecmp(&my_charset_latin1, types->ht->name, table_alias->type)) + table_alias->st= types; + } + break; + case DB_TYPE_MYISAM: + types->ht= &myisam_hton; + break; + case DB_TYPE_MRG_MYISAM: + types->ht= &myisammrg_hton; + for (table_alias= sys_table_aliases; table_alias->type; table_alias++) + { + if (!my_strcasecmp(&my_charset_latin1, types->ht->name, table_alias->type)) + table_alias->st= types; + } + break; +#ifdef HAVE_BERKELEY_DB + case DB_TYPE_BERKELEY_DB: + if (have_berkeley_db == SHOW_OPTION_YES) + { + if (!(*ht= berkeley_init())) + { + have_berkeley_db= SHOW_OPTION_DISABLED; // If we couldn't use handler + error= 1; + } + else + { + types->ht= &berkeley_hton; + for (table_alias= sys_table_aliases; table_alias->type; table_alias++) + { + if (!my_strcasecmp(&my_charset_latin1, types->ht->name, table_alias->type)) + table_alias->st= types; + } + ha_was_inited_ok(ht++); + } + } + break; +#endif +#ifdef HAVE_INNOBASE_DB + case DB_TYPE_INNODB: + if (have_innodb == SHOW_OPTION_YES) + { + if (!(*ht= innobase_init())) + { + have_innodb= SHOW_OPTION_DISABLED; // If we couldn't use handler + error= 1; + } + else + { + ha_was_inited_ok(ht++); + types->ht= &innobase_hton; + for (table_alias= sys_table_aliases; table_alias->type; table_alias++) + { + if (!my_strcasecmp(&my_charset_latin1, types->ht->name, table_alias->type)) + table_alias->st= types; + } + } + } + break; +#endif +#ifdef HAVE_NDBCLUSTER_DB + case DB_TYPE_NDBCLUSTER: + if (have_ndbcluster == SHOW_OPTION_YES) + { + if (!(*ht= ndbcluster_init())) + { + have_ndbcluster= SHOW_OPTION_DISABLED; + error= 1; + } + else + { + ha_was_inited_ok(ht++); + types->ht= &ndbcluster_hton; + for (table_alias= sys_table_aliases; table_alias->type; table_alias++) + { + if (!my_strcasecmp(&my_charset_latin1, types->ht->name, table_alias->type)) + table_alias->st= types; + } + } + } + break; +#endif +#ifdef HAVE_EXAMPLE_DB + case DB_TYPE_EXAMPLE_DB: + types->ht= &example_hton; + break; +#endif +#ifdef HAVE_ARCHIVE_DB + case DB_TYPE_ARCHIVE_DB: + if (have_archive_db == SHOW_OPTION_YES) + { + if (!(*ht= archive_db_init())) + { + have_archive_db= SHOW_OPTION_DISABLED; + error= 1; + } + else + { + ha_was_inited_ok(ht++); + types->ht= &archive_hton; + } + } + break; +#endif +#ifdef HAVE_CSV_DB + case DB_TYPE_CSV_DB,: + types->ht= &tina_hton; + break; +#endif +#ifdef HAVE_FEDERATED_DB + case DB_TYPE_FEDERATED_DB: + if (have_federated_db == SHOW_OPTION_YES) + { + if (federated_db_init()) + { + have_federated_db= SHOW_OPTION_DISABLED; + error= 1; + } + else + { + types->ht= &federated_hton; + } + } + break; +#endif +#ifdef HAVE_BLACKHOLE_DB + case DB_TYPE_BLACKHOLE_DB: + types->ht= &blackhole_hton; + break; +#endif + default: + types->ht= NULL; + } + } + if (opt_bin_log) { if (!(*ht= binlog_init())) // Always succeed @@ -377,64 +551,6 @@ int ha_init() else ha_was_inited_ok(ht++); } -#ifdef HAVE_BERKELEY_DB - if (have_berkeley_db == SHOW_OPTION_YES) - { - if (!(*ht= berkeley_init())) - { - have_berkeley_db= SHOW_OPTION_DISABLED; // If we couldn't use handler - error= 1; - } - else - ha_was_inited_ok(ht++); - } -#endif -#ifdef HAVE_INNOBASE_DB - if (have_innodb == SHOW_OPTION_YES) - { - if (!(*ht= innobase_init())) - { - have_innodb= SHOW_OPTION_DISABLED; // If we couldn't use handler - error= 1; - } - else - ha_was_inited_ok(ht++); - } -#endif -#ifdef HAVE_NDBCLUSTER_DB - if (have_ndbcluster == SHOW_OPTION_YES) - { - if (!(*ht= ndbcluster_init())) - { - have_ndbcluster= SHOW_OPTION_DISABLED; - error= 1; - } - else - ha_was_inited_ok(ht++); - } -#endif -#ifdef HAVE_FEDERATED_DB - if (have_federated_db == SHOW_OPTION_YES) - { - if (federated_db_init()) - { - have_federated_db= SHOW_OPTION_DISABLED; - error= 1; - } - } -#endif -#ifdef HAVE_ARCHIVE_DB - if (have_archive_db == SHOW_OPTION_YES) - { - if (!(*ht= archive_db_init())) - { - have_archive_db= SHOW_OPTION_DISABLED; - error= 1; - } - else - ha_was_inited_ok(ht++); - } -#endif DBUG_ASSERT(total_ha < MAX_HA); /* Check if there is a transaction-capable storage engine besides the diff --git a/sql/handler.h b/sql/handler.h index f1f9ab904d1..bd558894a27 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -177,13 +177,6 @@ enum db_type DB_TYPE_DEFAULT // Must be last }; -struct show_table_type_st { - const char *type; - SHOW_COMP_OPTION *value; - const char *comment; - enum db_type db_type; -}; - enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED, ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED, ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT }; @@ -363,6 +356,20 @@ typedef struct uint32 flags; /* global handler flags */ } handlerton; +struct show_table_type_st { + const char *type; + SHOW_COMP_OPTION *value; + const char *comment; + enum db_type db_type; + handlerton *ht; +}; + +struct show_table_alias_st { + const char *alias; + const char *type; + show_table_type_st *st; +}; + /* Possible flags of a handlerton */ #define HTON_NO_FLAGS 0 #define HTON_CLOSE_CURSORS_AT_COMMIT 1 From 43dd29dfaade07858fb7e11ed791f811c6d6d33b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Sep 2005 03:05:35 +0400 Subject: [PATCH 041/225] Fix bug #12812 create view calling a function works without execute right on function Execution rigths on function was checked just before function execution, thus it was unknown on prepare stage whether user have right to execute particular function. Added access rights checking function which is called right after fixing Item_func_sp. This have additional effect that if user don't have rights for execution query will fail on earlier stage and will not waste resources on optimizing with failing on execution stage. sql/item_func.h: Fix bug#12812 create view calling a function works without execute right on function sql/item_func.cc: Fix bug#12812 create view calling a function works without execute right on function Added function Item_func_sp::check_access() which checks access rights. Added function Item_func_sp::fix_field() which calls check_access() after fixing. Item_func_sp::execute() now calls to check_access() to check access rights. mysql-test/t/sp.test: Test case for bug#12812 create view calling a function works without execute right on function mysql-test/r/sp.result: Test case for bug#12812 create view calling a function works without execute right on function --- mysql-test/r/sp.result | 12 ++++++ mysql-test/t/sp.test | 23 +++++++++++ sql/item_func.cc | 89 ++++++++++++++++++++++++++++++++++++++---- sql/item_func.h | 6 ++- 4 files changed, 121 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 4424f4e6ad4..5cce9f9ff50 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -3193,4 +3193,16 @@ set f1= concat( 'hello', f1 ); return f1; end| drop function bug9048| +drop function if exists bug12812| +create function bug12812() returns char(2) +begin +return 'ok'; +end; +create user user_bug12812@localhost IDENTIFIED BY 'ABC'| +SELECT test.bug12812()| +ERROR 42000: execute command denied to user 'user_bug12812'@'localhost' for routine 'test.bug12812' +CREATE VIEW v1 AS SELECT test.bug12812()| +ERROR 42000: execute command denied to user 'user_bug12812'@'localhost' for routine 'test.bug12812' +DROP USER user_bug12812@localhost| +drop function bug12812| drop table t1,t2; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index f1662a57c1b..24df6ec904d 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -4043,6 +4043,29 @@ begin end| drop function bug9048| +# +# BUG#12812 create view calling a function works without execute right +# on function +--disable_warnings +drop function if exists bug12812| +--enable_warnings +create function bug12812() returns char(2) +begin + return 'ok'; +end; +create user user_bug12812@localhost IDENTIFIED BY 'ABC'| +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (test_user_12812,localhost,user_bug12812,ABC,test)| +--error 1370 +SELECT test.bug12812()| +--error 1370 +CREATE VIEW v1 AS SELECT test.bug12812()| +# Cleanup +connection default| +disconnect test_user_12812| +DROP USER user_bug12812@localhost| +drop function bug12812| + # # BUG#NNNN: New bug synopsis # diff --git a/sql/item_func.cc b/sql/item_func.cc index 8125264ab15..f7f23ab7bf8 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4711,14 +4711,8 @@ Item_func_sp::execute(Item **itp) } #ifndef NO_EMBEDDED_ACCESS_CHECKS - if (check_routine_access(thd, EXECUTE_ACL, - m_sp->m_db.str, m_sp->m_name.str, 0, 0)) + if (check_access(EXECUTE_ACL, 0, &save_ctx)) goto error; - sp_change_security_context(thd, m_sp, &save_ctx); - if (save_ctx.changed && - check_routine_access(thd, EXECUTE_ACL, - m_sp->m_db.str, m_sp->m_name.str, 0, 0)) - goto error_check_ctx; #endif /* Disable the binlogging if this is not a SELECT statement. If this is a @@ -4737,7 +4731,6 @@ Item_func_sp::execute(Item **itp) ER(ER_FAILED_ROUTINE_BREAK_BINLOG)); #ifndef NO_EMBEDDED_ACCESS_CHECKS -error_check_ctx: sp_restore_security_context(thd, m_sp, &save_ctx); #endif @@ -4845,3 +4838,83 @@ Item_func_sp::tmp_table_field(TABLE *t_arg) DBUG_RETURN(res); } + +/* + Check access rigths to function + + SYNOPSIS + check_access() + want_access requested access + report_error whether to set error to thd->net.report_error + sp_ctx sp security context for switching + + RETURN + 0 Access granted + 1 Requested access can't be granted or function doesn't exists + + NOTES + Checks if requested access to function can be granted to user. + If function isn't found yet, it searches function first. + If function can't be found or user don't have requested access + and report_error is true error is raised. + If security context sp_ctx is provided and access can be granted then + switch back to previous context isn't performed. + In case of access error or if context is not provided then check_access() + switches back to previous security context. +*/ +bool +Item_func_sp::check_access(ulong want_access, bool report_error, st_sp_security_context *sp_ctx) +{ + bool res; +#ifndef NO_EMBEDDED_ACCESS_CHECKS + THD *thd= current_thd; + st_sp_security_context save_ctx, *curr_ctx= sp_ctx?sp_ctx:&save_ctx; + bool ctx_switched= 0; + res= 1; + if (! m_sp && ! (m_sp= sp_find_function(thd, m_name, TRUE))) + { + my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", m_name->m_qname.str); + if (report_error) + thd->net.report_error= 1; + goto error; + } + + if (check_routine_access(thd, want_access, + m_sp->m_db.str, m_sp->m_name.str, 0, 0)) + { + if (report_error) + thd->net.report_error= 1; + goto error; + } + + sp_change_security_context(thd, m_sp, curr_ctx); + ctx_switched= curr_ctx->changed; + if (save_ctx.changed && + check_routine_access(thd, want_access, + m_sp->m_db.str, m_sp->m_name.str, 0, 0)) + { + if (report_error) + thd->net.report_error= 1; + goto error_check_ctx; + } + res= 0; +error_check_ctx: + if (ctx_switched && (res || !sp_ctx)) + sp_restore_security_context(thd, m_sp, curr_ctx); +error: +#else + res= 0; +#endif + return res; +}; + +bool +Item_func_sp::fix_fields(THD *thd, Item **ref) +{ + bool res; + DBUG_ASSERT(fixed == 0); + res= Item_func::fix_fields(thd, ref); + if (!res && check_access(EXECUTE_ACL, 1, NULL)) + res= 1; + return res; +} diff --git a/sql/item_func.h b/sql/item_func.h index 019abb0c072..adc1dd1b1be 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -55,7 +55,7 @@ public: NOT_FUNC, NOT_ALL_FUNC, NOW_FUNC, TRIG_COND_FUNC, GUSERVAR_FUNC, COLLATE_FUNC, - EXTRACT_FUNC, CHAR_TYPECAST_FUNC }; + EXTRACT_FUNC, CHAR_TYPECAST_FUNC, FUNC_SP }; enum optimize_type { OPTIMIZE_NONE,OPTIMIZE_KEY,OPTIMIZE_OP, OPTIMIZE_NULL, OPTIMIZE_EQUAL }; enum Type type() const { return FUNC_ITEM; } @@ -1365,6 +1365,7 @@ public: class sp_head; class sp_name; +struct st_sp_security_context; class Item_func_sp :public Item_func { @@ -1434,7 +1435,10 @@ public: { context= (Name_resolution_context *)cntx; return FALSE; } void fix_length_and_dec(); + bool check_access(ulong want_access, bool report_error, st_sp_security_context *sp_ctx); + virtual enum Functype functype() const { return FUNC_SP; } + bool fix_fields(THD *thd, Item **ref); }; From c8c29f2dc40fdbaeba704de524449d6358b8ce3a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Sep 2005 03:14:07 +0400 Subject: [PATCH 042/225] fix warnings server-tools/instance-manager/buffer.cc: perform initialization of static consts in .cc file to respect VC6 server-tools/instance-manager/buffer.h: fix compiler warning server-tools/instance-manager/commands.cc: fix compiler warning server-tools/instance-manager/user_map.cc: fix compiler warning --- server-tools/instance-manager/buffer.cc | 2 ++ server-tools/instance-manager/buffer.h | 4 ++-- server-tools/instance-manager/commands.cc | 4 ++-- server-tools/instance-manager/user_map.cc | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/server-tools/instance-manager/buffer.cc b/server-tools/instance-manager/buffer.cc index 26df401c3c5..dd6e6e95704 100644 --- a/server-tools/instance-manager/buffer.cc +++ b/server-tools/instance-manager/buffer.cc @@ -21,6 +21,8 @@ #include "buffer.h" #include +const uint Buffer::BUFFER_INITIAL_SIZE= 4096; +const uint Buffer::MAX_BUFFER_SIZE= 16777216; /* Puts the given string to the buffer. diff --git a/server-tools/instance-manager/buffer.h b/server-tools/instance-manager/buffer.h index e63d725f508..0c4d1eda102 100644 --- a/server-tools/instance-manager/buffer.h +++ b/server-tools/instance-manager/buffer.h @@ -33,9 +33,9 @@ class Buffer { private: - enum { BUFFER_INITIAL_SIZE= 4096 }; + static const uint BUFFER_INITIAL_SIZE; /* maximum buffer size is 16Mb */ - enum { MAX_BUFFER_SIZE= 16777216 }; + static const uint MAX_BUFFER_SIZE; size_t buffer_size; /* Error flag. Triggered if we get an error of some kind */ int error; diff --git a/server-tools/instance-manager/commands.cc b/server-tools/instance-manager/commands.cc index 1cf888eab45..b4dd1b469f1 100644 --- a/server-tools/instance-manager/commands.cc +++ b/server-tools/instance-manager/commands.cc @@ -695,9 +695,9 @@ Set_option::Set_option(Instance_map *instance_map_arg, int Set_option::correct_file(int skip) { - int error; - const static int mysys_to_im_error[]= { 0, ER_OUT_OF_RESOURCES, + static const int mysys_to_im_error[]= { 0, ER_OUT_OF_RESOURCES, ER_ACCESS_OPTION_FILE }; + int error; error= modify_defaults_file(Options::config_file, option, option_value, instance_name, skip); diff --git a/server-tools/instance-manager/user_map.cc b/server-tools/instance-manager/user_map.cc index d13eb681d05..93c4a2ade25 100644 --- a/server-tools/instance-manager/user_map.cc +++ b/server-tools/instance-manager/user_map.cc @@ -66,7 +66,8 @@ int User::init(const char *line) */ if (password[strlen(password)-2] == '\r') line_ending_len= 2; - if (strlen(password) != SCRAMBLED_PASSWORD_CHAR_LENGTH + line_ending_len) + if (strlen(password) != (uint) (SCRAMBLED_PASSWORD_CHAR_LENGTH + + line_ending_len)) goto err; memcpy(user, name_begin, user_length); From 05368f8bcf0fa57c9de8d22390819194d2da1cc4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Sep 2005 23:23:23 -0500 Subject: [PATCH 043/225] More fixes to the VC 7.1 solution and vcproj files VC++Files/myisamchk/myisamchk.vcproj: removed hard coded library dependencies VC++Files/mysql.sln: more solution fixups VC++Files/tests/mysql_client_test.vcproj: removed hard coded lib dependencies --- VC++Files/myisamchk/myisamchk.vcproj | 2 +- VC++Files/mysql.sln | 55 +++++++++++++----------- VC++Files/tests/mysql_client_test.vcproj | 6 +-- 3 files changed, 34 insertions(+), 29 deletions(-) diff --git a/VC++Files/myisamchk/myisamchk.vcproj b/VC++Files/myisamchk/myisamchk.vcproj index ce2435bc34a..33f813024b5 100755 --- a/VC++Files/myisamchk/myisamchk.vcproj +++ b/VC++Files/myisamchk/myisamchk.vcproj @@ -101,7 +101,7 @@ Name="VCCustomBuildTool"/> Date: Mon, 19 Sep 2005 22:08:22 -0700 Subject: [PATCH 044/225] Cleanups for storage engine patch. Changed two test results to now reflect the changes in storage engines and a couple of comment changes in the code. mysql-test/r/ps_1general.result: Redoing test output with straightened up output for storage engine names. mysql-test/r/variables.result: Fixed test case. sql/handler.cc: Couple of format cleanups and a change in a comment. --- mysql-test/r/ps_1general.result | 9 ++------- mysql-test/r/variables.result | 2 +- sql/handler.cc | 9 +++++---- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index 7fb1e1b4df4..b65a8291062 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -323,17 +323,12 @@ execute stmt4; Engine Support Comment MyISAM YES/NO Default engine as of MySQL 3.23 with great performance MEMORY YES/NO Hash based, stored in memory, useful for temporary tables -HEAP YES/NO Alias for MEMORY -MERGE YES/NO Collection of identical MyISAM tables -MRG_MYISAM YES/NO Alias for MERGE +MRG_MYISAM YES/NO Collection of identical MyISAM tables ISAM YES/NO Obsolete storage engine, now replaced by MyISAM MRG_ISAM YES/NO Obsolete storage engine, now replaced by MERGE InnoDB YES/NO Supports transactions, row-level locking, and foreign keys -INNOBASE YES/NO Alias for INNODB -BDB YES/NO Supports transactions and page-level locking -BERKELEYDB YES/NO Alias for BDB +BERKELEYDB YES/NO Supports transactions and page-level locking NDBCLUSTER YES/NO Clustered, fault-tolerant, memory-based tables -NDB YES/NO Alias for NDBCLUSTER EXAMPLE YES/NO Example storage engine ARCHIVE YES/NO Archive storage engine CSV YES/NO CSV storage engine diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 265f353ae3c..30ebeb462df 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -147,7 +147,7 @@ Variable_name Value storage_engine MEMORY show global variables like 'storage_engine'; Variable_name Value -storage_engine MERGE +storage_engine MRG_MYISAM set GLOBAL query_cache_size=100000; set GLOBAL myisam_max_sort_file_size=2000000; show global variables like 'myisam_max_sort_file_size'; diff --git a/sql/handler.cc b/sql/handler.cc index 543d4a5877c..34ce7e60eba 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -80,8 +80,7 @@ ulong total_ha_2pc; ulong savepoint_alloc_size; /* - This structure will go away with loadable storeage engines, we will instead - build it dynamically from the configure script. + This structure will go away in the future. */ struct show_table_type_st sys_table_types[]= { @@ -406,7 +405,8 @@ int ha_init() types->ht= &heap_hton; for (table_alias= sys_table_aliases; table_alias->type; table_alias++) { - if (!my_strcasecmp(&my_charset_latin1, types->ht->name, table_alias->type)) + if (!my_strcasecmp(&my_charset_latin1, types->ht->name, + table_alias->type)) table_alias->st= types; } break; @@ -417,7 +417,8 @@ int ha_init() types->ht= &myisammrg_hton; for (table_alias= sys_table_aliases; table_alias->type; table_alias++) { - if (!my_strcasecmp(&my_charset_latin1, types->ht->name, table_alias->type)) + if (!my_strcasecmp(&my_charset_latin1, types->ht->name, + table_alias->type)) table_alias->st= types; } break; From c705f0c21ee151ab23dc8a72ed7def37c556d4ee Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Sep 2005 09:17:04 +0300 Subject: [PATCH 045/225] Fixed a missing cast. --- mysys/default.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysys/default.c b/mysys/default.c index bca3ec0fed3..5c631abebad 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -138,7 +138,7 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv, defaults_group_suffix= getenv(STRINGIFY_ARG(DEFAULT_GROUP_SUFFIX_ENV)); if (forced_extra_defaults) - defaults_extra_file= forced_extra_defaults; + defaults_extra_file= (char *) forced_extra_defaults; /* We can only handle 'defaults-group-suffix' if we are called from From 8c963d39679dd8eb6fa7d09158e84c0672763c98 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Sep 2005 17:34:46 +1000 Subject: [PATCH 046/225] Remove old and usused configuration locking code. Some new code that does this job is being written against 5.1. This code is largely removed from that work. ndb/include/kernel/GlobalSignalNumbers.h: remove dead (never used) MGM_(UN)LOCK signal numbers ndb/src/mgmsrv/Config.cpp: remove unused generation number code. remove unused Config::change ndb/src/mgmsrv/Config.hpp: remove unused generation number prototypes. ndb/src/mgmsrv/MgmtSrvr.cpp: remove unused getPrimaryNode ndb/src/mgmsrv/MgmtSrvr.hpp: remove prototypes for config lock and commit/rollback. ndb/src/mgmsrv/MgmtSrvrConfig.cpp: remove CONFIG (UN)LOCK signals, lockConf/unlockConf, commit/rollback and changeConfig. never used. ndb/src/mgmsrv/Services.cpp: remove unused configuration locking code ndb/src/mgmsrv/Services.hpp: remove usused configuration locking code --- ndb/include/kernel/GlobalSignalNumbers.h | 8 - ndb/src/mgmsrv/Config.cpp | 87 --------- ndb/src/mgmsrv/Config.hpp | 10 - ndb/src/mgmsrv/MgmtSrvr.cpp | 20 -- ndb/src/mgmsrv/MgmtSrvr.hpp | 36 ---- ndb/src/mgmsrv/MgmtSrvrConfig.cpp | 235 ----------------------- ndb/src/mgmsrv/Services.cpp | 59 ------ ndb/src/mgmsrv/Services.hpp | 3 - 8 files changed, 458 deletions(-) diff --git a/ndb/include/kernel/GlobalSignalNumbers.h b/ndb/include/kernel/GlobalSignalNumbers.h index a4a0bafb6ec..98b6ce7d949 100644 --- a/ndb/include/kernel/GlobalSignalNumbers.h +++ b/ndb/include/kernel/GlobalSignalNumbers.h @@ -834,14 +834,6 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES; /* Start Global Replication */ #define GSN_GREP_REQ 656 -/** - * Management server - */ -#define GSN_MGM_LOCK_CONFIG_REQ 657 -#define GSN_MGM_LOCK_CONFIG_REP 658 -#define GSN_MGM_UNLOCK_CONFIG_REQ 659 -#define GSN_MGM_UNLOCK_CONFIG_REP 660 - #define GSN_UTIL_CREATE_LOCK_REQ 132 #define GSN_UTIL_CREATE_LOCK_REF 133 #define GSN_UTIL_CREATE_LOCK_CONF 188 diff --git a/ndb/src/mgmsrv/Config.cpp b/ndb/src/mgmsrv/Config.cpp index 5ff9cbe04ad..6ff5fb789f0 100644 --- a/ndb/src/mgmsrv/Config.cpp +++ b/ndb/src/mgmsrv/Config.cpp @@ -179,90 +179,3 @@ void Config::printConfigFile(NdbOut &out) const { } #endif } - -Uint32 -Config::getGenerationNumber() const { -#if 0 - Uint32 ret; - const Properties *prop = NULL; - - get("SYSTEM", &prop); - - if(prop != NULL) - if(prop->get("ConfigGenerationNumber", &ret)) - return ret; - - return 0; -#else - return 0; -#endif -} - -int -Config::setGenerationNumber(Uint32 gen) { -#if 0 - Properties *prop = NULL; - - getCopy("SYSTEM", &prop); - - if(prop != NULL) { - MGM_REQUIRE(prop->put("ConfigGenerationNumber", gen, true)); - MGM_REQUIRE(put("SYSTEM", prop, true)); - return 0; - } - return -1; -#else - return -1; -#endif -} - -bool -Config::change(const BaseString §ion, - const BaseString ¶m, - const BaseString &value) { -#if 0 - const char *name; - Properties::Iterator it(this); - - for(name = it.first(); name != NULL; name = it.next()) { - Properties *prop = NULL; - if(strcasecmp(section.c_str(), name) == 0) { - getCopy(name, &prop); - if(prop == NULL) /* doesn't exist */ - return false; - if(value == "") { - prop->remove(param.c_str()); - put(section.c_str(), prop, true); - } else { - PropertiesType t; - if(!prop->getTypeOf(param.c_str(), &t)) /* doesn't exist */ - return false; - switch(t) { - case PropertiesType_Uint32: - long val; - char *ep; - errno = 0; - val = strtol(value.c_str(), &ep, 0); - if(value.length() == 0 || *ep != '\0') /* not a number */ - return false; - if(errno == ERANGE) - return false; - prop->put(param.c_str(), (unsigned int)val, true); - put(section.c_str(), prop, true); - break; - case PropertiesType_char: - prop->put(param.c_str(), value.c_str(), true); - put(section.c_str(), prop, true); - break; - default: - return false; - } - } - break; - } - } - return true; -#else - return false; -#endif -} diff --git a/ndb/src/mgmsrv/Config.hpp b/ndb/src/mgmsrv/Config.hpp index b5e1e17b027..8e16ddf1810 100644 --- a/ndb/src/mgmsrv/Config.hpp +++ b/ndb/src/mgmsrv/Config.hpp @@ -60,16 +60,6 @@ public: printConfigFile(ndb); } - Uint32 getGenerationNumber() const; - int setGenerationNumber(Uint32); - - /** Change configuration - */ - bool change(const BaseString §ion, - const BaseString ¶m, - const BaseString &value); - - /** * Info */ diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index e00140dbdb2..c35b85dd595 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -2086,26 +2086,6 @@ MgmtSrvr::repCommand(Uint32* repReqId, Uint32 request, bool waitCompleted) return 0; } - -NodeId -MgmtSrvr::getPrimaryNode() const { -#if 0 - Uint32 tmp; - const Properties *prop = NULL; - - getConfig()->get("SYSTEM", &prop); - if(prop == NULL) - return 0; - - prop->get("PrimaryMGMNode", &tmp); - - return tmp; -#else - return 0; -#endif -} - - MgmtSrvr::Allocated_resources::Allocated_resources(MgmtSrvr &m) : m_mgmsrv(m) { diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index 5a29d820d6e..ff24e97ce02 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -214,27 +214,6 @@ public: // NO_CONTACT_WITH_PROCESS, PROCESS_NOT_CONFIGURED, WRONG_PROCESS_TYPE, // COULD_NOT_ALLOCATE_MEMORY, SEND_OR_RECEIVE_FAILED - - /** - * Lock configuration - */ - int lockConf(); - - /** - * Unlock configuration, and commit it if commit is true - */ - int unlockConf(bool commit); - - /** - * Commit new configuration - */ - int commitConfig(); - - /** - * Rollback configuration - */ - int rollbackConfig(); - /** * Save a configuration to permanent storage */ @@ -462,13 +441,6 @@ public: */ const Config * getConfig() const; - /** - * Change configuration paramter - */ - bool changeConfig(const BaseString §ion, - const BaseString ¶m, - const BaseString &value); - /** * Returns the node count for the specified node type. * @@ -477,11 +449,6 @@ public: */ int getNodeCount(enum ndb_mgm_node_type type) const; - /** - * Returns the nodeId of the management master - */ - NodeId getPrimaryNode() const; - /** * Returns the port number. * @return port number. @@ -572,9 +539,6 @@ private: // Returns: - //************************************************************************** - void handle_MGM_LOCK_CONFIG_REQ(NdbApiSignal *signal); - void handle_MGM_UNLOCK_CONFIG_REQ(NdbApiSignal *signal); - //************************************************************************** // Specific signal handling data //************************************************************************** diff --git a/ndb/src/mgmsrv/MgmtSrvrConfig.cpp b/ndb/src/mgmsrv/MgmtSrvrConfig.cpp index acf7ccbfd4c..60740e5e105 100644 --- a/ndb/src/mgmsrv/MgmtSrvrConfig.cpp +++ b/ndb/src/mgmsrv/MgmtSrvrConfig.cpp @@ -23,232 +23,6 @@ #include #include -#if 0 // code must be rewritten to use SignalSender - -void -MgmtSrvr::handle_MGM_LOCK_CONFIG_REQ(NdbApiSignal *signal) { - NodeId sender = refToNode(signal->theSendersBlockRef); - const MgmLockConfigReq * const req = CAST_CONSTPTR(MgmLockConfigReq, signal->getDataPtr()); - - NdbApiSignal *reply = getSignal(); - if(signal == NULL) - return; /** @todo handle allocation failure */ - - reply->set(TestOrd::TraceAPI, - MGMSRV, - GSN_MGM_LOCK_CONFIG_REP, - MgmLockConfigRep::SignalLength); - - MgmLockConfigRep *lockRep = CAST_PTR(MgmLockConfigRep, reply->getDataPtrSend()); - - lockRep->errorCode = MgmLockConfigRep::UNKNOWN_ERROR; - - if(req->newConfigGeneration < m_nextConfigGenerationNumber) { - lockRep->errorCode = MgmLockConfigRep::GENERATION_MISMATCH; - goto done; - } - NdbMutex_Lock(m_configMutex); - - m_nextConfigGenerationNumber = req->newConfigGeneration+1; - - lockRep->errorCode = MgmLockConfigRep::OK; - - done: - sendSignal(sender, NO_WAIT, reply, true); - NdbMutex_Unlock(m_configMutex); - return; -} - -void -MgmtSrvr::handle_MGM_UNLOCK_CONFIG_REQ(NdbApiSignal *signal) { - NodeId sender = refToNode(signal->theSendersBlockRef); - const MgmUnlockConfigReq * const req = CAST_CONSTPTR(MgmUnlockConfigReq, signal->getDataPtr()); - MgmUnlockConfigRep *unlockRep; - - NdbApiSignal *reply = getSignal(); - if(signal == NULL) - goto error; /** @todo handle allocation failure */ - - reply->set(TestOrd::TraceAPI, - MGMSRV, - GSN_MGM_UNLOCK_CONFIG_REP, - MgmUnlockConfigRep::SignalLength); - - unlockRep = CAST_PTR(MgmUnlockConfigRep, reply->getDataPtrSend()); - - unlockRep->errorCode = MgmUnlockConfigRep::UNKNOWN_ERROR; - - - NdbMutex_Lock(m_configMutex); - - if(req->commitConfig == 1) { - m_newConfig = fetchConfig(); - commitConfig(); - } else - rollbackConfig(); - - unlockRep->errorCode = MgmUnlockConfigRep::OK; - - sendSignal(sender, NO_WAIT, reply, true); - error: - NdbMutex_Unlock(m_configMutex); - return; -} - - -/** - * Prepare all MGM nodes for configuration changes - * - * @returns 0 on success, or -1 on failure - */ -int -MgmtSrvr::lockConf() { - int result = -1; - MgmLockConfigReq* lockReq; - NodeId node = 0; - - /* Check if this is the master node */ - if(getPrimaryNode() != _ownNodeId) - goto done; - - if(NdbMutex_Trylock(m_configMutex) != 0) - return -1; - - m_newConfig = new Config(*_config); /* copy the existing config */ - _config = m_newConfig; - - m_newConfig = new Config(*_config); - - m_nextConfigGenerationNumber++; - - /* Make sure the new configuration _always_ is at least one step older */ - if(m_nextConfigGenerationNumber < m_newConfig->getGenerationNumber()+1) - m_nextConfigGenerationNumber = _config->getGenerationNumber()+1; - - m_newConfig->setGenerationNumber(m_nextConfigGenerationNumber); - - node = 0; - while(getNextNodeId(&node, NDB_MGM_NODE_TYPE_MGM)) { - if(node != _ownNodeId) { - NdbApiSignal* signal = getSignal(); - if (signal == NULL) { - result = COULD_NOT_ALLOCATE_MEMORY; - goto done; - } - - lockReq = CAST_PTR(MgmLockConfigReq, signal->getDataPtrSend()); - signal->set(TestOrd::TraceAPI, - MGMSRV, - GSN_MGM_LOCK_CONFIG_REQ, - MgmLockConfigReq::SignalLength); - - lockReq->newConfigGeneration = m_nextConfigGenerationNumber; - - result = sendSignal(node, NO_WAIT, signal, true); - - NdbApiSignal *reply = - m_signalRecvQueue.waitFor(GSN_MGM_LOCK_CONFIG_REP, 0); - - if(reply == NULL) { - /** @todo handle timeout/error */ - ndbout << __FILE__ << ":" << __LINE__ << endl; - result = -1; - goto done; - } - - } - } - - done: - NdbMutex_Unlock(m_configMutex); - return result; -} - -/** - * Unlocks configuration - * - * @returns 0 on success, ! 0 on error - */ -int -MgmtSrvr::unlockConf(bool commit) { - int result = -1; - MgmUnlockConfigReq* unlockReq; - NodeId node = 0; - - /* Check if this is the master node */ - if(getPrimaryNode() != _ownNodeId) - goto done; - - errno = 0; - if(NdbMutex_Lock(m_configMutex) != 0) - return -1; - - if(commit) - commitConfig(); - else - rollbackConfig(); - - node = 0; - while(getNextNodeId(&node, NDB_MGM_NODE_TYPE_MGM)) { - if(node != _ownNodeId) { - NdbApiSignal* signal = getSignal(); - if (signal == NULL) { - result = COULD_NOT_ALLOCATE_MEMORY; - goto done; - } - - unlockReq = CAST_PTR(MgmUnlockConfigReq, signal->getDataPtrSend()); - signal->set(TestOrd::TraceAPI, - MGMSRV, - GSN_MGM_UNLOCK_CONFIG_REQ, - MgmUnlockConfigReq::SignalLength); - unlockReq->commitConfig = commit; - - result = sendSignal(node, NO_WAIT, signal, true); - - NdbApiSignal *reply = - m_signalRecvQueue.waitFor(GSN_MGM_UNLOCK_CONFIG_REP, 0); - - if(reply == NULL) { - /** @todo handle timeout/error */ - result = -1; - goto done; - } - - } - } - - done: - NdbMutex_Unlock(m_configMutex); - return result; -} - -#endif // code must be rewritten to use SignalSender - -/** - * Commit the new configuration - */ -int -MgmtSrvr::commitConfig() { - int ret = saveConfig(m_newConfig); - delete _config; - _config = m_newConfig; - m_newConfig = NULL; - ndbout << "commit " << ret << endl; - return ret; -} - -/** - * Rollback to the old configuration - */ -int -MgmtSrvr::rollbackConfig() { - delete m_newConfig; - m_newConfig = NULL; - ndbout << "rollback" << endl; - return saveConfig(_config); -} - /** * Save a configuration to the running configuration file */ @@ -292,12 +66,3 @@ MgmtSrvr::fetchConfig() { } return 0; } - -bool -MgmtSrvr::changeConfig(const BaseString §ion, - const BaseString ¶m, - const BaseString &value) { - if(m_newConfig == NULL) - return false; - return m_newConfig->change(section, param, value); -} diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index a6e418b43a1..ef52729dd37 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -221,21 +221,6 @@ ParserRow commands[] = { MGM_ARG("level", Int, Mandatory, "Severety level"), MGM_ARG("enable", Int, Mandatory, "1=disable, 0=enable, -1=toggle"), - MGM_CMD("config lock", &MgmApiSession::configLock, ""), - - MGM_CMD("config unlock", &MgmApiSession::configUnlock, ""), - MGM_ARG("commit", Int, Mandatory, "Commit changes"), - - MGM_CMD("config change", &MgmApiSession::configChange, ""), - MGM_ARG("section", String, Mandatory, "Section"), - MGM_ARG("parameter", String, Mandatory, "Parameter"), - MGM_ARG("value", String, Mandatory, "Value"), - - MGM_CMD("config lock", &MgmApiSession::configLock, ""), - - MGM_CMD("config unlock", &MgmApiSession::configUnlock, ""), - MGM_ARG("commit", Int, Mandatory, "Commit changes"), - MGM_CMD("set parameter", &MgmApiSession::setParameter, ""), MGM_ARG("node", String, Mandatory, "Node"), MGM_ARG("parameter", String, Mandatory, "Parameter"), @@ -1200,50 +1185,6 @@ MgmApiSession::setLogFilter(Parser_t::Context &ctx, m_output->println(""); } -void -MgmApiSession::configLock(Parser_t::Context &, - Properties const &) { -#if 0 // not implemented - int ret = m_mgmsrv.lockConf(); -#else - int ret = -1; -#endif - m_output->println("config lock reply"); - m_output->println("result: %d", ret); - m_output->println(""); -} - -void -MgmApiSession::configUnlock(Parser_t::Context &, - Properties const &args) { - Uint32 commit; - args.get("commit", &commit); -#if 0 // not implemented - int ret = m_mgmsrv.unlockConf(commit == 1); -#else - int ret = -1; -#endif - m_output->println("config unlock reply"); - m_output->println("result: %d", ret); - m_output->println(""); -} - -void -MgmApiSession::configChange(Parser_t::Context &, - Properties const &args) { - BaseString section, param, value; - args.get("section", section); - args.get("parameter", param); - args.get("value", value); - - int ret = m_mgmsrv.changeConfig(section.c_str(), - param.c_str(), - value.c_str()); - m_output->println("config change reply"); - m_output->println("result: %d", ret); - m_output->println(""); -} - static NdbOut& operator<<(NdbOut& out, const LogLevel & ll) { diff --git a/ndb/src/mgmsrv/Services.hpp b/ndb/src/mgmsrv/Services.hpp index 8627343b1cf..f5621a319a6 100644 --- a/ndb/src/mgmsrv/Services.hpp +++ b/ndb/src/mgmsrv/Services.hpp @@ -83,9 +83,6 @@ public: void setClusterLogLevel(Parser_t::Context &ctx, const class Properties &args); void setLogFilter(Parser_t::Context &ctx, const class Properties &args); - void configLock(Parser_t::Context &ctx, const class Properties &args); - void configUnlock(Parser_t::Context &ctx, const class Properties &args); - void configChange(Parser_t::Context &ctx, const class Properties &args); void setParameter(Parser_t::Context &ctx, const class Properties &args); void listen_event(Parser_t::Context &ctx, const class Properties &args); From 0c84cf4c0dba4330e1e7c766c55507a36d94618f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Sep 2005 10:34:00 +0200 Subject: [PATCH 047/225] Fix for bug#9896, each fragment has a twin fragment (in 4.1,5.0), pages in this were not counted, giving incorrect memory consumption --- ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp b/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp index 3170d23499a..acdad3f9f1a 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp @@ -1004,8 +1004,19 @@ Dbtup::read_psuedo(Uint32 attrId, Uint32* outBuffer){ return 1; case AttributeHeader::FRAGMENT_MEMORY: { - Uint64 tmp= fragptr.p->noOfPages; - tmp*= 32768; + Uint64 tmp = 0; + tmp += fragptr.p->noOfPages; + { + /** + * Each fragment is split into 2...get #pages from other as well + */ + Uint32 twin = fragptr.p->fragmentId ^ 1; + FragrecordPtr twinPtr; + getFragmentrec(twinPtr, twin, tabptr.p); + ndbrequire(twinPtr.p != 0); + tmp += twinPtr.p->noOfPages; + } + tmp *= 32768; memcpy(outBuffer,&tmp,8); } return 2; From 3e978f8573e4b84667ad4696cabd8b6ef6050122 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Sep 2005 14:28:23 +0500 Subject: [PATCH 048/225] a fix (bug #11553: gives error if aggregate user-defined function in HAVING clause). sql/sql_yacc.yy: a fix (bug #11553: gives error if aggregate user-defined function in HAVING clause). - call inc_in_sum_expr() before udf_expr_list rule parsing in case of aggregate udf functions. --- sql/sql_yacc.yy | 63 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 20a9d945a87..9c89390890f 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -4779,27 +4779,48 @@ simple_expr: $$= new Item_func_sp(Lex->current_context(), name); lex->safe_to_cache_query=0; } - | IDENT_sys '(' udf_expr_list ')' + | IDENT_sys '(' { #ifdef HAVE_DLOPEN - udf_func *udf; + udf_func *udf= 0; + if (using_udf_functions && + (udf= find_udf($1.str, $1.length)) && + udf->type == UDFTYPE_AGGREGATE) + { + LEX *lex= Lex; + if (lex->current_select->inc_in_sum_expr()) + { + yyerror(ER(ER_SYNTAX_ERROR)); + YYABORT; + } + } + $$= udf; +#endif + } + udf_expr_list ')' + { +#ifdef HAVE_DLOPEN + udf_func *udf= $3; SELECT_LEX *sel= Select; - if (using_udf_functions && (udf=find_udf($1.str, $1.length))) + if (udf) { + if (udf->type == UDFTYPE_AGGREGATE) + Select->in_sum_expr--; + switch (udf->returns) { case STRING_RESULT: if (udf->type == UDFTYPE_FUNCTION) { - if ($3 != NULL) - $$ = new Item_func_udf_str(udf, *$3); + if ($4 != NULL) + $$ = new Item_func_udf_str(udf, *$4); else $$ = new Item_func_udf_str(udf); } else { - if ($3 != NULL) - $$ = new Item_sum_udf_str(udf, *$3); + if ($4 != NULL) + $$ = new Item_sum_udf_str(udf, *$4); else $$ = new Item_sum_udf_str(udf); } @@ -4807,15 +4828,15 @@ simple_expr: case REAL_RESULT: if (udf->type == UDFTYPE_FUNCTION) { - if ($3 != NULL) - $$ = new Item_func_udf_float(udf, *$3); + if ($4 != NULL) + $$ = new Item_func_udf_float(udf, *$4); else $$ = new Item_func_udf_float(udf); } else { - if ($3 != NULL) - $$ = new Item_sum_udf_float(udf, *$3); + if ($4 != NULL) + $$ = new Item_sum_udf_float(udf, *$4); else $$ = new Item_sum_udf_float(udf); } @@ -4823,15 +4844,15 @@ simple_expr: case INT_RESULT: if (udf->type == UDFTYPE_FUNCTION) { - if ($3 != NULL) - $$ = new Item_func_udf_int(udf, *$3); + if ($4 != NULL) + $$ = new Item_func_udf_int(udf, *$4); else $$ = new Item_func_udf_int(udf); } else { - if ($3 != NULL) - $$ = new Item_sum_udf_int(udf, *$3); + if ($4 != NULL) + $$ = new Item_sum_udf_int(udf, *$4); else $$ = new Item_sum_udf_int(udf); } @@ -4839,15 +4860,15 @@ simple_expr: case DECIMAL_RESULT: if (udf->type == UDFTYPE_FUNCTION) { - if ($3 != NULL) - $$ = new Item_func_udf_decimal(udf, *$3); + if ($4 != NULL) + $$ = new Item_func_udf_decimal(udf, *$4); else $$ = new Item_func_udf_decimal(udf); } else { - if ($3 != NULL) - $$ = new Item_sum_udf_decimal(udf, *$3); + if ($4 != NULL) + $$ = new Item_sum_udf_decimal(udf, *$4); else $$ = new Item_sum_udf_decimal(udf); } @@ -4863,8 +4884,8 @@ simple_expr: sp_name *name= sp_name_current_db_new(YYTHD, $1); sp_add_used_routine(lex, YYTHD, name, TYPE_ENUM_FUNCTION); - if ($3) - $$= new Item_func_sp(Lex->current_context(), name, *$3); + if ($4) + $$= new Item_func_sp(Lex->current_context(), name, *$4); else $$= new Item_func_sp(Lex->current_context(), name); lex->safe_to_cache_query=0; From 16328ca2159b40d88dc532e42c13e92499ee87e6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Sep 2005 12:07:18 +0200 Subject: [PATCH 049/225] ndb - post merge fixes ndb/include/ndbapi/NdbTransaction.hpp: post merge fixes ndb/src/ndbapi/Ndblist.cpp: post merge fixes sql/ha_ndbcluster.cc: post merge fixes --- ndb/include/ndbapi/NdbTransaction.hpp | 2 +- ndb/src/ndbapi/Ndblist.cpp | 7 ------- sql/ha_ndbcluster.cc | 5 ++--- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/ndb/include/ndbapi/NdbTransaction.hpp b/ndb/include/ndbapi/NdbTransaction.hpp index 4b12b0acbf3..a6ba6a11c4d 100644 --- a/ndb/include/ndbapi/NdbTransaction.hpp +++ b/ndb/include/ndbapi/NdbTransaction.hpp @@ -806,7 +806,7 @@ private: void define_scan_op(NdbIndexScanOperation*); friend class HugoOperations; - friend struct Ndb_free_list_t; + friend struct Ndb_free_list_t; }; #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL diff --git a/ndb/src/ndbapi/Ndblist.cpp b/ndb/src/ndbapi/Ndblist.cpp index 3779ba33624..f82348fc91d 100644 --- a/ndb/src/ndbapi/Ndblist.cpp +++ b/ndb/src/ndbapi/Ndblist.cpp @@ -132,13 +132,6 @@ NdbTransaction* Ndb::getNdbCon() { NdbTransaction* tNdbCon = theImpl->theConIdleList.seize(this); - if (unlikely(theImpl->theConIdleList.m_alloc_cnt > theMaxNoOfTransactions)) - { - theImpl->theConIdleList.release(tNdbCon); - ndbout << "theNoOfAllocatedTransactions = " << theNoOfAllocatedTransactions << " theMaxNoOfTransactions = " << theMaxNoOfTransactions << endl; - return NULL; - }//if - tNdbCon->theMagicNumber = 0x37412619; return tNdbCon; } diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 6e03da4e436..8afa9e9c2cc 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -7416,10 +7416,9 @@ ndbcluster_show_status(THD* thd) if (protocol->send_fields(&field_list, 1)) DBUG_RETURN(TRUE); - if (thd->transaction.thd_ndb && - ((Thd_ndb*)thd->transaction.thd_ndb)->ndb) + if (get_thd_ndb(thd) && get_thd_ndb(thd)->ndb) { - Ndb* ndb= ((Thd_ndb*)thd->transaction.thd_ndb)->ndb; + Ndb* ndb= (get_thd_ndb(thd))->ndb; Ndb::Free_list_usage tmp; tmp.m_name= 0; while (ndb->get_free_list_usage(&tmp)) { From 6bec4bc605961b7c8066a8d8e594dc60aabd5e75 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Sep 2005 12:13:17 +0200 Subject: [PATCH 050/225] Improved output client/mysqltest.c: Don't print "At line: 0" --- client/mysqltest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 19c74629a55..1e04b41f35c 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -577,7 +577,8 @@ static void die(const char *fmt, ...) if (cur_file && cur_file != file_stack) fprintf(stderr, "In included file \"%s\": ", cur_file->file_name); - fprintf(stderr, "At line %u: ", start_lineno); + if (start_lineno != 0) + fprintf(stderr, "At line %u: ", start_lineno); vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); fflush(stderr); From 5f81fbb323d33c1060e364d8f9fda7bc1d378d2e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Sep 2005 14:00:39 +0300 Subject: [PATCH 051/225] Fix for BUG#13127. The problem was in the way table references are pre-filtered when resolving a qualified field. When resolving qualified table references we search recursively in the operands of the join. If there is natural/using join with a merge view, the first call to find_field_in_table_ref makes a recursive call to itself with the view as the new table reference to search for the column. However the view has both nested_join and join_columns != NULL so it skipped the test whether the view name matches the field qualifier. As a result the field was found in the view since the view already has a field with the same name. Thus the field was incorrectly resolved as the view field. mysql-test/r/select.result: Test for BUG#13127. mysql-test/t/select.test: Test for BUG#13127. sql/sql_base.cc: The patch contains two independent changes: - When searching for qualified fields, include merge views and information schema tables used with SHOW (both using TABLE_LIST::field_translation to represent result fields) in the test that compares the qualifying table with the name of the table reference being searched. This change fixes the bug. - Do not search the materialized list of columns of a NATURAL/USING join if 'table_list' is a stored table or merge view. Instead search directly in the table or view as if it is not under a natural join. This is a performance improvement since if 'table_list' is a stored table, then the search can utilize the name hash for table names. --- mysql-test/r/select.result | 69 ++++++++++++++++++++++++++++ mysql-test/t/select.test | 30 ++++++++++++ sql/sql_base.cc | 94 +++++++++++++++++++++++++------------- 3 files changed, 162 insertions(+), 31 deletions(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index e3af75a4573..eeb6e227c6a 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2960,3 +2960,72 @@ x x 4 4 4 5 drop table t1,t2,t3; +create table t1 (id char(16) not null default '', primary key (id)); +insert into t1 values ('100'),('101'),('102'); +create table t2 (id char(16) default null); +insert into t2 values (1); +create view v1 as select t1.id from t1; +create view v2 as select t2.id from t2; +create view v3 as select (t1.id+2) as id from t1 natural left join t2; +select t1.id from t1 left join v2 using (id); +id +100 +101 +102 +select t1.id from v2 right join t1 using (id); +id +100 +101 +102 +select t1.id from t1 left join v3 using (id); +id +100 +101 +102 +select * from t1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join t1 using (id); +id +100 +101 +102 +select * from t1 left join v3 using (id); +id +100 +101 +102 +select v1.id from v1 left join v2 using (id); +id +100 +101 +102 +select v1.id from v2 right join v1 using (id); +id +100 +101 +102 +select v1.id from v1 left join v3 using (id); +id +100 +101 +102 +select * from v1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join v1 using (id); +id +100 +101 +102 +select * from v1 left join v3 using (id); +id +100 +101 +102 +drop table t1, t2; +drop view v1, v2, v3; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 620a9fb55b7..4ad23be2649 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2535,3 +2535,33 @@ insert into t2 values (1, 1), (2, 1), (3, 3), (4, 6), (5, 6); insert into t3 values (1), (2), (3), (4), (5); select t1.x, t3.x from t1, t2, t3 where t1.x = t2.x and t3.x >= t1.y and t3.x <= t2.y; drop table t1,t2,t3; + +# +# Bug #13127 LEFT JOIN against a VIEW returns NULL instead of correct value +# + +create table t1 (id char(16) not null default '', primary key (id)); +insert into t1 values ('100'),('101'),('102'); +create table t2 (id char(16) default null); +insert into t2 values (1); +create view v1 as select t1.id from t1; +create view v2 as select t2.id from t2; +create view v3 as select (t1.id+2) as id from t1 natural left join t2; + +# all queries must return the same result +select t1.id from t1 left join v2 using (id); +select t1.id from v2 right join t1 using (id); +select t1.id from t1 left join v3 using (id); +select * from t1 left join v2 using (id); +select * from v2 right join t1 using (id); +select * from t1 left join v3 using (id); + +select v1.id from v1 left join v2 using (id); +select v1.id from v2 right join v1 using (id); +select v1.id from v1 left join v3 using (id); +select * from v1 left join v2 using (id); +select * from v2 right join v1 using (id); +select * from v1 left join v3 using (id); + +drop table t1, t2; +drop view v1, v2, v3; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index fb23093731a..d10c0d279d0 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2948,6 +2948,18 @@ find_field_in_table(THD *thd, TABLE *table, const char *name, uint length, belongs - differs from 'table_list' only for NATURAL_USING joins. + DESCRIPTION + Find a field in a table reference depending on the type of table + reference. There are three types of table references with respect + to the representation of their result columns: + - an array of Field_translator objects for MERGE views and some + information_schema tables, + - an array of Field objects (and possibly a name hash) for stored + tables, + - a list of Natural_join_column objects for NATURAL/USING joins. + This procedure detects the type of the table reference 'table_list' + and calls the corresponding search routine. + RETURN 0 field is not found view_ref_found found value in VIEW (real result is in *ref) @@ -2971,16 +2983,30 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list, /* Check that the table and database that qualify the current field name - are the same as the table we are going to search for the field. - This is done differently for NATURAL/USING joins or nested joins that - are operands of NATURAL/USING joins because there we can't simply - compare the qualifying table and database names with the ones of - 'table_list' because each field in such a join may originate from a - different table. + are the same as the table reference we are going to search for the field. + + We exclude from the test below NATURAL/USING joins and any nested join + that is an operand of NATURAL/USING join, because each column in such + joins may potentially originate from a different table. However, base + tables and views that are under some NATURAL/USING join are searched + as usual base tables/views. + + We include explicitly table references with a 'field_translation' table, + because if there are views over natural joins we don't want to search + inside the view, but we want to search directly in the view columns + which are represented as a 'field_translation'. + TODO: Ensure that table_name, db_name and tables->db always points to something ! */ - if (!(table_list->nested_join && table_list->join_columns) && + if (/* Exclude natural joins and nested joins underlying natural joins. */ + (!(table_list->nested_join && table_list->join_columns) || + /* Include merge views and information schema tables. */ + table_list->field_translation) && + /* + Test if the field qualifiers match the table reference we plan + to search. + */ table_name && table_name[0] && (my_strcasecmp(table_alias_charset, table_list->alias, table_name) || (db_name && db_name[0] && table_list->db && table_list->db[0] && @@ -2988,25 +3014,48 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list, DBUG_RETURN(0); *actual_table= NULL; + if (table_list->field_translation) { + /* 'table_list' is a view or an information schema table. */ if ((fld= find_field_in_view(thd, table_list, name, item_name, length, ref, check_grants_view, register_tree_change))) *actual_table= table_list; } - else if (table_list->nested_join && table_list->join_columns) + else if (!(table_list->nested_join && table_list->join_columns)) { /* - If this is a NATURAL/USING join, or an operand of such join which is a - join itself, and the field name is qualified, then search for the field - in the operands of the join. + 'table_list' is a stored table. It is so because the only type of nested + join passed to this procedure is a NATURAL/USING join or an operand of a + NATURAL/USING join. + */ + if ((fld= find_field_in_table(thd, table_list->table, name, length, + check_grants_table, allow_rowid, + cached_field_index_ptr))) + *actual_table= table_list; +#ifndef NO_EMBEDDED_ACCESS_CHECKS + /* check for views with temporary table algorithm */ + if (check_grants_view && table_list->view && + fld && fld != WRONG_GRANT && + check_grant_column(thd, &table_list->grant, + table_list->view_db.str, + table_list->view_name.str, + name, length)) + fld= WRONG_GRANT; +#endif + } + else + { + /* + 'table_list' is a NATURAL/USING join, or an operand of such join that + is a nested join itself. + + If the field name we search for is qualified, then search for the field + in the table references used by NATURAL/USING the join. */ if (table_name && table_name[0]) { - /* - Qualified field; Search for it in the tables used by the natural join. - */ List_iterator it(table_list->nested_join->join_list); TABLE_LIST *table; while ((table= it++)) @@ -3032,23 +3081,6 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list, check_grants_table || check_grants_view, register_tree_change, actual_table); } - else - { - if ((fld= find_field_in_table(thd, table_list->table, name, length, - check_grants_table, allow_rowid, - cached_field_index_ptr))) - *actual_table= table_list; -#ifndef NO_EMBEDDED_ACCESS_CHECKS - /* check for views with temporary table algorithm */ - if (check_grants_view && table_list->view && - fld && fld != WRONG_GRANT && - check_grant_column(thd, &table_list->grant, - table_list->view_db.str, - table_list->view_name.str, - name, length)) - fld= WRONG_GRANT; -#endif - } DBUG_RETURN(fld); } From 0aee9b2c19b52be26e9a0dc67ae178ccfa70db35 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Sep 2005 14:11:58 +0200 Subject: [PATCH 052/225] BUG#12959 mysqltest crashes if testcase passed with -x option - Enable testcases after help from Serg client/mysqltest.c: Dump output to stdout if no result file is specified Don't print verbose_msg when command fails whith expected error mysql-test/mysql-test-run.pl: Don't add all args to the MYSQL_TEST environment variable. mysql-test/r/mysqltest.result: Add test for mysqltest -x mysql-test/t/mysqltest.test: Add test for mysqltest -x --- client/mysqltest.c | 24 ++++++++++++++++-------- mysql-test/mysql-test-run.pl | 19 ++++++++++++------- mysql-test/r/mysqltest.result | 4 ++++ mysql-test/t/mysqltest.test | 10 +++++----- 4 files changed, 37 insertions(+), 20 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 1e04b41f35c..6963ff2f99e 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1062,8 +1062,8 @@ static void do_exec(struct st_query *query) (query->expected_errno[i].code.errnum == status)) { ok= 1; - verbose_msg("command \"%s\" failed with expected error: %d", - cmd, status); + DBUG_PRINT("info", ("command \"%s\" failed with expected error: %d", + cmd, status)); } } if (!ok) @@ -2557,7 +2557,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), fn_format(buff, argument, "", "", 4); DBUG_ASSERT(cur_file == file_stack && cur_file->file == 0); if (!(cur_file->file= - my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(MY_WME)))) + my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(0)))) die("Could not open %s: errno = %d", buff, errno); cur_file->file_name= my_strdup(buff, MYF(MY_FAE)); break; @@ -2663,7 +2663,7 @@ void str_to_file(const char *fname, char *str, int size) fname=buff; } fn_format(buff,fname,"","",4); - + if ((fd = my_open(buff, O_WRONLY | O_CREAT | O_TRUNC, MYF(MY_WME | MY_FFNF))) < 0) die("Could not open %s: errno = %d", buff, errno); @@ -4043,12 +4043,20 @@ int main(int argc, char **argv) parser.current_line += current_line_inc; } - if (result_file && ds_res.length && !error) + if (ds_res.length && !error) { - if (!record) - error |= check_result(&ds_res, result_file, q->require_file); + if (result_file) + { + if (!record) + error |= check_result(&ds_res, result_file, q->require_file); + else + str_to_file(result_file, ds_res.str, ds_res.length); + } else - str_to_file(result_file, ds_res.str, ds_res.length); + { + // Print the result to stdout + printf("%s", ds_res.str); + } } dynstr_free(&ds_res); diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 013b8d49967..eed80b1e339 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2155,11 +2155,6 @@ sub run_mysqltest ($) { mtr_add_arg($args, "--big-test"); } - if ( $opt_record ) - { - mtr_add_arg($args, "--record"); - } - if ( $opt_compress ) { mtr_add_arg($args, "--compress"); @@ -2185,8 +2180,6 @@ sub run_mysqltest ($) { $glob_mysql_test_dir); } - mtr_add_arg($args, "-R"); - mtr_add_arg($args, $tinfo->{'result_file'}); # ---------------------------------------------------------------------- # If embedded server, we create server args to give mysqltest to pass on @@ -2202,6 +2195,18 @@ sub run_mysqltest ($) { # ---------------------------------------------------------------------- $ENV{'MYSQL_TEST'}= "$exe_mysqltest " . join(" ", @$args); + # ---------------------------------------------------------------------- + # Add arguments that should not go into the MYSQL_TEST env var + # ---------------------------------------------------------------------- + + mtr_add_arg($args, "-R"); + mtr_add_arg($args, $tinfo->{'result_file'}); + + if ( $opt_record ) + { + mtr_add_arg($args, "--record"); + } + return mtr_run_test($exe,$args,$tinfo->{'path'},"",$path_timefile,""); } diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 2277fe1b5ed..0e3d3812781 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -345,6 +345,10 @@ mysqltest: At line 1: Wrong column number to replace_column in 'replace_column 1 mysqltest: At line 1: Invalid integer argument "10!" mysqltest: At line 1: End of line junk detected: "!" mysqltest: At line 1: Invalid integer argument "a" +Output from mysqltest-x.inc +Output from mysqltest-x.inc +Output from mysqltest-x.inc +mysqltest: Could not open ./non_existing_file.inc: errno = 2 failing_statement; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing_statement' at line 1 failing_statement; diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index fc9f621f7cd..7ed204fc6d3 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -810,11 +810,11 @@ select "a" as col1, "c" as col2; # ---------------------------------------------------------------------------- # -x , use the file specified after -x as the test file -#--exec $MYSQL_TEST < $MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1 -#--exec $MYSQL_TEST -x $MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1 -#--exec $MYSQL_TEST --result_file=$MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1 -#--error 1 -#--exec $MYSQL_TEST -x non_existing_file.inc 2>&1 +--exec $MYSQL_TEST < $MYSQL_TEST_DIR/include/mysqltest-x.inc +--exec $MYSQL_TEST -x $MYSQL_TEST_DIR/include/mysqltest-x.inc +--exec $MYSQL_TEST --test_file=$MYSQL_TEST_DIR/include/mysqltest-x.inc +--error 1 +--exec $MYSQL_TEST -x non_existing_file.inc 2>&1 # ---------------------------------------------------------------------------- From 3ce33c2c5281ef33f03ff0df1c177bd4be1b9670 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Sep 2005 14:20:02 +0200 Subject: [PATCH 053/225] Bug #10694 LOAD DATA FROM INFILE fails with 'Out of operation records' --- sql/sql_load.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sql/sql_load.cc b/sql/sql_load.cc index c4f5b1427af..7b963c7ea31 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -114,6 +114,10 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, MYF(0)); DBUG_RETURN(-1); } + /* + This needs to be done before external_lock + */ + ha_enable_transaction(thd, FALSE); if (!(table = open_ltable(thd,table_list,lock_type))) DBUG_RETURN(-1); transactional_table= table->file->has_transactions(); @@ -273,7 +277,6 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, if (ignore || handle_duplicates == DUP_REPLACE) table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); - ha_enable_transaction(thd, FALSE); table->file->start_bulk_insert((ha_rows) 0); table->copy_blobs=1; if (!field_term->length() && !enclosed->length()) @@ -284,10 +287,10 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, skip_lines); if (table->file->end_bulk_insert()) error=1; /* purecov: inspected */ - ha_enable_transaction(thd, TRUE); table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); table->next_number_field=0; } + ha_enable_transaction(thd, TRUE); if (file >= 0) my_close(file,MYF(0)); free_blobs(table); /* if pack_blob was used */ From 03045ee70ab6a3adf93c2a7506a3281f411d66fa Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Sep 2005 17:41:47 +0200 Subject: [PATCH 054/225] Fix fur BUG#13348: "multi-table updates and deletes are not logged if no rows were affected". Not fixed in 4.1 as not critical. Also I'm correcting error checking of multi-UPDATE/DELETE when it comes to binlogging, to make it consistent with when we rollback the statement. mysql-test/r/rpl_multi_delete.result: result update mysql-test/r/rpl_multi_update.result: result update mysql-test/t/rpl_multi_delete.test: test for BUG#13348 mysql-test/t/rpl_multi_update.test: test of BUG#13348 sql/sql_delete.cc: We now binlog multi-DELETE even if no row was updated (like we do for DELETE). I'm also correcting some error checking (< instead of <=), basing myself on when we rollback. sql/sql_update.cc: we now binlog multi-UPDATE even if no row was updated (like we do for UPDATE). Adding to existing tests to test new behaviour. I'm also correcting some error checking (< instead of <=), basing myself on when we rollback. --- mysql-test/r/rpl_multi_delete.result | 9 +++++++++ mysql-test/r/rpl_multi_update.result | 13 +++++++++++++ mysql-test/t/rpl_multi_delete.test | 26 +++++++++++++++++++++----- mysql-test/t/rpl_multi_update.test | 23 +++++++++++++++++++++++ sql/sql_delete.cc | 28 ++++++++-------------------- sql/sql_update.cc | 21 ++++++++++++++------- 6 files changed, 88 insertions(+), 32 deletions(-) diff --git a/mysql-test/r/rpl_multi_delete.result b/mysql-test/r/rpl_multi_delete.result index e94a4e7947e..d2c68eee62e 100644 --- a/mysql-test/r/rpl_multi_delete.result +++ b/mysql-test/r/rpl_multi_delete.result @@ -19,4 +19,13 @@ a select * from t2; a 1 +delete from t1; +delete from t2; +insert into t1 values(1); +insert into t2 values(1); +DELETE t1.*, t2.* from t1, t2; +select * from t1; +a +select * from t2; +a drop table t1,t2; diff --git a/mysql-test/r/rpl_multi_update.result b/mysql-test/r/rpl_multi_update.result index 34f99746c7d..04cb1bc7460 100644 --- a/mysql-test/r/rpl_multi_update.result +++ b/mysql-test/r/rpl_multi_update.result @@ -24,3 +24,16 @@ a b 1 0 2 1 UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a; +delete from t1; +delete from t2; +insert into t1 values(1,1); +insert into t2 values(1,1); +update t1 set a=2; +UPDATE t1, t2 SET t1.a = t2.a; +select * from t1; +a b +1 1 +select * from t2; +a b +1 1 +drop table t1, t2; diff --git a/mysql-test/t/rpl_multi_delete.test b/mysql-test/t/rpl_multi_delete.test index 2fd7b820b1a..0538d0d7bae 100644 --- a/mysql-test/t/rpl_multi_delete.test +++ b/mysql-test/t/rpl_multi_delete.test @@ -16,10 +16,26 @@ sync_with_master; select * from t1; select * from t2; +# End of 4.1 tests + +# Check if deleting 0 rows is binlogged (BUG#13348) + +connection master; +delete from t1; +delete from t2; + +connection slave; +# force a difference to see if master's multi-DELETE will correct it +insert into t1 values(1); +insert into t2 values(1); + +connection master; +DELETE t1.*, t2.* from t1, t2; + +sync_slave_with_master; +select * from t1; +select * from t2; + connection master; drop table t1,t2; -save_master_pos; -connection slave; -sync_with_master; - -# End of 4.1 tests +sync_slave_with_master; diff --git a/mysql-test/t/rpl_multi_update.test b/mysql-test/t/rpl_multi_update.test index dd75edb3055..f400e722556 100644 --- a/mysql-test/t/rpl_multi_update.test +++ b/mysql-test/t/rpl_multi_update.test @@ -24,3 +24,26 @@ connection slave; sync_with_master; # End of 4.1 tests + +# Check if updating 0 rows is binlogged (BUG#13348) + +connection master; +delete from t1; +delete from t2; +insert into t1 values(1,1); +insert into t2 values(1,1); + +connection slave; +# force a difference to see if master's multi-UPDATE will correct it +update t1 set a=2; + +connection master; +UPDATE t1, t2 SET t1.a = t2.a; + +sync_slave_with_master; +select * from t1; +select * from t2; + +connection master; +drop table t1, t2; +sync_slave_with_master; diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 7fb9f9eccdd..7e99a5c65ee 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -258,19 +258,12 @@ cleanup: delete select; transactional_table= table->file->has_transactions(); - /* - We write to the binary log even if we deleted no row, because maybe the - user is using this command to ensure that a table is clean on master *and - on slave*. Think of the case of a user having played separately with the - master's table and slave's table and wanting to take a fresh identical - start now. - error < 0 means "really no error". error <= 0 means "maybe some error". - */ - if ((deleted || (error < 0)) && (error <= 0 || !transactional_table)) + /* See similar binlogging code in sql_update.cc, for comments */ + if ((error < 0) || (deleted && !transactional_table)) { if (mysql_bin_log.is_open()) { - if (error <= 0) + if (error < 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, transactional_table, FALSE); @@ -718,6 +711,9 @@ bool multi_delete::send_eof() /* Does deletes for the last n - 1 tables, returns 0 if ok */ int local_error= do_deletes(); // returns 0 if success + /* compute a total error to know if something failed */ + local_error= local_error || error; + /* reset used flags */ thd->proc_info="end"; @@ -730,19 +726,11 @@ bool multi_delete::send_eof() query_cache_invalidate3(thd, delete_tables, 1); } - /* - Write the SQL statement to the binlog if we deleted - rows and we succeeded, or also in an error case when there - was a non-transaction-safe table involved, since - modifications in it cannot be rolled back. - Note that if we deleted nothing we don't write to the binlog (TODO: - fix this). - */ - if (deleted && ((error <= 0 && !local_error) || normal_tables)) + if ((local_error == 0) || (deleted && normal_tables)) { if (mysql_bin_log.is_open()) { - if (error <= 0 && !local_error) + if (local_error == 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, transactional_tables, FALSE); diff --git a/sql/sql_update.cc b/sql/sql_update.cc index a75eef9324c..efdf1291305 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -475,11 +475,20 @@ int mysql_update(THD *thd, query_cache_invalidate3(thd, table_list, 1); } - if ((updated || (error < 0)) && (error <= 0 || !transactional_table)) + /* + error < 0 means really no error at all: we processed all rows until the + last one without error. error > 0 means an error (e.g. unique key + violation and no IGNORE or REPLACE). error == 0 is also an error (if + preparing the record or invoking before triggers fails). See + ha_autocommit_or_rollback(error>=0) and DBUG_RETURN(error>=0) below. + Sometimes we want to binlog even if we updated no rows, in case user used + it to be sure master and slave are in same state. + */ + if ((error < 0) || (updated && !transactional_table)) { if (mysql_bin_log.is_open()) { - if (error <= 0) + if (error < 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, transactional_table, FALSE); @@ -1439,16 +1448,14 @@ bool multi_update::send_eof() /* Write the SQL statement to the binlog if we updated rows and we succeeded or if we updated some non - transacational tables. - Note that if we updated nothing we don't write to the binlog (TODO: - fix this). + transactional tables. */ - if (updated && (local_error <= 0 || !trans_safe)) + if ((local_error == 0) || (updated && !trans_safe)) { if (mysql_bin_log.is_open()) { - if (local_error <= 0) + if (local_error == 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, transactional_tables, FALSE); From ac604f715d7e8a2c290c9a0ca7ba092db1557505 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Sep 2005 20:03:51 +0400 Subject: [PATCH 055/225] Small update for lock functions used in my_cgets() --- mysys/my_conio.c | 111 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 91 insertions(+), 20 deletions(-) diff --git a/mysys/my_conio.c b/mysys/my_conio.c index 2bf2c1cf1c0..e381f9f23ef 100644 --- a/mysys/my_conio.c +++ b/mysys/my_conio.c @@ -18,23 +18,89 @@ #include "mysys_priv.h" #ifdef __WIN__ -static int my_coninpfh= 0; /* console input */ + +static HANDLE my_coninpfh= 0; /* console input */ + +/* + functions my_pthread_auto_mutex_lock & my_pthread_auto_mutex_free + are experimental at this moment, they are intended to bring + ability of protecting code sections without necessity to explicitly + initialize synchronization object in one of threads + + if found useful they are to be exported in mysys +*/ + +/* + int my_pthread_auto_mutex_lock(HANDLE* ph, const char* name, + int id, int time) + + NOTES + creates a mutex with given name and tries to lock it time msec. + mutex name is appended with id to allow system wide or process wide + locks. Handle to created mutex returned in ph argument. + + RETURN + 0 thread owns mutex + <>0 error + +*/ +static +int my_pthread_auto_mutex_lock(HANDLE* ph, const char* name, int id, int time) +{ + int res; + char tname[FN_REFLEN]; + + sprintf(tname, "%s-%08X", name, id); + + *ph= CreateMutex(NULL, FALSE, tname); + if (*ph == NULL) + return GetLastError(); + + res= WaitForSingleObject(*ph, time); + + if (res == WAIT_TIMEOUT) + return ERROR_SEM_TIMEOUT; + + if (res == WAIT_FAILED) + return GetLastError(); + + return 0; +} + +/* + int my_pthread_auto_mutex_free(HANDLE* ph) + + + NOTES + releases a mutex. + + RETURN + 0 thread released mutex + <>0 error + +*/ +static +int my_pthread_auto_mutex_free(HANDLE* ph) +{ + if (*ph) + { + ReleaseMutex(*ph); + CloseHandle(*ph); + *ph= NULL; + } + + return 0; +} + #define pthread_auto_mutex_decl(name) \ - HANDLE __h##name= NULL; \ - char __p##name[sizeof(#name)+16]; + HANDLE __h##name= NULL; #define pthread_auto_mutex_lock(name, proc, time) \ - sprintf(__p##name, "%s-%08X", #name, (proc)); \ - __h##name= CreateMutex(NULL, FALSE, __p##name); \ - WaitForSingleObject(__h##name, (time)); + my_pthread_auto_mutex_lock(&__h##name, #name, (proc), (time)) #define pthread_auto_mutex_free(name) \ - if (__h##name) \ - { \ - ReleaseMutex(__h##name); \ - CloseHandle(__h##name); \ - } + my_pthread_auto_mutex_free(&__h##name) /* @@ -62,24 +128,29 @@ char* my_cgets(char *buffer, unsigned long clen, unsigned long* plen) char *result; CONSOLE_SCREEN_BUFFER_INFO csbi; - pthread_auto_mutex_decl(my_conio_mutex); + pthread_auto_mutex_decl(my_conio_cs); - /* lock the console */ - pthread_auto_mutex_lock(my_conio_mutex, GetCurrentProcessId(), INFINITE); + /* lock the console for the current process*/ + if (pthread_auto_mutex_lock(my_conio_cs, GetCurrentProcessId(), INFINITE)) + { + /* can not lock console */ + pthread_auto_mutex_free(my_conio_cs); + return NULL; + } /* init console input */ if (my_coninpfh == 0) { /* same handle will be used until process termination */ - my_coninpfh= (int)CreateFile("CONIN$", GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, OPEN_EXISTING, 0, NULL); + my_coninpfh= CreateFile("CONIN$", GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, 0, NULL); } - if (my_coninpfh == -1) + if (my_coninpfh == INVALID_HANDLE_VALUE) { /* unlock the console */ - pthread_auto_mutex_free(my_conio_mutex); + pthread_auto_mutex_free(my_conio_cs); return(NULL); } @@ -138,7 +209,7 @@ char* my_cgets(char *buffer, unsigned long clen, unsigned long* plen) SetConsoleMode((HANDLE)my_coninpfh, state); /* unlock the console */ - pthread_auto_mutex_free(my_conio_mutex); + pthread_auto_mutex_free(my_conio_cs); return result; } From 206282eecbf4d072a307668645d1384d94896f3d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Sep 2005 19:26:00 +0200 Subject: [PATCH 056/225] make_binary_distribution.sh: Include libz.a in distribution if built bundled scripts/make_binary_distribution.sh: Include libz.a in distribution if built bundled --- scripts/make_binary_distribution.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index fbdbd998138..9c2ae9c42f2 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -169,7 +169,8 @@ for i in \ libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* \ mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a \ libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* \ - libmysqld/libmysqld.a netware/libmysql.imp + libmysqld/libmysqld.a netware/libmysql.imp \ + zlib/.libs/libz.a do if [ -f $i ] then From 58dbcea4b4b1ad35559f0836286dfb93f1f93fb5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Sep 2005 21:35:57 +0400 Subject: [PATCH 057/225] item_func.cc: Fixed mistake in fix for bug#12812 sql/item_func.cc: Fixed mistake in fix for bug#12812 --- sql/item_func.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/item_func.cc b/sql/item_func.cc index 9503318e145..de221621ac0 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4901,7 +4901,7 @@ Item_func_sp::check_access(ulong want_access, bool report_error, st_sp_security_ sp_change_security_context(thd, m_sp, curr_ctx); ctx_switched= curr_ctx->changed; - if (save_ctx.changed && + if (curr_ctx->changed && check_routine_access(thd, want_access, m_sp->m_db.str, m_sp->m_name.str, 0, 0)) { From 3fe752f527895bcd6b32f9cf7f1dcd983d4b4313 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Sep 2005 21:20:38 +0300 Subject: [PATCH 058/225] WL#2787 (Add view definer/owner to the view definition (.frm) to check privileges on used tables and stored routines when using a VIEW.) Part 2 postreview fixes. sql/ha_innodb.cc: Renamed structure st_security_context to class Security_context sql/item_func.cc: Renamed structure st_security_context to class Security_context sql/item_strfunc.cc: fixed USER() function sql/log.cc: variable used to optimize access to security context sql/mysql_priv.h: Renamed structure st_security_context to class Security_context sql/mysqld.cc: main security context used direcly sql/sp_head.cc: Renamed structure st_security_context to class Security_context removed unneed variable sql/sp_head.h: Comment inmroved Renamed structure st_security_context to class Security_context sql/sql_acl.cc: Renamed structure st_security_context to class Security_context fixed function comment and return value variable used to optimize access to security context Renamed method of Security_ontext sql/sql_acl.h: fixed return value type sql/sql_class.cc: Renamed structure st_security_context to class Security_context sql/sql_class.h: Renamed structure st_security_context to class Security_context Method renamed sql/sql_db.cc: Renamed structure st_security_context to class Security_context fixed layout sql/sql_parse.cc: registration of wanted access for underlying tables sql/sql_show.cc: Renamed structure st_security_context to class Security_context fixed layout sql/sql_yacc.yy: Renamed structure st_security_context to class Security_context --- sql/ha_innodb.cc | 2 +- sql/item_func.cc | 2 +- sql/item_strfunc.cc | 2 +- sql/log.cc | 11 ++--- sql/mysql_priv.h | 4 +- sql/mysqld.cc | 4 +- sql/sp_head.cc | 16 +++---- sql/sp_head.h | 11 +++-- sql/sql_acl.cc | 68 ++++++++++++++++------------ sql/sql_acl.h | 4 +- sql/sql_class.cc | 6 +-- sql/sql_class.h | 12 ++--- sql/sql_db.cc | 6 +-- sql/sql_parse.cc | 105 +++++++++++++++++++++++++------------------- sql/sql_show.cc | 14 +++--- sql/sql_yacc.yy | 4 +- 16 files changed, 151 insertions(+), 120 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index fd5db6da722..5ded583ded6 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -563,7 +563,7 @@ innobase_mysql_print_thd( use the default max length */ { const THD* thd; - const st_security_context *sctx; + const Security_context *sctx; const char* s; thd = (const THD*) input_thd; diff --git a/sql/item_func.cc b/sql/item_func.cc index 338bb4db4fe..95ac2f9a697 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4713,7 +4713,7 @@ Item_func_sp::execute(Item **itp) Sub_statement_state statement_state; #ifndef NO_EMBEDDED_ACCESS_CHECKS - st_security_context *save_ctx; + Security_context *save_ctx; #endif if (! m_sp && ! (m_sp= sp_find_function(thd, m_name, TRUE))) diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 6a51ecd307d..1876a5ecaf7 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1608,7 +1608,7 @@ String *Item_func_user::val_str(String *str) else { user= thd->main_security_ctx.user; - host= thd->main_security_ctx.priv_host; + host= thd->main_security_ctx.host; } // For system threads (e.g. replication SQL thread) user may be empty diff --git a/sql/log.cc b/sql/log.cc index 032ac392c00..8010d03b46a 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1915,6 +1915,7 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length, } if (!(specialflag & SPECIAL_SHORT_LOG_FORMAT) || query_start_arg) { + Security_context *sctx= thd->security_ctx; current_time=time(NULL); if (current_time != last_time) { @@ -1935,11 +1936,11 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length, tmp_errno=errno; } if (my_b_printf(&log_file, "# User@Host: %s[%s] @ %s [%s]\n", - thd->security_ctx->priv_user ? - thd->security_ctx->priv_user : "", - thd->security_ctx->user ? thd->security_ctx->user : "", - thd->security_ctx->host ? thd->security_ctx->host : "", - thd->security_ctx->ip ? thd->security_ctx->ip : "") == + sctx->priv_user ? + sctx->priv_user : "", + sctx->user ? sctx->user : "", + sctx->host ? sctx->host : "", + sctx->ip ? sctx->ip : "") == (uint) -1) tmp_errno=errno; } diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 059b9cca48e..fc7bac89274 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -484,7 +484,7 @@ typedef my_bool (*qc_engine_callback)(THD *thd, char *table_key, #include "protocol.h" #include "sql_udf.h" class user_var_entry; -class st_security_context; +class Security_context; enum enum_var_type { OPT_DEFAULT= 0, OPT_SESSION, OPT_GLOBAL @@ -516,7 +516,7 @@ bool delete_precheck(THD *thd, TABLE_LIST *tables); bool insert_precheck(THD *thd, TABLE_LIST *tables); bool create_table_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *create_table); -bool default_view_definer(st_security_context *sctx, st_lex_user *definer); +bool default_view_definer(Security_context *sctx, st_lex_user *definer); enum enum_mysql_completiontype { diff --git a/sql/mysqld.cc b/sql/mysqld.cc index daabb53a39d..c76481f6583 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -777,8 +777,8 @@ static void close_connections(void) if (global_system_variables.log_warnings) sql_print_warning(ER(ER_FORCING_CLOSE),my_progname, tmp->thread_id, - (tmp->security_ctx->user ? - tmp->security_ctx->user : "")); + (tmp->main_security_ctx.user ? + tmp->main_security_ctx.user : "")); close_connection(tmp,0,0); } #endif diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 0d481047849..157672f2a86 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -2648,16 +2648,14 @@ sp_instr_error::print(String *str) #ifndef NO_EMBEDDED_ACCESS_CHECKS bool -sp_change_security_context(THD *thd, sp_head *sp, st_security_context **backup) +sp_change_security_context(THD *thd, sp_head *sp, Security_context **backup) { - bool changed= (sp->m_chistics->suid != SP_IS_NOT_SUID && - (strcmp(sp->m_definer_user.str, - thd->security_ctx->priv_user) || - my_strcasecmp(system_charset_info, sp->m_definer_host.str, - thd->security_ctx->priv_host))); - *backup= 0; - if (changed) + if (sp->m_chistics->suid != SP_IS_NOT_SUID && + (strcmp(sp->m_definer_user.str, + thd->security_ctx->priv_user) || + my_strcasecmp(system_charset_info, sp->m_definer_host.str, + thd->security_ctx->priv_host))) { if (acl_getroot_no_password(&sp->m_security_ctx, sp->m_definer_user.str, sp->m_definer_host.str, @@ -2675,7 +2673,7 @@ sp_change_security_context(THD *thd, sp_head *sp, st_security_context **backup) } void -sp_restore_security_context(THD *thd, st_security_context *backup) +sp_restore_security_context(THD *thd, Security_context *backup) { if (backup) thd->security_ctx= backup; diff --git a/sql/sp_head.h b/sql/sp_head.h index ccf8c48a5eb..59169dc35cd 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -151,8 +151,11 @@ public: // Pointers set during parsing uchar *m_param_begin, *m_param_end, *m_body_begin; - /* security context for SP procedure/function in case we switch it*/ - st_security_context m_security_ctx; + /* + Security context for stored routine which should be run under + definer privileges. + */ + Security_context m_security_ctx; static void * operator new(size_t size); @@ -1023,9 +1026,9 @@ private: #ifndef NO_EMBEDDED_ACCESS_CHECKS bool sp_change_security_context(THD *thd, sp_head *sp, - st_security_context **backup); + Security_context **backup); void -sp_restore_security_context(THD *thd, st_security_context *backup); +sp_restore_security_context(THD *thd, Security_context *backup); #endif /* NO_EMBEDDED_ACCESS_CHECKS */ TABLE_LIST * diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 95f7fed358d..d6c473ec8bc 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -719,7 +719,7 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, ulong user_access= NO_ACCESS; int res= 1; ACL_USER *acl_user= 0; - st_security_context *sctx= thd->security_ctx; + Security_context *sctx= thd->security_ctx; DBUG_ENTER("acl_getroot"); if (!initialized) @@ -728,6 +728,7 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, here if mysqld's been started with --skip-grant-tables option. */ sctx->skip_grants(); + bzero((char*) mqh, sizeof(*mqh)); DBUG_RETURN(0); } @@ -906,13 +907,24 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, /* - * This is like acl_getroot() above, but it doesn't check password, - * and we don't care about the user resources. - * Used to get access rights for SQL SECURITY DEFINER invocation of - * stored procedures. - */ -int acl_getroot_no_password(st_security_context *sctx, char *user, char *host, - char *ip, char *db) + This is like acl_getroot() above, but it doesn't check password, + and we don't care about the user resources. + + SYNOPSIS + acl_getroot_no_password() + sctx Context which should be initialized + user user name + host host name + ip IP + db current data base name + + RETURN + FALSE OK + TRUE Error +*/ + +bool acl_getroot_no_password(Security_context *sctx, char *user, char *host, + char *ip, char *db) { int res= 1; uint i; @@ -930,7 +942,7 @@ int acl_getroot_no_password(st_security_context *sctx, char *user, char *host, here if mysqld's been started with --skip-grant-tables option. */ sctx->skip_grants(); - DBUG_RETURN(0); + DBUG_RETURN(FALSE); } VOID(pthread_mutex_lock(&acl_cache->lock)); @@ -1649,7 +1661,7 @@ static bool update_user_table(THD *thd, TABLE *table, static bool test_if_create_new_users(THD *thd) { - st_security_context *sctx= thd->security_ctx; + Security_context *sctx= thd->security_ctx; bool create_new_users= test(sctx->master_access & INSERT_ACL) || (!opt_safe_user_create && test(sctx->master_access & CREATE_USER_ACL)); @@ -3493,7 +3505,7 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables, uint show_table, uint number, bool no_errors) { TABLE_LIST *table; - st_security_context *sctx= thd->security_ctx; + Security_context *sctx= thd->security_ctx; DBUG_ENTER("check_grant"); DBUG_ASSERT(number > 0); @@ -3563,7 +3575,7 @@ bool check_grant_column(THD *thd, GRANT_INFO *grant, const char *db_name, const char *table_name, const char *name, uint length, uint show_tables) { - st_security_context *sctx= thd->security_ctx; + Security_context *sctx= thd->security_ctx; GRANT_TABLE *grant_table; GRANT_COLUMN *grant_column; ulong want_access= grant->want_privilege & ~grant->privilege; @@ -3623,7 +3635,7 @@ bool check_grant_all_columns(THD *thd, ulong want_access, GRANT_INFO *grant, const char* db_name, const char *table_name, Field_iterator *fields) { - st_security_context *sctx= thd->security_ctx; + Security_context *sctx= thd->security_ctx; GRANT_TABLE *grant_table; GRANT_COLUMN *grant_column; @@ -3683,7 +3695,7 @@ err2: bool check_grant_db(THD *thd,const char *db) { - st_security_context *sctx= thd->security_ctx; + Security_context *sctx= thd->security_ctx; char helping [NAME_LEN+USERNAME_LENGTH+2]; uint len; bool error= 1; @@ -3729,7 +3741,7 @@ bool check_grant_routine(THD *thd, ulong want_access, TABLE_LIST *procs, bool is_proc, bool no_errors) { TABLE_LIST *table; - st_security_context *sctx= thd->security_ctx; + Security_context *sctx= thd->security_ctx; char *user= sctx->priv_user; char *host= sctx->priv_host; DBUG_ENTER("check_grant_routine"); @@ -3797,10 +3809,11 @@ bool check_routine_level_acl(THD *thd, const char *db, const char *name, if (grant_option) { GRANT_NAME *grant_proc; + Security_context *sctx= thd->security_ctx; rw_rdlock(&LOCK_grant); - if ((grant_proc= routine_hash_search(thd->security_ctx->priv_host, - thd->security_ctx->ip, db, - thd->security_ctx->priv_user, + if ((grant_proc= routine_hash_search(sctx->priv_host, + sctx->ip, db, + sctx->priv_user, name, is_proc, 0))) no_routine_acl= !(grant_proc->privs & SHOW_PROC_ACLS); rw_unlock(&LOCK_grant); @@ -3816,7 +3829,7 @@ bool check_routine_level_acl(THD *thd, const char *db, const char *name, ulong get_table_grant(THD *thd, TABLE_LIST *table) { ulong privilege; - st_security_context *sctx= thd->security_ctx; + Security_context *sctx= thd->security_ctx; const char *db = table->db ? table->db : thd->db; GRANT_TABLE *grant_table; @@ -3867,9 +3880,10 @@ ulong get_column_grant(THD *thd, GRANT_INFO *grant, /* reload table if someone has modified any grants */ if (grant->version != grant_version) { + Security_context *sctx= thd->security_ctx; grant->grant_table= - table_hash_search(thd->security_ctx->host, thd->security_ctx->ip, - db_name, thd->security_ctx->priv_user, + table_hash_search(sctx->host, sctx->ip, + db_name, sctx->priv_user, table_name, 0); /* purecov: inspected */ grant->version= grant_version; /* purecov: inspected */ } @@ -5439,7 +5453,7 @@ bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name, bool sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name, bool is_proc) { - st_security_context *sctx= thd->security_ctx; + Security_context *sctx= thd->security_ctx; LEX_USER *combo; TABLE_LIST tables[1]; List user_list; @@ -5573,7 +5587,7 @@ int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond) char buff[100]; TABLE *table= tables->table; bool no_global_access= check_access(thd, SELECT_ACL, "mysql",0,1,1,0); - char *curr_host= thd->security_ctx->get_priv_host(); + char *curr_host= thd->security_ctx->priv_host_name(); DBUG_ENTER("fill_schema_user_privileges"); for (counter=0 ; counter < acl_users.elements ; counter++) @@ -5626,7 +5640,7 @@ int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond) char buff[100]; TABLE *table= tables->table; bool no_global_access= check_access(thd, SELECT_ACL, "mysql",0,1,1,0); - char *curr_host= thd->security_ctx->get_priv_host(); + char *curr_host= thd->security_ctx->priv_host_name(); DBUG_ENTER("fill_schema_schema_privileges"); for (counter=0 ; counter < acl_dbs.elements ; counter++) @@ -5681,7 +5695,7 @@ int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond) char buff[100]; TABLE *table= tables->table; bool no_global_access= check_access(thd, SELECT_ACL, "mysql",0,1,1,0); - char *curr_host= thd->security_ctx->get_priv_host(); + char *curr_host= thd->security_ctx->priv_host_name(); DBUG_ENTER("fill_schema_table_privileges"); for (index=0 ; index < column_priv_hash.records ; index++) @@ -5743,7 +5757,7 @@ int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond) char buff[100]; TABLE *table= tables->table; bool no_global_access= check_access(thd, SELECT_ACL, "mysql",0,1,1,0); - char *curr_host= thd->security_ctx->get_priv_host(); + char *curr_host= thd->security_ctx->priv_host_name(); DBUG_ENTER("fill_schema_table_privileges"); for (index=0 ; index < column_priv_hash.records ; index++) @@ -5819,7 +5833,7 @@ int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond) void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant, const char *db, const char *table) { - st_security_context *sctx= thd->security_ctx; + Security_context *sctx= thd->security_ctx; /* --skip-grants */ if (!initialized) { diff --git a/sql/sql_acl.h b/sql/sql_acl.h index f62f3c12b28..0e50737f84c 100644 --- a/sql/sql_acl.h +++ b/sql/sql_acl.h @@ -181,8 +181,8 @@ ulong acl_get(const char *host, const char *ip, const char *user, const char *db, my_bool db_is_pattern); int acl_getroot(THD *thd, USER_RESOURCES *mqh, const char *passwd, uint passwd_len); -int acl_getroot_no_password(st_security_context *sctx, char *user, char *host, - char *ip, char *db); +bool acl_getroot_no_password(Security_context *sctx, char *user, char *host, + char *ip, char *db); bool acl_check_host(const char *host, const char *ip); bool check_change_password(THD *thd, const char *host, const char *user, char *password, uint password_len); diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 85bf520b56e..3d2322f7fff 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1822,7 +1822,7 @@ void THD::set_status_var_init() } -void st_security_context::init() +void Security_context::init() { host= user= priv_user= ip= 0; host_or_ip= "connecting host"; @@ -1832,7 +1832,7 @@ void st_security_context::init() } -void st_security_context::destroy() +void Security_context::destroy() { // If not pointer to constant if (host != my_localhost) @@ -1843,7 +1843,7 @@ void st_security_context::destroy() } -void st_security_context::skip_grants() +void Security_context::skip_grants() { /* privileges for the user are unknown everything is allowed */ host_or_ip= (char *)""; diff --git a/sql/sql_class.h b/sql/sql_class.h index ddc8b092311..08194d6bd52 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -942,15 +942,17 @@ bool xid_cache_insert(XID_STATE *xid_state); void xid_cache_delete(XID_STATE *xid_state); -struct st_security_context { +class Security_context { +public: /* host - host of the client user - user of the client, set to NULL until the user has been read from the connection - priv_user - The user privilege we are using. May be '' for anonymous user. + priv_user - The user privilege we are using. May be "" for anonymous user. ip - client IP */ char *host, *user, *priv_user, *ip; + /* The host privilege we are using */ char priv_host[MAX_HOSTNAME]; /* points to host if host is available, otherwise points to ip */ const char *host_or_ip; @@ -960,7 +962,7 @@ struct st_security_context { void init(); void destroy(); void skip_grants(); - inline char *get_priv_host() + inline char *priv_host_name() { return (*priv_host ? priv_host : (char *)"%"); } @@ -1150,8 +1152,8 @@ public: the slave SQL thread, in sql/slave.cc. */ char *db, *catalog; - st_security_context main_security_ctx; - st_security_context *security_ctx; + Security_context main_security_ctx; + Security_context *security_ctx; /* remote (peer) port */ uint16 peer_port; diff --git a/sql/sql_db.cc b/sql/sql_db.cc index e4d8c1b8164..d89800e34f8 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -1093,7 +1093,7 @@ bool mysql_change_db(THD *thd, const char *name, bool no_access_check) bool system_db= 0; #ifndef NO_EMBEDDED_ACCESS_CHECKS ulong db_access; - st_security_context *sctx= thd->security_ctx; + Security_context *sctx= thd->security_ctx; #endif DBUG_ENTER("mysql_change_db"); DBUG_PRINT("enter",("name: '%s'",name)); @@ -1131,7 +1131,7 @@ bool mysql_change_db(THD *thd, const char *name, bool no_access_check) #ifndef NO_EMBEDDED_ACCESS_CHECKS if (!no_access_check) { - if (test_all_bits(sctx->master_access,DB_ACLS)) + if (test_all_bits(sctx->master_access, DB_ACLS)) db_access=DB_ACLS; else db_access= (acl_get(sctx->host, sctx->ip, sctx->priv_user, dbname, 0) | @@ -1166,7 +1166,7 @@ end: thd->db_length=db_length; #ifndef NO_EMBEDDED_ACCESS_CHECKS if (!no_access_check) - sctx->db_access=db_access; + sctx->db_access= db_access; #endif if (system_db) { diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index d056215c19b..8f259b21919 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -270,11 +270,10 @@ int check_user(THD *thd, enum enum_server_command command, const char *passwd, uint passwd_len, const char *db, bool check_count) { - st_security_context *sctx= thd->security_ctx; DBUG_ENTER("check_user"); #ifdef NO_EMBEDDED_ACCESS_CHECKS - sctx->master_access= GLOBAL_ACLS; // Full rights + thd->ain_security_ctx.master_access= GLOBAL_ACLS; // Full rights /* Change database if necessary */ if (db && db[0]) { @@ -341,15 +340,17 @@ int check_user(THD *thd, enum enum_server_command command, if (opt_secure_auth_local) { net_printf_error(thd, ER_SERVER_IS_IN_SECURE_AUTH_MODE, - sctx->user, sctx->host_or_ip); + thd->main_security_ctx.user, + thd->main_security_ctx.host_or_ip); mysql_log.write(thd, COM_CONNECT, ER(ER_SERVER_IS_IN_SECURE_AUTH_MODE), - sctx->user, sctx->host_or_ip); + thd->main_security_ctx.user, + thd->main_security_ctx.host_or_ip); DBUG_RETURN(-1); } /* We have to read very specific packet size */ if (send_old_password_request(thd) || my_net_read(net) != SCRAMBLE_LENGTH_323 + 1) - { + { inc_host_errors(&thd->remote.sin_addr); DBUG_RETURN(ER_HANDSHAKE_ERROR); } @@ -361,22 +362,27 @@ int check_user(THD *thd, enum enum_server_command command, /* here res is always >= 0 */ if (res == 0) { - if (!(sctx->master_access & NO_ACCESS)) // authentication is OK + if (!(thd->main_security_ctx.master_access & + NO_ACCESS)) // authentication is OK { DBUG_PRINT("info", ("Capabilities: %d packet_length: %ld Host: '%s' " "Login user: '%s' Priv_user: '%s' Using password: %s " "Access: %u db: '%s'", - thd->client_capabilities, thd->max_client_packet_length, - sctx->host_or_ip, sctx->user, sctx->priv_user, + thd->client_capabilities, + thd->max_client_packet_length, + thd->main_security_ctx.host_or_ip, + thd->main_security_ctx.user, + thd->main_security_ctx.priv_user, passwd_len ? "yes": "no", - sctx->master_access, thd->db ? thd->db : "*none*")); + thd->main_security_ctx.master_access, + (thd->db ? thd->db : "*none*"))); if (check_count) { VOID(pthread_mutex_lock(&LOCK_thread_count)); bool count_ok= thread_count <= max_connections + delayed_insert_threads - || (sctx->master_access & SUPER_ACL); + || (thd->main_security_ctx.master_access & SUPER_ACL); VOID(pthread_mutex_unlock(&LOCK_thread_count)); if (!count_ok) { // too many connections @@ -387,10 +393,12 @@ int check_user(THD *thd, enum enum_server_command command, /* Why logging is performed before all checks've passed? */ mysql_log.write(thd, command, - (sctx->priv_user == sctx->user ? + (thd->main_security_ctx.priv_user == + thd->main_security_ctx.user ? (char*) "%s@%s on %s" : (char*) "%s@%s as anonymous on %s"), - sctx->user, sctx->host_or_ip, + thd->main_security_ctx.user, + thd->main_security_ctx.host_or_ip, db ? db : (char*) ""); /* @@ -398,14 +406,16 @@ int check_user(THD *thd, enum enum_server_command command, set to 0 here because we don't have an active database yet (and we may not have an active database to set. */ - sctx->db_access=0; + thd->main_security_ctx.db_access=0; /* Don't allow user to connect if he has done too many queries */ if ((ur.questions || ur.updates || ur.conn_per_hour || ur.user_conn || max_user_connections) && get_or_create_user_conn(thd, - (opt_old_style_user_limits ? sctx->user : sctx->priv_user), - (opt_old_style_user_limits ? sctx->host_or_ip : sctx->priv_host), + (opt_old_style_user_limits ? thd->main_security_ctx.user : + thd->main_security_ctx.priv_user), + (opt_old_style_user_limits ? thd->main_security_ctx.host_or_ip : + thd->main_security_ctx.priv_host), &ur)) DBUG_RETURN(-1); if (thd->user_connect && @@ -440,12 +450,12 @@ int check_user(THD *thd, enum enum_server_command command, DBUG_RETURN(-1); } net_printf_error(thd, ER_ACCESS_DENIED_ERROR, - sctx->user, - sctx->host_or_ip, + thd->main_security_ctx.user, + thd->main_security_ctx.host_or_ip, passwd_len ? ER(ER_YES) : ER(ER_NO)); mysql_log.write(thd, COM_CONNECT, ER(ER_ACCESS_DENIED_ERROR), - sctx->user, - sctx->host_or_ip, + thd->main_security_ctx.user, + thd->main_security_ctx.host_or_ip, passwd_len ? ER(ER_YES) : ER(ER_NO)); DBUG_RETURN(-1); #endif /* NO_EMBEDDED_ACCESS_CHECKS */ @@ -765,46 +775,49 @@ static int check_connection(THD *thd) NET *net= &thd->net; ulong pkt_len= 0; char *end; - st_security_context *sctx= thd->security_ctx; DBUG_PRINT("info", ("New connection received on %s", vio_description(net->vio))); - if (!sctx->host) // If TCP/IP connection + if (!thd->main_security_ctx.host) // If TCP/IP connection { char ip[30]; if (vio_peer_addr(net->vio, ip, &thd->peer_port)) return (ER_BAD_HOST_ERROR); - if (!(sctx->ip= my_strdup(ip,MYF(0)))) + if (!(thd->main_security_ctx.ip= my_strdup(ip,MYF(0)))) return (ER_OUT_OF_RESOURCES); - sctx->host_or_ip= sctx->ip; + thd->main_security_ctx.host_or_ip= thd->main_security_ctx.ip; vio_in_addr(net->vio,&thd->remote.sin_addr); if (!(specialflag & SPECIAL_NO_RESOLVE)) { vio_in_addr(net->vio,&thd->remote.sin_addr); - sctx->host=ip_to_hostname(&thd->remote.sin_addr,&connect_errors); + thd->main_security_ctx.host= + ip_to_hostname(&thd->remote.sin_addr, &connect_errors); /* Cut very long hostnames to avoid possible overflows */ - if (sctx->host) + if (thd->main_security_ctx.host) { - if (sctx->host != my_localhost) - sctx->host[min(strlen(sctx->host), HOSTNAME_LENGTH)]= 0; - sctx->host_or_ip= sctx->host; + if (thd->main_security_ctx.host != my_localhost) + thd->main_security_ctx.host[min(strlen(thd->main_security_ctx.host), + HOSTNAME_LENGTH)]= 0; + thd->main_security_ctx.host_or_ip= thd->main_security_ctx.host; } if (connect_errors > max_connect_errors) return(ER_HOST_IS_BLOCKED); } DBUG_PRINT("info",("Host: %s ip: %s", - sctx->host ? sctx->host : "unknown host", - sctx->ip ? sctx->ip : "unknown ip")); - if (acl_check_host(sctx->host, sctx->ip)) + (thd->main_security_ctx.host ? + thd->main_security_ctx.host : "unknown host"), + (thd->main_security_ctx.ip ? + thd->main_security_ctx.ip : "unknown ip"))); + if (acl_check_host(thd->main_security_ctx.host, thd->main_security_ctx.ip)) return(ER_HOST_NOT_PRIVILEGED); } else /* Hostname given means that the connection was on a socket */ { - DBUG_PRINT("info",("Host: %s", sctx->host)); - sctx->host_or_ip= sctx->host; - sctx->ip= 0; + DBUG_PRINT("info",("Host: %s", thd->main_security_ctx.host)); + thd->main_security_ctx.host_or_ip= thd->main_security_ctx.host; + thd->main_security_ctx.ip= 0; /* Reset sin_addr */ bzero((char*) &thd->remote, sizeof(thd->remote)); } @@ -987,9 +1000,9 @@ static int check_connection(THD *thd) thd->charset(), &dummy_errors)]= '\0'; user= user_buff; - if (sctx->user) - x_free(sctx->user); - if (!(sctx->user= my_strdup(user, MYF(0)))) + if (thd->main_security_ctx.user) + x_free(thd->main_security_ctx.user); + if (!(thd->main_security_ctx.user= my_strdup(user, MYF(0)))) return (ER_OUT_OF_RESOURCES); return check_user(thd, COM_CONNECT, passwd, passwd_len, db, TRUE); } @@ -1077,7 +1090,7 @@ pthread_handler_decl(handle_one_connection,arg) { int error; NET *net= &thd->net; - st_security_context *sctx= thd->security_ctx; + Security_context *sctx= thd->security_ctx; thd->thread_stack= (char*) &thd; net->no_send_error= 0; @@ -1592,7 +1605,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, /* Save user and privileges */ uint save_db_length= thd->db_length; char *save_db= thd->db; - st_security_context save_security_ctx= *thd->security_ctx; + Security_context save_security_ctx= *thd->security_ctx; USER_CONN *save_user_connect= thd->user_connect; if (!(thd->security_ctx->user= my_strdup(user, MYF(0)))) @@ -4143,7 +4156,7 @@ end_with_restore_list: else { #ifndef NO_EMBEDDED_ACCESS_CHECKS - st_security_context *save_ctx; + Security_context *save_ctx; #endif ha_rows select_limit; /* bits that should be cleared in thd->server_status */ @@ -4807,7 +4820,7 @@ bool check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, bool dont_check_global_grants, bool no_errors, bool schema_db) { - st_security_context *sctx= thd->security_ctx; + Security_context *sctx= thd->security_ctx; #ifndef NO_EMBEDDED_ACCESS_CHECKS ulong db_access; bool db_is_pattern= test(want_access & GRANT_ACL); @@ -4838,8 +4851,8 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, { if (!no_errors) my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), - thd->security_ctx->priv_user, - thd->security_ctx->priv_host, db_name); + sctx->priv_user, + sctx->priv_host, db_name); DBUG_RETURN(TRUE); } else @@ -5245,7 +5258,7 @@ void mysql_reset_thd_for_next_command(THD *thd) thd->server_status&= ~ (SERVER_MORE_RESULTS_EXISTS | SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED); - thd->security_ctx= &thd->main_security_ctx; + DBUG_ASSERT(thd->security_ctx== &thd->main_security_ctx); thd->tmp_table_used= 0; if (!thd->in_sub_stmt) { @@ -7396,7 +7409,7 @@ Item *negate_expression(THD *thd, Item *expr) SYNOPSIS default_definer() - thd thread handler + Secytity_context current decurity context definer structure where it should be assigned RETURN @@ -7404,7 +7417,7 @@ Item *negate_expression(THD *thd, Item *expr) TRUE Error */ -bool default_view_definer(st_security_context *sctx, st_lex_user *definer) +bool default_view_definer(Security_context *sctx, st_lex_user *definer) { definer->user.str= sctx->priv_user; definer->user.length= strlen(sctx->priv_user); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 528876a6bbb..a146a489e91 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -415,7 +415,7 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list) bool mysqld_show_create_db(THD *thd, char *dbname, HA_CREATE_INFO *create_info) { - st_security_context *sctx= thd->security_ctx; + Security_context *sctx= thd->security_ctx; int length; char path[FN_REFLEN]; char buff[2048]; @@ -436,7 +436,7 @@ bool mysqld_show_create_db(THD *thd, char *dbname, } #ifndef NO_EMBEDDED_ACCESS_CHECKS - if (test_all_bits(sctx->master_access,DB_ACLS)) + if (test_all_bits(sctx->master_access, DB_ACLS)) db_access=DB_ACLS; else db_access= (acl_get(sctx->host, sctx->ip, sctx->priv_user, dbname, 0) | @@ -1186,7 +1186,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) THD *tmp; while ((tmp=it++)) { - st_security_context *tmp_sctx= tmp->security_ctx; + Security_context *tmp_sctx= tmp->security_ctx; struct st_my_thread_var *mysys_var; if ((tmp->vio_ok() || tmp->system_thread) && (!user || (tmp_sctx->user && !strcmp(tmp_sctx->user, user)))) @@ -1205,7 +1205,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) "%s:%u", tmp_sctx->host_or_ip, tmp->peer_port); } else - thd_info->host= thd->strdup(tmp_sctx->host_or_ip); + thd_info->host= thd->strdup(tmp_sctx->host); if ((thd_info->db=tmp->db)) // Safe test thd_info->db=thd->strdup(thd_info->db); thd_info->command=(int) tmp->command; @@ -1257,7 +1257,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) thread_info *thd_info; #ifndef NO_EMBEDDED_ACCESS_CHECKS - st_security_context *sctx; + Security_context *sctx; #endif time_t now= time(0); while ((thd_info=thread_infos.get())) @@ -1996,7 +1996,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) List bases; List_iterator_fast it(bases); COND *partial_cond; - st_security_context *sctx= thd->security_ctx; + Security_context *sctx= thd->security_ctx; uint derived_tables= lex->derived_tables; int error= 1; Open_tables_state open_tables_state_backup; @@ -2201,7 +2201,7 @@ int fill_schema_shemata(THD *thd, TABLE_LIST *tables, COND *cond) bool with_i_schema; HA_CREATE_INFO create; TABLE *table= tables->table; - st_security_context *sctx= thd->security_ctx; + Security_context *sctx= thd->security_ctx; DBUG_ENTER("fill_schema_shemata"); if (make_db_list(thd, &files, &idx_field_vals, diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 26f8e0dfbd9..52ac35abc19 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -6554,7 +6554,7 @@ show_param: LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_GRANTS; THD *thd= lex->thd; - st_security_context *sctx= thd->security_ctx; + Security_context *sctx= thd->security_ctx; LEX_USER *curr_user; if (!(curr_user= (LEX_USER*) thd->alloc(sizeof(st_lex_user)))) YYABORT; @@ -7464,7 +7464,7 @@ user: | CURRENT_USER optional_braces { THD *thd= YYTHD; - st_security_context *sctx= thd->security_ctx; + Security_context *sctx= thd->security_ctx; if (!($$=(LEX_USER*) thd->alloc(sizeof(st_lex_user)))) YYABORT; $$->user.str= sctx->priv_user; From a2a8216b2061de4cf0c417362aa9436787cca3cb Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Sep 2005 02:18:29 +0400 Subject: [PATCH 059/225] BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics (like 4.0 did) (patch #3, with review #1 & #2 feedback addressed) include/myisam.h: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics myisam/mi_check.c: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics myisam/myisamchk.c: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics mysql-test/r/myisam.result: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics mysql-test/t/myisam.test: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics sql/ha_myisam.cc: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics sql/handler.h: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics sql/mysqld.cc: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics sql/set_var.cc: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics sql/sql_class.h: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics --- include/myisam.h | 15 ++++++++++ myisam/mi_check.c | 30 +++++++++++-------- myisam/myisamchk.c | 27 ++++++++++++++++- mysql-test/r/myisam.result | 61 ++++++++++++++++++++++++++++++++++++++ mysql-test/t/myisam.test | 47 +++++++++++++++++++++++++++++ sql/ha_myisam.cc | 9 ++++++ sql/handler.h | 1 + sql/mysqld.cc | 28 +++++++++++++++++ sql/set_var.cc | 10 +++++++ sql/sql_class.h | 1 + 10 files changed, 215 insertions(+), 14 deletions(-) diff --git a/include/myisam.h b/include/myisam.h index 6d097770646..e276d4efdff 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -311,6 +311,20 @@ typedef struct st_sort_key_blocks /* Used when sorting */ } SORT_KEY_BLOCKS; +/* + MyISAM supports several statistics collection methods. Currently statistics + collection method is not stored in MyISAM file and has to be specified for + each table analyze/repair operation in MI_CHECK::stats_method. +*/ + +typedef enum +{ + /* Treat NULLs as inequal when collecting statistics (default for 4.1/5.0) */ + MI_STATS_METHOD_NULLS_NOT_EQUAL, + /* Treat NULLs as equal when collecting statistics (like 4.0 did) */ + MI_STATS_METHOD_NULLS_EQUAL +} enum_mi_stats_method; + typedef struct st_mi_check_param { ulonglong auto_increment_value; @@ -341,6 +355,7 @@ typedef struct st_mi_check_param void *thd; char *db_name,*table_name; char *op_name; + enum_mi_stats_method stats_method; } MI_CHECK; typedef struct st_sort_ft_buf diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 038ce8d953f..0c85b5234a1 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -80,6 +80,7 @@ void myisamchk_init(MI_CHECK *param) param->start_check_pos=0; param->max_record_length= LONGLONG_MAX; param->key_cache_block_size= KEY_CACHE_BLOCK_SIZE; + param->stats_method= MI_STATS_METHOD_NULLS_NOT_EQUAL; } /* Check the status flags for the table */ @@ -558,10 +559,11 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, ha_checksum *key_checksum, uint level) { int flag; - uint used_length,comp_flag,nod_flag,key_length=0,not_used; + uint used_length,comp_flag,nod_flag,key_length=0; uchar key[MI_MAX_POSSIBLE_KEY_BUFF],*temp_buff,*keypos,*old_keypos,*endpos; my_off_t next_page,record; char llbuff[22]; + uint diff_pos; DBUG_ENTER("chk_index"); DBUG_DUMP("buff",(byte*) buff,mi_getint(buff)); @@ -619,7 +621,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, } if ((*keys)++ && (flag=ha_key_cmp(keyinfo->seg,info->lastkey,key,key_length, - comp_flag, ¬_used)) >=0) + comp_flag, &diff_pos)) >=0) { DBUG_DUMP("old",(byte*) info->lastkey, info->lastkey_length); DBUG_DUMP("new",(byte*) key, key_length); @@ -635,11 +637,11 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, { if (*keys != 1L) /* not first_key */ { - uint diff; - ha_key_cmp(keyinfo->seg,info->lastkey,key,USE_WHOLE_KEY, - SEARCH_FIND | SEARCH_NULL_ARE_NOT_EQUAL, - &diff); - param->unique_count[diff-1]++; + if (param->stats_method == MI_STATS_METHOD_NULLS_NOT_EQUAL) + ha_key_cmp(keyinfo->seg,info->lastkey,key,USE_WHOLE_KEY, + SEARCH_FIND | SEARCH_NULL_ARE_NOT_EQUAL, + &diff_pos); + param->unique_count[diff_pos-1]++; } } (*key_checksum)+= mi_byte_checksum((byte*) key, @@ -2013,7 +2015,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, sort_param.sort_info=&sort_info; sort_param.fix_datafile= (my_bool) (! rep_quick); sort_param.master =1; - + del=info->state->del; param->glob_crc=0; if (param->testflag & T_CALC_CHECKSUM) @@ -3249,9 +3251,10 @@ static int sort_key_write(MI_SORT_PARAM *sort_param, const void *a) cmp=ha_key_cmp(sort_param->seg,sort_info->key_block->lastkey, (uchar*) a, USE_WHOLE_KEY,SEARCH_FIND | SEARCH_UPDATE, &diff_pos); - ha_key_cmp(sort_param->seg,sort_info->key_block->lastkey, - (uchar*) a, USE_WHOLE_KEY,SEARCH_FIND | SEARCH_NULL_ARE_NOT_EQUAL, - &diff_pos); + if (param->stats_method == MI_STATS_METHOD_NULLS_NOT_EQUAL) + ha_key_cmp(sort_param->seg,sort_info->key_block->lastkey, + (uchar*) a, USE_WHOLE_KEY, + SEARCH_FIND | SEARCH_NULL_ARE_NOT_EQUAL, &diff_pos); sort_param->unique[diff_pos-1]++; } else @@ -3989,9 +3992,10 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, unique[0]= (#different values of {keypart1}) - 1 unique[1]= (#different values of {keypart2,keypart1} tuple) - unique[0] - 1 ... - Here we assume that NULL != NULL (see SEARCH_NULL_ARE_NOT_EQUAL). The - 'unique' array is collected in one sequential scan through the entire + The 'unique' array is collected in one sequential scan through the entire index. This is done in two places: in chk_index() and in sort_key_write(). + Statistics collection may consider NULLs as either equal or inequal (see + SEARCH_NULL_ARE_NOT_EQUAL, MI_STATS_METHOD_*). Output is an array: rec_per_key_part[k] = diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index 3b9742b79fb..1a7d2b2d9a8 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -67,6 +67,7 @@ static const char *field_pack[]= "no zeros", "blob", "constant", "table-lockup", "always zero","varchar","unique-hash","?","?"}; +static const char *myisam_stats_method_str="nulls_inequal"; static void get_options(int *argc,char * * *argv); static void print_version(void); @@ -155,7 +156,7 @@ enum options_mc { OPT_READ_BUFFER_SIZE, OPT_WRITE_BUFFER_SIZE, OPT_SORT_BUFFER_SIZE, OPT_SORT_KEY_BLOCKS, OPT_DECODE_BITS, OPT_FT_MIN_WORD_LEN, OPT_FT_MAX_WORD_LEN, OPT_FT_STOPWORD_FILE, - OPT_MAX_RECORD_LENGTH, OPT_AUTO_CLOSE + OPT_MAX_RECORD_LENGTH, OPT_AUTO_CLOSE, OPT_STATS_METHOD }; static struct my_option my_long_options[] = @@ -336,6 +337,11 @@ static struct my_option my_long_options[] = "Use stopwords from this file instead of built-in list.", (gptr*) &ft_stopword_file, (gptr*) &ft_stopword_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"stats_method", OPT_STATS_METHOD, + "Specifies how index statistics collection code should threat NULLs. " + "Possible values of name are \"nulls_inequal\" (default behavior for 4.1/5.0), and \"nulls_equal\" (emulate 4.0 behavior).", + (gptr*) &myisam_stats_method_str, (gptr*) &myisam_stats_method_str, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -465,6 +471,12 @@ static void usage(void) #include +const char *myisam_stats_method_names[] = {"nulls_inequal", "nulls_equal", + NullS}; +TYPELIB myisam_stats_method_typelib= { + array_elements(myisam_stats_method_names) - 1, "", + myisam_stats_method_names, NULL}; + /* Read options */ static my_bool @@ -684,6 +696,19 @@ get_one_option(int optid, else check_param.testflag|= T_CALC_CHECKSUM; break; + case OPT_STATS_METHOD: + { + myisam_stats_method_str= argument; + int method; + if ((method=find_type(argument, &myisam_stats_method_typelib, 2)) <= 0) + { + fprintf(stderr, "Invalid value of stats_method: %s.\n", argument); + exit(1); + } + check_param.stats_method= test(method-1)? MI_STATS_METHOD_NULLS_EQUAL : + MI_STATS_METHOD_NULLS_NOT_EQUAL; + break; + } #ifdef DEBUG /* Only useful if debugging */ case OPT_START_CHECK_POS: check_param.start_check_pos= strtoull(argument, NULL, 0); diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 1837a4078a7..b3144a6903b 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -609,3 +609,64 @@ checksum table t2; Table Checksum test.t2 984116287 drop table t1, t2; +show variables like 'myisam_stats_method'; +Variable_name Value +myisam_stats_method nulls_inequal +create table t1 (a int, key(a)); +insert into t1 values (0),(1),(2),(3),(4); +insert into t1 select NULL from t1; +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +show index from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 a 1 a A 10 NULL NULL YES BTREE +insert into t1 values (11); +delete from t1 where a=11; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +show index from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 a 1 a A 10 NULL NULL YES BTREE +set myisam_stats_method=nulls_equal; +show variables like 'myisam_stats_method'; +Variable_name Value +myisam_stats_method nulls_equal +insert into t1 values (11); +delete from t1 where a=11; +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +show index from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 a 1 a A 5 NULL NULL YES BTREE +insert into t1 values (11); +delete from t1 where a=11; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +show index from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 a 1 a A 5 NULL NULL YES BTREE +set myisam_stats_method=DEFAULT; +show variables like 'myisam_stats_method'; +Variable_name Value +myisam_stats_method nulls_inequal +insert into t1 values (11); +delete from t1 where a=11; +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +show index from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 a 1 a A 10 NULL NULL YES BTREE +insert into t1 values (11); +delete from t1 where a=11; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +show index from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 a 1 a A 10 NULL NULL YES BTREE +drop table t1; diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 83e9e1ba7d2..dc40ecc2dd4 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -590,4 +590,51 @@ checksum table t1; checksum table t2; drop table t1, t2; +# BUG#12232: New myisam_stats_method variable. +show variables like 'myisam_stats_method'; + +create table t1 (a int, key(a)); +insert into t1 values (0),(1),(2),(3),(4); +insert into t1 select NULL from t1; + +# default: NULLs considered inequal +analyze table t1; +show index from t1; +insert into t1 values (11); +delete from t1 where a=11; +check table t1; +show index from t1; + +# Set nulls to be equal: +set myisam_stats_method=nulls_equal; +show variables like 'myisam_stats_method'; +insert into t1 values (11); +delete from t1 where a=11; + +analyze table t1; +show index from t1; + +insert into t1 values (11); +delete from t1 where a=11; + +check table t1; +show index from t1; + +# Set nulls back to be equal +set myisam_stats_method=DEFAULT; +show variables like 'myisam_stats_method'; +insert into t1 values (11); +delete from t1 where a=11; + +analyze table t1; +show index from t1; + +insert into t1 values (11); +delete from t1 where a=11; + +check table t1; +show index from t1; + +drop table t1; + # End of 4.1 tests diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index d8608c6a599..615cecb7a19 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -39,6 +39,12 @@ const char *myisam_recover_names[] = TYPELIB myisam_recover_typelib= {array_elements(myisam_recover_names)-1,"", myisam_recover_names, NULL}; +const char *myisam_stats_method_names[] = {"nulls_inequal", "nulls_equal", + NullS}; +TYPELIB myisam_stats_method_typelib= { + array_elements(myisam_stats_method_names) - 1, "", + myisam_stats_method_names, NULL}; + /***************************************************************************** ** MyISAM tables @@ -278,6 +284,7 @@ int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt) param.db_name = table->table_cache_key; param.table_name = table->table_name; param.testflag = check_opt->flags | T_CHECK | T_SILENT; + param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method; if (!(table->db_stat & HA_READ_ONLY)) param.testflag|= T_STATISTICS; @@ -367,6 +374,7 @@ int ha_myisam::analyze(THD *thd, HA_CHECK_OPT* check_opt) param.testflag=(T_FAST | T_CHECK | T_SILENT | T_STATISTICS | T_DONT_CHECK_CHECKSUM); param.using_global_keycache = 1; + param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method; if (!(share->state.changed & STATE_NOT_ANALYZED)) return HA_ADMIN_ALREADY_DONE; @@ -920,6 +928,7 @@ int ha_myisam::enable_indexes(uint mode) T_CREATE_MISSING_KEYS); param.myf_rw&= ~MY_WAIT_IF_FULL; param.sort_buffer_length= thd->variables.myisam_sort_buff_size; + param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method; param.tmpdir=&mysql_tmpdir_list; if ((error= (repair(thd,param,0) != HA_ADMIN_OK)) && param.retry_repair) { diff --git a/sql/handler.h b/sql/handler.h index b69eec3edd5..d4bb19dd7b2 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -522,6 +522,7 @@ public: extern struct show_table_type_st sys_table_types[]; extern const char *ha_row_type[]; extern TYPELIB tx_isolation_typelib; +extern TYPELIB myisam_stats_method_typelib; /* Wrapper functions */ #define ha_commit_stmt(thd) (ha_commit_trans((thd), &((thd)->transaction.stmt))) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 8db4b27169a..0cde42f37d7 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -369,6 +369,7 @@ char *mysqld_unix_port, *opt_mysql_tmpdir; char *my_bind_addr_str; const char **errmesg; /* Error messages */ const char *myisam_recover_options_str="OFF"; +const char *myisam_stats_method_str="nulls_inequal"; const char *sql_mode_str="OFF"; /* name of reference on left espression in rewritten IN subquery */ const char *in_left_expr_name= ""; @@ -4169,6 +4170,7 @@ enum options_mysqld OPT_MAX_ERROR_COUNT, OPT_MYISAM_DATA_POINTER_SIZE, OPT_MYISAM_BLOCK_SIZE, OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE, OPT_MYISAM_MAX_SORT_FILE_SIZE, OPT_MYISAM_SORT_BUFFER_SIZE, + OPT_MYISAM_STATS_METHOD, OPT_NET_BUFFER_LENGTH, OPT_NET_RETRY_COUNT, OPT_NET_READ_TIMEOUT, OPT_NET_WRITE_TIMEOUT, OPT_OPEN_FILES_LIMIT, @@ -5208,6 +5210,11 @@ The minimum value for this variable is 4096.", (gptr*) &global_system_variables.myisam_sort_buff_size, (gptr*) &max_system_variables.myisam_sort_buff_size, 0, GET_ULONG, REQUIRED_ARG, 8192*1024, 4, ~0L, 0, 1, 0}, + {"myisam_stats_method", OPT_MYISAM_STATS_METHOD, + "Specifies how MyISAM index statistics collection code should threat NULLs. " + "Possible values of name are \"nulls_inequal\" (default behavior for 4.1/5.0), and \"nulls_equal\" (emulate 4.0 behavior).", + (gptr*) &myisam_stats_method_str, (gptr*) &myisam_stats_method_str, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"net_buffer_length", OPT_NET_BUFFER_LENGTH, "Buffer length for TCP/IP and socket communication.", (gptr*) &global_system_variables.net_buffer_length, @@ -5759,6 +5766,7 @@ static void mysql_init_variables(void) query_id= thread_id= 1L; strmov(server_version, MYSQL_SERVER_VERSION); myisam_recover_options_str= sql_mode_str= "OFF"; + myisam_stats_method_str= "nulls_inequal"; my_bind_addr = htonl(INADDR_ANY); threads.empty(); thread_cache.empty(); @@ -5807,6 +5815,12 @@ static void mysql_init_variables(void) global_system_variables.max_join_size= (ulonglong) HA_POS_ERROR; max_system_variables.max_join_size= (ulonglong) HA_POS_ERROR; global_system_variables.old_passwords= 0; + + /* + Default behavior for 4.1 and 5.0 is to treat NULL values as inequal + when collecting index statistics for MyISAM tables. + */ + global_system_variables.myisam_stats_method= MI_STATS_METHOD_NULLS_NOT_EQUAL; /* Variables that depends on compile options */ #ifndef DBUG_OFF @@ -6388,6 +6402,20 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ha_open_options|=HA_OPEN_ABORT_IF_CRASHED; break; } + case OPT_MYISAM_STATS_METHOD: + { + myisam_stats_method_str= argument; + int method; + if ((method=find_type(argument, &myisam_stats_method_typelib, 2)) <= 0) + { + fprintf(stderr, "Invalid value of myisam_stats_method: %s.\n", argument); + exit(1); + } + global_system_variables.myisam_stats_method= + test(method-1)? MI_STATS_METHOD_NULLS_EQUAL : + MI_STATS_METHOD_NULLS_NOT_EQUAL; + break; + } case OPT_SQL_MODE: { sql_mode_str= argument; diff --git a/sql/set_var.cc b/sql/set_var.cc index 94968f664fd..e10bfda62b7 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -256,6 +256,12 @@ sys_var_thd_ulonglong sys_myisam_max_extra_sort_file_size("myisam_max_extra_sort sys_var_thd_ulonglong sys_myisam_max_sort_file_size("myisam_max_sort_file_size", &SV::myisam_max_sort_file_size, fix_myisam_max_sort_file_size, 1); sys_var_thd_ulong sys_myisam_repair_threads("myisam_repair_threads", &SV::myisam_repair_threads); sys_var_thd_ulong sys_myisam_sort_buffer_size("myisam_sort_buffer_size", &SV::myisam_sort_buff_size); + +sys_var_thd_enum sys_myisam_stats_method("myisam_stats_method", + &SV::myisam_stats_method, + &myisam_stats_method_typelib, + NULL); + sys_var_thd_ulong sys_net_buffer_length("net_buffer_length", &SV::net_buffer_length); sys_var_thd_ulong sys_net_read_timeout("net_read_timeout", @@ -574,6 +580,7 @@ sys_var *sys_variables[]= &sys_myisam_max_sort_file_size, &sys_myisam_repair_threads, &sys_myisam_sort_buffer_size, + &sys_myisam_stats_method, &sys_net_buffer_length, &sys_net_read_timeout, &sys_net_retry_count, @@ -810,6 +817,9 @@ struct show_var_st init_vars[]= { {sys_myisam_repair_threads.name, (char*) &sys_myisam_repair_threads, SHOW_SYS}, {sys_myisam_sort_buffer_size.name, (char*) &sys_myisam_sort_buffer_size, SHOW_SYS}, + + {sys_myisam_stats_method.name, (char*) &sys_myisam_stats_method, SHOW_SYS}, + #ifdef __NT__ {"named_pipe", (char*) &opt_enable_named_pipe, SHOW_MY_BOOL}, #endif diff --git a/sql/sql_class.h b/sql/sql_class.h index bc651b32d94..41170192892 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -363,6 +363,7 @@ struct system_variables ulong max_insert_delayed_threads; ulong myisam_repair_threads; ulong myisam_sort_buff_size; + ulong myisam_stats_method; ulong net_buffer_length; ulong net_interactive_timeout; ulong net_read_timeout; From f679e33cf98a7ebd57bb1d4bd3a0eae78def5e5f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Sep 2005 15:26:10 -0700 Subject: [PATCH 060/225] Fixed a typo in handler.cc if CSV was built. I also added CSV to the default MAX builds so that more people test it. BUILD/SETUP.sh: Adding CVS engine to default max builds. sql/handler.cc: Fixed typo --- BUILD/SETUP.sh | 5 ++--- sql/handler.cc | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 1bf3bad5abe..4c8a8839bdf 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -52,9 +52,8 @@ global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wch #debug_extra_warnings="-Wuninitialized" c_warnings="$global_warnings -Wunused" cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" - -base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine" -max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-openssl --with-embedded-server --with-big-tables" +base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine" +max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --with-openssl --with-embedded-server --with-big-tables" max_configs="$base_max_configs --with-embedded-server" path=`dirname $0` diff --git a/sql/handler.cc b/sql/handler.cc index 34ce7e60eba..5f8fa33fecc 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -511,7 +511,7 @@ int ha_init() break; #endif #ifdef HAVE_CSV_DB - case DB_TYPE_CSV_DB,: + case DB_TYPE_CSV_DB: types->ht= &tina_hton; break; #endif From 21a62eb1c6a281b72c24bb9a7d5af702a5b3d8d5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Sep 2005 08:29:47 +0300 Subject: [PATCH 061/225] postmerge fixes libmysqld/lib_sql.cc: struct st_security_context nad to class Security_context sql/item_func.cc: fixed method call, name and contence to be compatible with new code sql/item_func.h: fixed method to be compatible wit new code sql/sql_parse.cc: fixed typo removed compiler warnings --- libmysqld/lib_sql.cc | 2 +- sql/item_func.cc | 70 ++++++++++++++++++-------------------------- sql/item_func.h | 3 +- sql/sql_parse.cc | 10 +++---- 4 files changed, 36 insertions(+), 49 deletions(-) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index d6f41fda5f6..99761ceb8c7 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -532,7 +532,7 @@ err: int check_embedded_connection(MYSQL *mysql) { THD *thd= (THD*)mysql->thd; - st_security_context *sctx= thd->security_ctx; + Security_context *sctx= thd->security_ctx; sctx->host_or_ip= sctx->host= (char*)my_localhost; sctx->priv_user= sctx->user= my_strdup(mysql->user, MYF(0)); return check_user(thd, COM_CONNECT, NULL, 0, thd->db, true); diff --git a/sql/item_func.cc b/sql/item_func.cc index 4fbc60014f3..265eb28bba8 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4711,21 +4711,11 @@ Item_func_sp::execute(Item **itp) THD *thd= current_thd; int res= -1; Sub_statement_state statement_state; - -#ifndef NO_EMBEDDED_ACCESS_CHECKS Security_context *save_ctx; -#endif - if (! m_sp && ! (m_sp= sp_find_function(thd, m_name, TRUE))) - { - my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", m_name->m_qname.str); + if (find_and_check_access(thd, EXECUTE_ACL, &save_ctx)) goto error; - } -#ifndef NO_EMBEDDED_ACCESS_CHECKS - if (check_access(EXECUTE_ACL, 0, &save_ctx)) - goto error; -#endif /* Disable the binlogging if this is not a SELECT statement. If this is a SELECT, leave binlogging on, so execute_function() code writes the @@ -4734,7 +4724,7 @@ Item_func_sp::execute(Item **itp) thd->reset_sub_statement_state(&statement_state, SUB_STMT_FUNCTION); res= m_sp->execute_function(thd, args, arg_count, itp); thd->restore_sub_statement_state(&statement_state); - + if (res && mysql_bin_log.is_open() && (m_sp->m_chistics->daccess == SP_CONTAINS_SQL || m_sp->m_chistics->daccess == SP_MODIFIES_SQL_DATA)) @@ -4851,71 +4841,67 @@ Item_func_sp::tmp_table_field(TABLE *t_arg) DBUG_RETURN(res); } + /* - Check access rigths to function + Find the function and chack access rigths to the function SYNOPSIS - check_access() + find_and_check_access() + thd thread handler want_access requested access - report_error whether to set error to thd->net.report_error - sp_ctx sp security context for switching + backup backup of security context or 0 RETURN - 0 Access granted - 1 Requested access can't be granted or function doesn't exists + FALSE Access granted + TRUE Requested access can't be granted or function doesn't exists NOTES Checks if requested access to function can be granted to user. If function isn't found yet, it searches function first. If function can't be found or user don't have requested access - and report_error is true error is raised. + error is raised. If security context sp_ctx is provided and access can be granted then switch back to previous context isn't performed. - In case of access error or if context is not provided then check_access() - switches back to previous security context. + In case of access error or if context is not provided then + find_and_check_access() switches back to previous security context. */ + bool -Item_func_sp::check_access(ulong want_access, bool report_error, st_sp_security_context *sp_ctx) +Item_func_sp::find_and_check_access(THD *thd, ulong want_access, + Security_context **backup) { bool res; -#ifndef NO_EMBEDDED_ACCESS_CHECKS - THD *thd= current_thd; - st_sp_security_context save_ctx, *curr_ctx= sp_ctx?sp_ctx:&save_ctx; - bool ctx_switched= 0; - res= 1; + Security_context *local_save, + **save= (backup ? backup : &local_save); + res= TRUE; if (! m_sp && ! (m_sp= sp_find_function(thd, m_name, TRUE))) { my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", m_name->m_qname.str); - if (report_error) - thd->net.report_error= 1; goto error; } +#ifndef NO_EMBEDDED_ACCESS_CHECKS if (check_routine_access(thd, want_access, - m_sp->m_db.str, m_sp->m_name.str, 0, 0)) + m_sp->m_db.str, m_sp->m_name.str, 0, FALSE)) { - if (report_error) - thd->net.report_error= 1; goto error; } - sp_change_security_context(thd, m_sp, curr_ctx); - ctx_switched= curr_ctx->changed; - if (curr_ctx->changed && + sp_change_security_context(thd, m_sp, save); + if (*save && check_routine_access(thd, want_access, - m_sp->m_db.str, m_sp->m_name.str, 0, 0)) + m_sp->m_db.str, m_sp->m_name.str, 0, FALSE)) { - if (report_error) - thd->net.report_error= 1; goto error_check_ctx; } - res= 0; + res= FALSE; error_check_ctx: - if (ctx_switched && (res || !sp_ctx)) - sp_restore_security_context(thd, m_sp, curr_ctx); + if (*save && (res || !backup)) + sp_restore_security_context(thd, local_save); error: #else res= 0; +error: #endif return res; }; @@ -4926,7 +4912,7 @@ Item_func_sp::fix_fields(THD *thd, Item **ref) bool res; DBUG_ASSERT(fixed == 0); res= Item_func::fix_fields(thd, ref); - if (!res && check_access(EXECUTE_ACL, 1, NULL)) + if (!res && find_and_check_access(thd, EXECUTE_ACL, NULL)) res= 1; return res; } diff --git a/sql/item_func.h b/sql/item_func.h index adc1dd1b1be..de4d60e9cbb 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1435,7 +1435,8 @@ public: { context= (Name_resolution_context *)cntx; return FALSE; } void fix_length_and_dec(); - bool check_access(ulong want_access, bool report_error, st_sp_security_context *sp_ctx); + bool find_and_check_access(THD * thd, ulong want_access, + Security_context **backup); virtual enum Functype functype() const { return FUNC_SP; } bool fix_fields(THD *thd, Item **ref); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 8f259b21919..d361b9343f1 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -273,7 +273,7 @@ int check_user(THD *thd, enum enum_server_command command, DBUG_ENTER("check_user"); #ifdef NO_EMBEDDED_ACCESS_CHECKS - thd->ain_security_ctx.master_access= GLOBAL_ACLS; // Full rights + thd->main_security_ctx.master_access= GLOBAL_ACLS; // Full rights /* Change database if necessary */ if (db && db[0]) { @@ -4490,10 +4490,10 @@ end_with_restore_list: mysql_bin_log.is_open()) { String buff; - LEX_STRING command[3]= - {{STRING_WITH_LEN("CREATE ")}, - {STRING_WITH_LEN("ALTER ")}, - {STRING_WITH_LEN("CREATE OR REPLACE ")}}; + const LEX_STRING command[3]= + {{(char *)STRING_WITH_LEN("CREATE ")}, + {(char *)STRING_WITH_LEN("ALTER ")}, + {(char *)STRING_WITH_LEN("CREATE OR REPLACE ")}}; thd->clear_error(); buff.append(command[thd->lex->create_view_mode].str, From 8e7217e43bed6db3bffd97a39b85c65e1a72579a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Sep 2005 09:49:19 +0300 Subject: [PATCH 062/225] Fix for BUG#12882 - min/max inconsistent on empty table. The problem was in that the MIN/MAX optimization in opt_sum_query was replacing MIN/MAX functions with their constant argument without taking into account that a query has no result rows. mysql-test/r/func_group.result: Test for BUG#12882. mysql-test/t/func_group.test: Test for BUG#12882. sql/item_sum.cc: If it is known that a query has no result rows, do not call add() via the call to Item_sum::no_rows_in_result() which calls reset(). Instead directly call clear() so that the MIN and MAX functions produce NULL when there are no result rows. sql/opt_sum.cc: * Do not apply MIN/MAX optimization when the operand of MIN/MAX is a constant if it can't be determined whether the query has any result rows. The reason is that if the query has result rows, then the result of MIN/MAX is its constant argument, but if the query result is empty, then the result of MIN/MAX must be NULL irrespective of its argument. * The patch also simplifies a bit the branch that hadles COUNT(). --- mysql-test/r/func_group.result | 136 +++++++++++++++++++++++++++++++++ mysql-test/t/func_group.test | 69 +++++++++++++++++ sql/item_sum.cc | 2 +- sql/opt_sum.cc | 96 ++++++++++++++++------- 4 files changed, 273 insertions(+), 30 deletions(-) diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 2fb18ca92c7..67966b999d4 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -780,3 +780,139 @@ SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6; MAX(id) NULL DROP TABLE t1; +create table t1m (a int) engine=myisam; +create table t1i (a int) engine=innodb; +create table t2m (a int) engine=myisam; +create table t2i (a int) engine=innodb; +insert into t2m values (5); +insert into t2i values (5); +select min(a) from t1m; +min(a) +NULL +select min(7) from t1m; +min(7) +NULL +select min(7) from DUAL; +min(7) +NULL +explain select min(7) from t2m join t1m; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(7) from t2m join t1m; +min(7) +NULL +select max(a) from t1m; +max(a) +NULL +select max(7) from t1m; +max(7) +NULL +select max(7) from DUAL; +max(7) +NULL +explain select max(7) from t2m join t1m; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select max(7) from t2m join t1m; +max(7) +NULL +select 1, min(a) from t1m where a=99; +1 min(a) +1 NULL +select 1, min(a) from t1m where 1=99; +1 min(a) +1 NULL +select 1, min(1) from t1m where a=99; +1 min(1) +select 1, min(1) from t1m where 1=99; +1 min(1) +1 NULL +select 1, max(a) from t1m where a=99; +1 max(a) +1 NULL +select 1, max(a) from t1m where 1=99; +1 max(a) +1 NULL +select 1, max(1) from t1m where a=99; +1 max(1) +select 1, max(1) from t1m where 1=99; +1 max(1) +1 NULL +select min(a) from t1i; +min(a) +NULL +select min(7) from t1i; +min(7) +NULL +select min(7) from DUAL; +min(7) +NULL +explain select min(7) from t2i join t1i; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2i ALL NULL NULL NULL NULL 1 +1 SIMPLE t1i ALL NULL NULL NULL NULL 1 +select min(7) from t2i join t1i; +min(7) +NULL +select max(a) from t1i; +max(a) +NULL +select max(7) from t1i; +max(7) +NULL +select max(7) from DUAL; +max(7) +NULL +explain select max(7) from t2i join t1i; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2i ALL NULL NULL NULL NULL 1 +1 SIMPLE t1i ALL NULL NULL NULL NULL 1 +select max(7) from t2i join t1i; +max(7) +NULL +select 1, min(a) from t1i where a=99; +1 min(a) +1 NULL +select 1, min(a) from t1i where 1=99; +1 min(a) +1 NULL +select 1, min(1) from t1i where a=99; +1 min(1) +1 NULL +select 1, min(1) from t1i where 1=99; +1 min(1) +1 NULL +select 1, max(a) from t1i where a=99; +1 max(a) +1 NULL +select 1, max(a) from t1i where 1=99; +1 max(a) +1 NULL +select 1, max(1) from t1i where a=99; +1 max(1) +1 NULL +select 1, max(1) from t1i where 1=99; +1 max(1) +1 NULL +explain select count(*), min(7), max(7) from t1m, t1i; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1m system NULL NULL NULL NULL 0 const row not found +1 SIMPLE t1i ALL NULL NULL NULL NULL 1 +select count(*), min(7), max(7) from t1m, t1i; +count(*) min(7) max(7) +0 NULL NULL +explain select count(*), min(7), max(7) from t1m, t2i; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1m system NULL NULL NULL NULL 0 const row not found +1 SIMPLE t2i ALL NULL NULL NULL NULL 1 +select count(*), min(7), max(7) from t1m, t2i; +count(*) min(7) max(7) +0 NULL NULL +explain select count(*), min(7), max(7) from t2m, t1i; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2m system NULL NULL NULL NULL 1 +1 SIMPLE t1i ALL NULL NULL NULL NULL 1 +select count(*), min(7), max(7) from t2m, t1i; +count(*) min(7) max(7) +0 NULL NULL +drop table t1m, t1i, t2m, t2i; diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 4dc8d66c4f1..f833f482f73 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -527,4 +527,73 @@ INSERT INTO t1 VALUES SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6; DROP TABLE t1; +# +# Bug #12882 min/max inconsistent on empty table +# + +create table t1m (a int) engine=myisam; +create table t1i (a int) engine=innodb; +create table t2m (a int) engine=myisam; +create table t2i (a int) engine=innodb; +insert into t2m values (5); +insert into t2i values (5); + +# test with MyISAM +select min(a) from t1m; +select min(7) from t1m; +select min(7) from DUAL; +explain select min(7) from t2m join t1m; +select min(7) from t2m join t1m; + +select max(a) from t1m; +select max(7) from t1m; +select max(7) from DUAL; +explain select max(7) from t2m join t1m; +select max(7) from t2m join t1m; + +select 1, min(a) from t1m where a=99; +select 1, min(a) from t1m where 1=99; +select 1, min(1) from t1m where a=99; +select 1, min(1) from t1m where 1=99; + +select 1, max(a) from t1m where a=99; +select 1, max(a) from t1m where 1=99; +select 1, max(1) from t1m where a=99; +select 1, max(1) from t1m where 1=99; + +# test with InnoDB +select min(a) from t1i; +select min(7) from t1i; +select min(7) from DUAL; +explain select min(7) from t2i join t1i; +select min(7) from t2i join t1i; + +select max(a) from t1i; +select max(7) from t1i; +select max(7) from DUAL; +explain select max(7) from t2i join t1i; +select max(7) from t2i join t1i; + +select 1, min(a) from t1i where a=99; +select 1, min(a) from t1i where 1=99; +select 1, min(1) from t1i where a=99; +select 1, min(1) from t1i where 1=99; + +select 1, max(a) from t1i where a=99; +select 1, max(a) from t1i where 1=99; +select 1, max(1) from t1i where a=99; +select 1, max(1) from t1i where 1=99; + +# mixed MyISAM/InnoDB test +explain select count(*), min(7), max(7) from t1m, t1i; +select count(*), min(7), max(7) from t1m, t1i; + +explain select count(*), min(7), max(7) from t1m, t2i; +select count(*), min(7), max(7) from t1m, t2i; + +explain select count(*), min(7), max(7) from t2m, t1i; +select count(*), min(7), max(7) from t2m, t1i; + +drop table t1m, t1i, t2m, t2i; + # End of 4.1 tests diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 6ae782db557..43468adea1a 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -552,8 +552,8 @@ void Item_sum_hybrid::cleanup() void Item_sum_hybrid::no_rows_in_result() { - Item_sum::no_rows_in_result(); was_values= FALSE; + clear(); } diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index 4ab506cc4e1..3d88d85af87 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -59,8 +59,8 @@ static int maxmin_in_range(bool max_fl, Field* field, COND *cond); SYNOPSIS opt_sum_query() - tables Tables in query - all_fields All fields to be returned + tables Tables in query + all_fields All fields to be returned conds WHERE clause NOTE: @@ -80,6 +80,8 @@ int opt_sum_query(TABLE_LIST *tables, List &all_fields,COND *conds) List_iterator_fast it(all_fields); int const_result= 1; bool recalc_const_item= 0; + longlong count= 1; + bool is_exact_count= TRUE; table_map removed_tables= 0, outer_tables= 0, used_tables= 0; table_map where_tables= 0; Item *item; @@ -88,9 +90,13 @@ int opt_sum_query(TABLE_LIST *tables, List &all_fields,COND *conds) if (conds) where_tables= conds->used_tables(); - /* Don't replace expression on a table that is part of an outer join */ + /* + Analyze outer join dependencies, and, if possible, compute the number + of returned rows. + */ for (TABLE_LIST *tl=tables; tl ; tl= tl->next) { + /* Don't replace expression on a table that is part of an outer join */ if (tl->on_expr) { outer_tables|= tl->table->map; @@ -102,15 +108,31 @@ int opt_sum_query(TABLE_LIST *tables, List &all_fields,COND *conds) WHERE t2.field IS NULL; */ if (tl->table->map & where_tables) - return 0; + const_result= 0; } else used_tables|= tl->table->map; + + /* + If the storage manager of 'tl' gives exact row count, compute the total + number of rows. If there are no outer table dependencies, this count + may be used as the real count. + */ + if (tl->table->file->table_flags() & HA_NOT_EXACT_COUNT) + is_exact_count= FALSE; + else + { + tl->table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK); + count*= tl->table->file->records; + } } + if (!const_result) + return 0; + /* - Iterate through item is select part and replace COUNT(), MIN() and MAX() - with constants (if possible) + Iterate through all items in the SELECT clause and replace + COUNT(), MIN() and MAX() with constants (if possible). */ while ((item= it++)) @@ -122,28 +144,14 @@ int opt_sum_query(TABLE_LIST *tables, List &all_fields,COND *conds) case Item_sum::COUNT_FUNC: /* If the expr in count(expr) can never be null we can change this - to the number of rows in the tables + to the number of rows in the tables if this number is exact and + there are no outer joins. */ - if (!conds && !((Item_sum_count*) item)->args[0]->maybe_null) + if (!conds && !((Item_sum_count*) item)->args[0]->maybe_null && + !outer_tables && is_exact_count) { - longlong count= 1; - TABLE_LIST *table; - for (table=tables ; table ; table=table->next) - { - if (outer_tables || (table->table->file->table_flags() & - HA_NOT_EXACT_COUNT)) - { - const_result= 0; // Can't optimize left join - break; - } - tables->table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK); - count*= table->table->file->records; - } - if (!table) - { ((Item_sum_count*) item)->make_const(count); recalc_const_item= 1; - } } else const_result= 0; @@ -210,12 +218,27 @@ int opt_sum_query(TABLE_LIST *tables, List &all_fields,COND *conds) } removed_tables|= table->map; } - else if (!expr->const_item()) // This is VERY seldom false + else if (!expr->const_item() || !is_exact_count) { + /* + The optimization is not applicable in both cases: + (a) 'expr' is a non-constant expression. Then we can't + replace 'expr' by a constant. + (b) 'expr' is a costant. According to ANSI, MIN/MAX must return + NULL if the query does not return any rows. Thus, if we are not + able to determine if the query returns any rows, we can't apply + the optimization and replace MIN/MAX with a constant. + */ const_result= 0; break; } - ((Item_sum_min*) item_sum)->reset(); + if (!count) + { + /* If count != 1, then we know that is_exact_count == TRUE. */ + ((Item_sum_min*) item_sum)->clear(); /* Set to NULL. */ + } + else + ((Item_sum_min*) item_sum)->reset(); /* Set to the constant value. */ ((Item_sum_min*) item_sum)->make_const(); recalc_const_item= 1; break; @@ -282,13 +305,28 @@ int opt_sum_query(TABLE_LIST *tables, List &all_fields,COND *conds) } removed_tables|= table->map; } - else if (!expr->const_item()) // This is VERY seldom false + else if (!expr->const_item() || !is_exact_count) { + /* + The optimization is not applicable in both cases: + (a) 'expr' is a non-constant expression. Then we can't + replace 'expr' by a constant. + (b) 'expr' is a costant. According to ANSI, MIN/MAX must return + NULL if the query does not return any rows. Thus, if we are not + able to determine if the query returns any rows, we can't apply + the optimization and replace MIN/MAX with a constant. + */ const_result= 0; break; } - ((Item_sum_min*) item_sum)->reset(); - ((Item_sum_min*) item_sum)->make_const(); + if (!count) + { + /* If count != 1, then we know that is_exact_count == TRUE. */ + ((Item_sum_max*) item_sum)->clear(); /* Set to NULL. */ + } + else + ((Item_sum_max*) item_sum)->reset(); /* Set to the constant value. */ + ((Item_sum_max*) item_sum)->make_const(); recalc_const_item= 1; break; } From 30681cf509f455506b8ff809369561734fdc82c2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Sep 2005 10:24:46 +0200 Subject: [PATCH 063/225] Don't add all args to mysqltest to MYSQL_TEST env var mysql-test/mysql-test-run.pl: Not all args to mysqltest should be added to the MYSQL_TEST environment variable. The MYSQL_TEST var is used when testing mysqltest and --record and result_file should not be set. --- mysql-test/mysql-test-run.pl | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index cd182e8fc73..19a2679d956 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2157,11 +2157,6 @@ sub run_mysqltest ($) { mtr_add_arg($args, "--big-test"); } - if ( $opt_record ) - { - mtr_add_arg($args, "--record"); - } - if ( $opt_compress ) { mtr_add_arg($args, "--compress"); @@ -2187,9 +2182,6 @@ sub run_mysqltest ($) { $glob_mysql_test_dir); } - mtr_add_arg($args, "-R"); - mtr_add_arg($args, $tinfo->{'result_file'}); - # ---------------------------------------------------------------------- # If embedded server, we create server args to give mysqltest to pass on # ---------------------------------------------------------------------- @@ -2204,6 +2196,18 @@ sub run_mysqltest ($) { # ---------------------------------------------------------------------- $ENV{'MYSQL_TEST'}= "$exe_mysqltest " . join(" ", @$args); + # ---------------------------------------------------------------------- + # Add args that should not go into the MYSQL_TEST environment var + # ---------------------------------------------------------------------- + + mtr_add_arg($args, "-R"); + mtr_add_arg($args, $tinfo->{'result_file'}); + + if ( $opt_record ) + { + mtr_add_arg($args, "--record"); + } + return mtr_run_test($exe,$args,$tinfo->{'path'},"",$path_timefile,""); } From 24922a3092eb4d89e6b0f8c52ba7a0b29162758e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Sep 2005 14:32:19 +0500 Subject: [PATCH 064/225] a fix (bug #7589: Decimal types are ignored when updating data from another column). mysql-test/r/union.result: a fix (bug #7589: Decimal types are ignored when updating data from another column). removed wrong test result (see #13372) mysql-test/t/union.test: a fix (bug #7589: Decimal types are ignored when updating data from another column). removed wrong test result (see #13372) sql/field_conv.cc: a fix (bug #7589: Decimal types are ignored when updating data from another column). use memcpy() only for identical decimals. --- mysql-test/r/type_decimal.result | 9 +++++++++ mysql-test/r/union.result | 15 --------------- mysql-test/t/type_decimal.test | 10 ++++++++++ mysql-test/t/union.test | 8 -------- sql/field_conv.cc | 3 +++ 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index a9dcabd121e..c3b2d5090ef 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -646,3 +646,12 @@ a 9999.999 0000.000 drop table t1; +create table t1(a decimal(10,5), b decimal(10,1)); +insert into t1 values(123.12345, 123.12345); +update t1 set b=a; +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +select * from t1; +a b +123.12345 123.1 +drop table t1; diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 1b5fa69d713..a3dd2c5c291 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -780,21 +780,6 @@ t1 CREATE TABLE `t1` ( `b` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1,t2; -create table t1 (d decimal(10,1)); -create table t2 (d decimal(10,9)); -insert into t1 values ("100000000.0"); -insert into t2 values ("1.23456780"); -create table t3 select * from t2 union select * from t1; -select * from t3; -d -1.234567800 -100000000.0 -show create table t3; -Table Create Table -t3 CREATE TABLE `t3` ( - `d` decimal(10,9) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -drop table t1,t2,t3; create table t1 select 1 union select -1; select * from t1; 1 diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test index a6fd99e8c9a..1f133666910 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -266,4 +266,14 @@ insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000 select * from t1; drop table t1; +# +# Bug #7589: a problem with update from column +# + +create table t1(a decimal(10,5), b decimal(10,1)); +insert into t1 values(123.12345, 123.12345); +update t1 set b=a; +select * from t1; +drop table t1; + # End of 4.1 tests diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index 6acccaeafd5..6a54909536a 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -425,14 +425,6 @@ create table t1 SELECT b from t2 UNION select tx from t2; select * from t1; show create table t1; drop table t1,t2; -create table t1 (d decimal(10,1)); -create table t2 (d decimal(10,9)); -insert into t1 values ("100000000.0"); -insert into t2 values ("1.23456780"); -create table t3 select * from t2 union select * from t1; -select * from t3; -show create table t3; -drop table t1,t2,t3; create table t1 select 1 union select -1; select * from t1; show create table t1; diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 7998dd6d5f8..d61b3735c91 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -599,6 +599,9 @@ void field_conv(Field *to,Field *from) !(to->flags & UNSIGNED_FLAG && !(from->flags & UNSIGNED_FLAG)) && to->real_type() != FIELD_TYPE_ENUM && to->real_type() != FIELD_TYPE_SET && + (to->real_type() != FIELD_TYPE_DECIMAL || + (to->field_length == from->field_length && + (((Field_num*) to)->dec == ((Field_num*) from)->dec))) && from->charset() == to->charset() && to->table->db_low_byte_first == from->table->db_low_byte_first) { // Identical fields From 92cc2b80c5233784db659bb4de208bff278efb0c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Sep 2005 13:22:27 +0200 Subject: [PATCH 065/225] ndb post merge fixes (show engine ndb status) sql/ha_ndbcluster.cc: ndb post merge fixes --- sql/ha_ndbcluster.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 717eff44588..709a7ed14e0 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -7413,7 +7413,7 @@ ndbcluster_show_status(THD* thd) field_list.push_back(new Item_return_int("free", 10,MYSQL_TYPE_LONG)); field_list.push_back(new Item_return_int("sizeof", 10,MYSQL_TYPE_LONG)); - if (protocol->send_fields(&field_list, 1)) + if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) DBUG_RETURN(TRUE); if (get_thd_ndb(thd) && get_thd_ndb(thd)->ndb) From 906cd821e2f243bee37ad68a7d8060bd287313c0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Sep 2005 14:27:41 +0200 Subject: [PATCH 066/225] Added clarification comment regarding added ROLLBACK to mysqlbinlog output --- client/mysqlbinlog.cc | 2 +- mysql-test/r/ctype_ucs_binlog.result | 1 + mysql-test/r/mysqlbinlog.result | 10 ++++++++++ mysql-test/r/mysqlbinlog2.result | 25 +++++++++++++++++++++++++ mysql-test/r/rpl_charset.result | 1 + mysql-test/r/rpl_timezone.result | 1 + mysql-test/r/user_var-binlog.result | 1 + 7 files changed, 40 insertions(+), 1 deletion(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index fb9ed3af70c..eff05b9a8bf 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -1434,7 +1434,7 @@ int main(int argc, char** argv) of transaction. */ fprintf(result_file, - "ROLLBACK;\n" + "# End of log file\nROLLBACK;\n" "/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;\n"); if (disable_log_bin) fprintf(result_file, "/*!32316 SET SQL_LOG_BIN=@OLD_SQL_LOG_BIN*/;\n"); diff --git a/mysql-test/r/ctype_ucs_binlog.result b/mysql-test/r/ctype_ucs_binlog.result index 4267e495959..fd4db66f6fe 100644 --- a/mysql-test/r/ctype_ucs_binlog.result +++ b/mysql-test/r/ctype_ucs_binlog.result @@ -17,6 +17,7 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t2 values (@v); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; drop table t2; diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 8765e65f11b..e08d0b519b8 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -39,6 +39,7 @@ SET TIMESTAMP=1000000000; load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-3-0' INTO table t1; SET TIMESTAMP=1000000000; load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-4-0' INTO table t1; +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -51,6 +52,7 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values ("Alas"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -59,6 +61,7 @@ ROLLBACK; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; ROLLBACK; SET INSERT_ID=1; +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -71,6 +74,7 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values ("Alas"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -101,6 +105,7 @@ SET TIMESTAMP=1000000000; load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-3-2' INTO table t1; SET TIMESTAMP=1000000000; load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-4-2' INTO table t1; +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -113,6 +118,7 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values ("Alas"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -121,6 +127,7 @@ ROLLBACK; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; ROLLBACK; SET INSERT_ID=1; +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -133,6 +140,7 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values ("Alas"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -145,6 +153,7 @@ SET TIMESTAMP=1108844556; BEGIN; SET TIMESTAMP=1108844555; insert t1 values (1); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; @@ -154,6 +163,7 @@ SET TIMESTAMP=1108844556; BEGIN; SET TIMESTAMP=1108844555; insert t1 values (1); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; drop table t1, t2; diff --git a/mysql-test/r/mysqlbinlog2.result b/mysql-test/r/mysqlbinlog2.result index 9899fa54301..926c6f35c4b 100644 --- a/mysql-test/r/mysqlbinlog2.result +++ b/mysql-test/r/mysqlbinlog2.result @@ -39,6 +39,7 @@ insert into t1 values(null, "d"); SET INSERT_ID=5; SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -65,6 +66,7 @@ insert into t1 values(null, "d"); SET INSERT_ID=5; SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -81,6 +83,7 @@ insert into t1 values(null, "d"); SET INSERT_ID=5; SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -103,6 +106,7 @@ insert into t1 values(null, "b"); SET INSERT_ID=3; SET TIMESTAMP=1579609944; insert into t1 values(null, "c"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -123,6 +127,7 @@ insert into t1 values(null, "d"); SET INSERT_ID=5; SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -142,6 +147,7 @@ insert into t1 values(null, "a"); SET INSERT_ID=2; SET TIMESTAMP=1579609942; insert into t1 values(null, "b"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -177,6 +183,7 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values(null, "f"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -210,6 +217,7 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values(null, "f"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -233,6 +241,7 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values(null, "f"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -262,6 +271,7 @@ SET INSERT_ID=5; SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); SET INSERT_ID=6; +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -289,6 +299,7 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values(null, "f"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -308,6 +319,7 @@ insert into t1 values(null, "a"); SET INSERT_ID=2; SET TIMESTAMP=1579609942; insert into t1 values(null, "b"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -336,6 +348,7 @@ insert into t1 values(null, "d"); SET INSERT_ID=5; SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -362,6 +375,7 @@ insert into t1 values(null, "d"); SET INSERT_ID=5; SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -378,6 +392,7 @@ insert into t1 values(null, "d"); SET INSERT_ID=5; SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -400,6 +415,7 @@ insert into t1 values(null, "b"); SET INSERT_ID=3; SET TIMESTAMP=1579609944; insert into t1 values(null, "c"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -420,6 +436,7 @@ insert into t1 values(null, "d"); SET INSERT_ID=5; SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -439,6 +456,7 @@ insert into t1 values(null, "a"); SET INSERT_ID=2; SET TIMESTAMP=1579609942; insert into t1 values(null, "b"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -474,6 +492,7 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values(null, "f"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -507,6 +526,7 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values(null, "f"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -530,6 +550,7 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values(null, "f"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -559,6 +580,7 @@ SET INSERT_ID=5; SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); SET INSERT_ID=6; +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -586,6 +608,7 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values(null, "f"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -605,6 +628,7 @@ insert into t1 values(null, "a"); SET INSERT_ID=2; SET TIMESTAMP=1579609942; insert into t1 values(null, "b"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; @@ -636,6 +660,7 @@ insert into t1 values(null, "e"); SET INSERT_ID=6; SET TIMESTAMP=1579609943; insert into t1 values(null, "f"); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; diff --git a/mysql-test/r/rpl_charset.result b/mysql-test/r/rpl_charset.result index b27acc0972e..26403952bb9 100644 --- a/mysql-test/r/rpl_charset.result +++ b/mysql-test/r/rpl_charset.result @@ -246,6 +246,7 @@ CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255)); SET TIMESTAMP=1000000000; SET @@session.character_set_client=7,@@session.collation_connection=51,@@session.collation_server=30; INSERT INTO t1 (c1, c2) VALUES ('Ну, за рыбалку','Ну, за рыбалку'); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; drop table t1; diff --git a/mysql-test/r/rpl_timezone.result b/mysql-test/r/rpl_timezone.result index 85637638f99..9cfe793b9ba 100644 --- a/mysql-test/r/rpl_timezone.result +++ b/mysql-test/r/rpl_timezone.result @@ -63,6 +63,7 @@ delete from t1; SET TIMESTAMP=100000000; SET @@session.time_zone='Europe/Moscow'; insert into t1 values ('20040101000000'), ('20040611093902'); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; delete from t1; diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result index 0e9692523ef..e6f9ae1c82a 100644 --- a/mysql-test/r/user_var-binlog.result +++ b/mysql-test/r/user_var-binlog.result @@ -27,6 +27,7 @@ SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`; SET @`var2`:=_latin1 0x61 COLLATE `latin1_swedish_ci`; SET TIMESTAMP=10000; insert into t1 values (@var1),(@var2); +# End of log file ROLLBACK; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; drop table t1; From 3f35fce127a07899e3cfedd260c9f75a75d7c66a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Sep 2005 14:36:55 +0200 Subject: [PATCH 067/225] sql/item_func.cc remove extra ";" after function sql/item_func.cc: remove extra ";" after function --- sql/item_func.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/item_func.cc b/sql/item_func.cc index 265eb28bba8..f07460f2a05 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4904,7 +4904,7 @@ error: error: #endif return res; -}; +} bool Item_func_sp::fix_fields(THD *thd, Item **ref) From 1d16fa5d866c3875bb8fab818115b15c3cda93f5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Sep 2005 17:28:25 +0300 Subject: [PATCH 068/225] Ensure that hex strings are used as integers in cast(... signed/unsigned) This fixes the new report for bug #7036 mysql-test/t/cast.test: Added test for cast(hex-value to signed/unsigned) sql/item.h: Ensure that hex strings are used as integers in cast(... signed/unsigned) --- mysql-test/t/cast.test | 4 ++++ sql/item.h | 1 + 2 files changed, 5 insertions(+) diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index 394971f9648..bb01e8cea83 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -20,6 +20,10 @@ select CONVERT(DATE "2004-01-22 21:45:33",CHAR); select CONVERT(DATE "2004-01-22 21:45:33",CHAR(4)); select CONVERT(DATE "2004-01-22 21:45:33",BINARY(4)); select CAST(DATE "2004-01-22 21:45:33" AS BINARY(4)); +select CAST(0xb3 as signed); +select CAST(0x8fffffffffffffff as signed); +select CAST(0xffffffffffffffff as unsigned); +select CAST(0xfffffffffffffffe as signed); # out-of-range cases select cast('18446744073709551616' as unsigned); diff --git a/sql/item.h b/sql/item.h index e683cda5786..b1aed733101 100644 --- a/sql/item.h +++ b/sql/item.h @@ -842,6 +842,7 @@ public: String *val_str(String*) { DBUG_ASSERT(fixed == 1); return &str_value; } int save_in_field(Field *field, bool no_conversions); enum Item_result result_type () const { return STRING_RESULT; } + enum Item_result cast_to_int_type() const { return INT_RESULT; } enum_field_types field_type() const { return MYSQL_TYPE_STRING; } // to prevent drop fixed flag (no need parent cleanup call) void cleanup() {} From 90b102daa644cf26de29ca88a82ae1a0fd45fff6 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 00:41:46 +1000 Subject: [PATCH 069/225] BUG#11595 ndb_mgm shows from IP for second mgmd BUG#12037 ndb_mgmd IP address do not show in other ndb_mgmd processes Extend ApiVersionConf to include address. ndb/include/kernel/signaldata/ApiVersion.hpp: Extend ApiVersionConf to include inet_addr. the address used for communication to this node. ndb/src/kernel/blocks/qmgr/QmgrMain.cpp: include connect address in ApiVersionConf ndb/src/mgmsrv/MgmtSrvr.cpp: ::status() now also returns char* address of the node. For API or MGM, this is in ApiVersionConf. For NDB, this is the standard get_connect_address. When sending ApiVersionReq, try to send to a STARTED node (as these have properly joined the cluster and know the connect addresses). If versionNode is called for getOwnNodeId()==nodeId, try to get the address via ApiVersionConf. If that fails, look it up in the configuration. ndb/src/mgmsrv/MgmtSrvr.hpp: Add char **address to prototypes. ndb/src/mgmsrv/Services.cpp: Get the connect address from mgmsrv.status() --- ndb/include/kernel/signaldata/ApiVersion.hpp | 5 +- ndb/src/kernel/blocks/qmgr/QmgrMain.cpp | 2 + ndb/src/mgmsrv/MgmtSrvr.cpp | 50 +++++++++++++++++--- ndb/src/mgmsrv/MgmtSrvr.hpp | 7 +-- ndb/src/mgmsrv/Services.cpp | 8 ++-- 5 files changed, 56 insertions(+), 16 deletions(-) diff --git a/ndb/include/kernel/signaldata/ApiVersion.hpp b/ndb/include/kernel/signaldata/ApiVersion.hpp index 28281e7d186..a3774c9fba6 100644 --- a/ndb/include/kernel/signaldata/ApiVersion.hpp +++ b/ndb/include/kernel/signaldata/ApiVersion.hpp @@ -49,12 +49,11 @@ class ApiVersionConf { */ friend class MgmtSrv; public: - STATIC_CONST( SignalLength = 3 ); + STATIC_CONST( SignalLength = 4 ); Uint32 senderRef; Uint32 nodeId; //api node id Uint32 version; // Version of API node - - + Uint32 inet_addr; }; #endif diff --git a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp index 3770edff947..6095895e7c2 100644 --- a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp +++ b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp @@ -2012,6 +2012,8 @@ Qmgr::execAPI_VERSION_REQ(Signal * signal) { else conf->version = 0; conf->nodeId = nodeId; + struct in_addr in= globalTransporterRegistry.get_connect_address(nodeId); + conf->inet_addr= in.s_addr; sendSignal(senderRef, GSN_API_VERSION_CONF, diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index c35b85dd595..ccff959f260 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -690,30 +690,46 @@ MgmtSrvr::start(int nodeId) *****************************************************************************/ int -MgmtSrvr::versionNode(int nodeId, Uint32 &version) +MgmtSrvr::versionNode(int nodeId, Uint32 &version, const char **address) { version= 0; if (getOwnNodeId() == nodeId) { + sendVersionReq(nodeId, version, address); version= NDB_VERSION; + if(!*address) + { + ndb_mgm_configuration_iterator + iter(*_config->m_configValues, CFG_SECTION_NODE); + unsigned tmp= 0; + for(iter.first();iter.valid();iter.next()) + { + if(iter.get(CFG_NODE_ID, &tmp)) require(false); + if((unsigned)nodeId!=tmp) + continue; + if(iter.get(CFG_NODE_HOST, address)) require(false); + break; + } + } } else if (getNodeType(nodeId) == NDB_MGM_NODE_TYPE_NDB) { ClusterMgr::Node node= theFacade->theClusterMgr->getNodeInfo(nodeId); if(node.connected) version= node.m_info.m_version; + *address= get_connect_address(nodeId); } else if (getNodeType(nodeId) == NDB_MGM_NODE_TYPE_API || getNodeType(nodeId) == NDB_MGM_NODE_TYPE_MGM) { - return sendVersionReq(nodeId, version); + return sendVersionReq(nodeId, version, address); } return 0; } int -MgmtSrvr::sendVersionReq(int v_nodeId, Uint32 &version) +MgmtSrvr::sendVersionReq(int v_nodeId, Uint32 &version, const char **address) { SignalSender ss(theFacade); ss.lock(); @@ -734,10 +750,23 @@ MgmtSrvr::sendVersionReq(int v_nodeId, Uint32 &version) { bool next; nodeId = 0; + while((next = getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)) == true && okToSendTo(nodeId, true) != 0); + + const ClusterMgr::Node &node= + theFacade->theClusterMgr->getNodeInfo(nodeId); + if(next && node.m_state.startLevel != NodeState::SL_STARTED) + { + NodeId tmp=nodeId; + while((next = getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)) == true && + okToSendTo(nodeId, true) != 0); + if(!next) + nodeId= tmp; + } + if(!next) return NO_CONTACT_WITH_DB_NODES; - + if (ss.sendSignal(nodeId, &ssig) != SEND_OK) { return SEND_OR_RECEIVE_FAILED; } @@ -753,6 +782,9 @@ MgmtSrvr::sendVersionReq(int v_nodeId, Uint32 &version) CAST_CONSTPTR(ApiVersionConf, signal->getDataPtr()); assert(conf->nodeId == v_nodeId); version = conf->version; + struct in_addr in; + in.s_addr= conf->inet_addr; + *address= inet_ntoa(in); return 0; } case GSN_NF_COMPLETEREP:{ @@ -1060,8 +1092,9 @@ int MgmtSrvr::restart(bool nostart, bool initialStart, Uint32 startPhase = 0, version = 0, dynamicId = 0, nodeGroup = 0; Uint32 connectCount = 0; bool system; + const char *address; status(nodeId, &s, &version, &startPhase, - &system, &dynamicId, &nodeGroup, &connectCount); + &system, &dynamicId, &nodeGroup, &connectCount, &address); NdbSleep_MilliSleep(100); waitTime = (maxTime - NdbTick_CurrentMillisecond()); } @@ -1137,11 +1170,14 @@ MgmtSrvr::status(int nodeId, bool * _system, Uint32 * dynamic, Uint32 * nodegroup, - Uint32 * connectCount) + Uint32 * connectCount, + const char **address) { if (getNodeType(nodeId) == NDB_MGM_NODE_TYPE_API || getNodeType(nodeId) == NDB_MGM_NODE_TYPE_MGM) { - versionNode(nodeId, *version); + versionNode(nodeId, *version, address); + } else { + *address= get_connect_address(nodeId); } const ClusterMgr::Node node = diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index ff24e97ce02..8f16918b24a 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -208,7 +208,8 @@ public: bool * systemShutdown, Uint32 * dynamicId, Uint32 * nodeGroup, - Uint32 * connectCount); + Uint32 * connectCount, + const char **address); // All the functions below may return any of this error codes: // NO_CONTACT_WITH_PROCESS, PROCESS_NOT_CONFIGURED, WRONG_PROCESS_TYPE, @@ -255,7 +256,7 @@ public: * @param processId: Id of the DB process to stop * @return 0 if succeeded, otherwise: as stated above, plus: */ - int versionNode(int nodeId, Uint32 &version); + int versionNode(int nodeId, Uint32 &version, const char **address); /** * Maintenance on the system @@ -611,7 +612,7 @@ private: class TransporterFacade * theFacade; - int sendVersionReq( int processId, Uint32 &version); + int sendVersionReq( int processId, Uint32 &version, const char **address); int translateStopRef(Uint32 errCode); bool _isStopThread; diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index ef52729dd37..bcc18d75b09 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -903,8 +903,10 @@ printNodeStatus(OutputStream *output, nodeGroup = 0, connectCount = 0; bool system; - mgmsrv.status(nodeId, &status, &version, &startPhase, - &system, &dynamicId, &nodeGroup, &connectCount); + const char *address= NULL; + mgmsrv.status(nodeId, &status, &version, &startPhase, + &system, &dynamicId, &nodeGroup, &connectCount, + &address); output->println("node.%d.type: %s", nodeId, ndb_mgm_get_node_type_string(type)); @@ -916,7 +918,7 @@ printNodeStatus(OutputStream *output, output->println("node.%d.dynamic_id: %d", nodeId, dynamicId); output->println("node.%d.node_group: %d", nodeId, nodeGroup); output->println("node.%d.connect_count: %d", nodeId, connectCount); - output->println("node.%d.address: %s", nodeId, mgmsrv.get_connect_address(nodeId)); + output->println("node.%d.address: %s", nodeId, address); } } From 3c8a296f28b20e039994d6308c5fdbf181160929 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Sep 2005 17:24:39 +0200 Subject: [PATCH 070/225] bug#12950 ndb backup with charsets and simultanious updates make sure that backup _dont_ read xfrm data ndb/src/kernel/blocks/backup/Backup.cpp: Backup can do dirty read ndb/src/kernel/blocks/dbtup/Dbtup.hpp: Fix so that backup dont read xfrm data ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp: Fix so that backup dont read xfrm data --- ndb/src/kernel/blocks/backup/Backup.cpp | 1 + ndb/src/kernel/blocks/dbtup/Dbtup.hpp | 3 ++- ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp | 12 +++++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ndb/src/kernel/blocks/backup/Backup.cpp b/ndb/src/kernel/blocks/backup/Backup.cpp index ec5c7a5d588..56af24c5cf0 100644 --- a/ndb/src/kernel/blocks/backup/Backup.cpp +++ b/ndb/src/kernel/blocks/backup/Backup.cpp @@ -3265,6 +3265,7 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal) req->requestInfo = 0; req->savePointId = 0; req->tableId = table.tableId; + ScanFragReq::setReadCommittedFlag(req->requestInfo, 1); ScanFragReq::setLockMode(req->requestInfo, 0); ScanFragReq::setHoldLockFlag(req->requestInfo, 0); ScanFragReq::setKeyinfoFlag(req->requestInfo, 0); diff --git a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index dffafc1ab66..1cb3bd89997 100644 --- a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -1737,7 +1737,8 @@ private: Uint32* const mainBuffer, Uint32& noMainWords, Uint32* const copyBuffer, - Uint32& noCopyWords); + Uint32& noCopyWords, + bool xfrm); void sendTrigAttrInfo(Signal* signal, Uint32* data, diff --git a/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp b/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp index 0acfd390360..59a31475617 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp @@ -622,7 +622,8 @@ void Dbtup::executeTrigger(Signal* signal, mainBuffer, noMainWords, copyBuffer, - noCopyWords)) { + noCopyWords, + (ref == BACKUP ? false : true))) { ljam(); return; }//if @@ -727,7 +728,8 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr, Uint32* const mainBuffer, Uint32& noMainWords, Uint32* const copyBuffer, - Uint32& noCopyWords) + Uint32& noCopyWords, + bool xfrm) { noCopyWords = 0; noMainWords = 0; @@ -757,7 +759,7 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr, regTabPtr->noOfKeyAttr, keyBuffer, ZATTR_BUFFER_SIZE, - true); + xfrm); ndbrequire(ret != -1); noPrimKey= ret; @@ -800,7 +802,7 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr, numAttrsToRead, mainBuffer, ZATTR_BUFFER_SIZE, - true); + xfrm); ndbrequire(ret != -1); noMainWords= ret; } else { @@ -826,7 +828,7 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr, numAttrsToRead, copyBuffer, ZATTR_BUFFER_SIZE, - true); + xfrm); ndbrequire(ret != -1); noCopyWords = ret; From b63df84b1ab7b7ef456a175e09a69ef15bc12306 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Sep 2005 17:37:33 +0200 Subject: [PATCH 071/225] ndb merge fix --- ndb/src/kernel/blocks/dbtup/Dbtup.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index 7d85af9f138..cf3c6056d65 100644 --- a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -1791,8 +1791,7 @@ private: Uint32* const mainBuffer, Uint32& noMainWords, Uint32* const copyBuffer, - Uint32& noCopyWords, - bool xfrm); + Uint32& noCopyWords); void sendTrigAttrInfo(Signal* signal, Uint32* data, From 4956432b12371eb309ab8e31429adfcdc41cc983 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Sep 2005 17:38:26 +0200 Subject: [PATCH 072/225] aftermerge fix --- include/myisam.h | 2 +- myisam/myisamchk.c | 5 ++--- mysql-test/r/innodb.result | 2 +- sql/mysqld.cc | 3 ++- sql/sql_parse.cc | 7 +++++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/include/myisam.h b/include/myisam.h index 6cc219de6e8..39cc61ad204 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -390,7 +390,7 @@ typedef struct st_sort_key_blocks /* Used when sorting */ typedef enum { /* Treat NULLs as inequal when collecting statistics (default for 4.1/5.0) */ - MI_STATS_METHOD_NULLS_NOT_EQUAL=1, + MI_STATS_METHOD_NULLS_NOT_EQUAL, /* Treat NULLs as equal when collecting statistics (like 4.0 did) */ MI_STATS_METHOD_NULLS_EQUAL } enum_mi_stats_method; diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index cfc3930779f..10308408b1f 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -698,15 +698,14 @@ get_one_option(int optid, break; case OPT_STATS_METHOD: { - myisam_stats_method_str= argument; int method; + myisam_stats_method_str= argument; if ((method=find_type(argument, &myisam_stats_method_typelib, 2)) <= 0) { fprintf(stderr, "Invalid value of stats_method: %s.\n", argument); exit(1); } - check_param.stats_method= test(method-1)? MI_STATS_METHOD_NULLS_EQUAL : - MI_STATS_METHOD_NULLS_NOT_EQUAL; + check_param.stats_method= method-1; break; } #ifdef DEBUG /* Only useful if debugging */ diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 4dd1d694401..ffc4ab08ab4 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1785,7 +1785,7 @@ Variable_name Value Innodb_rows_deleted 2070 show status like "Innodb_rows_inserted"; Variable_name Value -Innodb_rows_inserted 31725 +Innodb_rows_inserted 31727 show status like "Innodb_rows_updated"; Variable_name Value Innodb_rows_updated 29530 diff --git a/sql/mysqld.cc b/sql/mysqld.cc index ad2b6c5fd68..e00c0254661 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -6767,6 +6767,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), fprintf(stderr, "Unknown option to tc-heuristic-recover: %s\n",argument); exit(1); } + } case OPT_MYISAM_STATS_METHOD: { myisam_stats_method_str= argument; @@ -6776,7 +6777,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), fprintf(stderr, "Invalid value of myisam_stats_method: %s.\n", argument); exit(1); } - global_system_variables.myisam_stats_method= method; + global_system_variables.myisam_stats_method= method-1; break; } case OPT_SQL_MODE: diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 8c3f9090529..d90fb0b0c99 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -7175,8 +7175,11 @@ bool multi_delete_set_locks_and_link_aux_tables(LEX *lex) target_tbl->table_name, "MULTI DELETE"); DBUG_RETURN(TRUE); } - target_tbl->table_name= walk->table_name; - target_tbl->table_name_length= walk->table_name_length; + if (!walk->derived) + { + target_tbl->table_name= walk->table_name; + target_tbl->table_name_length= walk->table_name_length; + } walk->updating= target_tbl->updating; walk->lock_type= target_tbl->lock_type; target_tbl->correspondent_table= walk; // Remember corresponding table From a808e97d8aa9d80ae6f310171eba34a45116518a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Sep 2005 19:58:40 +0400 Subject: [PATCH 073/225] Fix compiler error: C++ code in C --- myisam/myisamchk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index 1a7d2b2d9a8..2ffc491fc91 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -698,8 +698,8 @@ get_one_option(int optid, break; case OPT_STATS_METHOD: { - myisam_stats_method_str= argument; int method; + myisam_stats_method_str= argument; if ((method=find_type(argument, &myisam_stats_method_typelib, 2)) <= 0) { fprintf(stderr, "Invalid value of stats_method: %s.\n", argument); From 0004c431dbbceeb928b3b0c3b0c530282615da74 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Sep 2005 21:36:15 +0400 Subject: [PATCH 074/225] Fix for BUG#13317: Make range optimizer able to produce ranges for "view.field IN (c1,c2)" and "view.field BETWEEN c1 AND c2" mysql-test/r/range.result: Testcase for BUG#13317 mysql-test/t/range.test: Testcase for BUG#13317 --- mysql-test/r/range.result | 19 +++++++++++++++++++ mysql-test/t/range.test | 22 ++++++++++++++++++++++ sql/opt_range.cc | 8 ++++---- 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index f490c2e1383..6adbea973df 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -768,3 +768,22 @@ SELECT * FROM t1; a 2 DROP TABLE t1; +create table t1 (a int, b int, primary key(a,b)); +create view v1 as select a, b from t1; +INSERT INTO `t1` VALUES +(0,0),(1,0),(2,0),(3,0),(4,0),(5,1),(6,1),(7,1),(8,1),(9,1),(10,2),(11,2),(12,2) +,(13,2),(14,2),(15,3),(16,3),(17,3),(18,3),(19,3); +explain select * from t1 where a in (3,4) and b in (1,2,3); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL # Using where; Using index +explain select * from v1 where a in (3,4) and b in (1,2,3); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 range PRIMARY PRIMARY 8 NULL # Using where; Using index +explain select * from t1 where a between 3 and 4 and b between 1 and 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL # Using where; Using index +explain select * from v1 where a between 3 and 4 and b between 1 and 2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 range PRIMARY PRIMARY 8 NULL # Using where; Using index +drop view v1; +drop table t1; diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index bbe5798e7e5..d8b3f5ef953 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -578,3 +578,25 @@ DELETE FROM t1 WHERE NOT(a <=> 2); SELECT * FROM t1; DROP TABLE t1; + +# +# BUG#13317: range optimization doesn't work for IN over VIEW. +# +create table t1 (a int, b int, primary key(a,b)); +create view v1 as select a, b from t1; + +INSERT INTO `t1` VALUES +(0,0),(1,0),(2,0),(3,0),(4,0),(5,1),(6,1),(7,1),(8,1),(9,1),(10,2),(11,2),(12,2) +,(13,2),(14,2),(15,3),(16,3),(17,3),(18,3),(19,3); + +--replace_column 9 # +explain select * from t1 where a in (3,4) and b in (1,2,3); +--replace_column 9 # +explain select * from v1 where a in (3,4) and b in (1,2,3); +--replace_column 9 # +explain select * from t1 where a between 3 and 4 and b between 1 and 2; +--replace_column 9 # +explain select * from v1 where a between 3 and 4 and b between 1 and 2; + +drop view v1; +drop table t1; diff --git a/sql/opt_range.cc b/sql/opt_range.cc index edb4289e76f..caefdf92633 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -3533,17 +3533,17 @@ static SEL_TREE *get_mm_tree(PARAM *param,COND *cond) switch (cond_func->functype()) { case Item_func::BETWEEN: - if (cond_func->arguments()[0]->type() != Item::FIELD_ITEM) + if (cond_func->arguments()[0]->real_item()->type() != Item::FIELD_ITEM) DBUG_RETURN(0); - field_item= (Item_field*) (cond_func->arguments()[0]); + field_item= (Item_field*) (cond_func->arguments()[0]->real_item()); value= NULL; break; case Item_func::IN_FUNC: { Item_func_in *func=(Item_func_in*) cond_func; - if (func->key_item()->type() != Item::FIELD_ITEM) + if (func->key_item()->real_item()->type() != Item::FIELD_ITEM) DBUG_RETURN(0); - field_item= (Item_field*) (func->key_item()); + field_item= (Item_field*) (func->key_item()->real_item()); value= NULL; break; } From 1b02a815dde1379635fb1c76065fc056c084705a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 01:38:39 +0400 Subject: [PATCH 075/225] Fix bug #13180 thd->allow_sum_funcs wasn't reset before query processing. thd->allow_sum_func was left 'true' after previous statement thus allowing sum funcs to be present in conditions. thd->allow_sum_func should be set to 0 for each query and each prepared statement reinitialization. This is done in lex_start() and reset_stmt_for_execute(). sql/sql_lex.cc: Fix bug#13180 thd->allow_sum_func wasn't reset obefore query processing. thd->allow_sum_func is set to 0 in lex_start(). sql/sql_prepare.cc: Fix bug#13180 thd->allow_sum_func wasn't reset obefore query processing. thd->allow_sum_func is set to 0 in reset_stmt_for_execute(). mysql-test/t/update.test: Test case for bug#13180 thd->allow_sum_funcs wasn't reset before query processing. mysql-test/r/update.result: Test case for bug#13180 thd->allow_sum_funcs wasn't reset before query processing. --- mysql-test/r/update.result | 12 ++++++++++++ mysql-test/t/update.test | 12 ++++++++++++ sql/sql_lex.cc | 1 + sql/sql_prepare.cc | 1 + 4 files changed, 26 insertions(+) diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index e35d4e29fe4..d6c1118f90c 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -251,3 +251,15 @@ f1 f2 1 1 2 2 drop table t1,t2; +create table t1(f1 int); +select DATABASE(); +DATABASE() +test +update t1 set f1=1 where count(*)=1; +ERROR HY000: Invalid use of group function +select DATABASE(); +DATABASE() +test +delete from t1 where count(*)=1; +ERROR HY000: Invalid use of group function +drop table t1; diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index e4e751862f1..84e9ced2017 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -215,4 +215,16 @@ UPDATE t1 SET t1.f2=(SELECT MAX(t2.f4) FROM t2 WHERE t2.f3=t1.f1); select * from t1; drop table t1,t2; +# +# Bug #13180 sometimes server accepts sum func in update/delete where condition +# +create table t1(f1 int); +select DATABASE(); +--error 1111 +update t1 set f1=1 where count(*)=1; +select DATABASE(); +--error 1111 +delete from t1 where count(*)=1; +drop table t1; + # End of 4.1 tests diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 8636b6542fc..07017451bad 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -160,6 +160,7 @@ void lex_start(THD *thd, uchar *buf,uint length) lex->duplicates= DUP_ERROR; lex->ignore= 0; lex->proc_list.first= 0; + thd->allow_sum_func= 0; } void lex_end(LEX *lex) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 8a50d0bd50e..c8f417c9b9b 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1738,6 +1738,7 @@ static void reset_stmt_for_execute(Prepared_statement *stmt) lex->current_select= &lex->select_lex; if (lex->result) lex->result->cleanup(); + thd->allow_sum_func= 0; } From 813fc4104efc55a25458a092118cbd3b55cf870f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 02:11:21 +0400 Subject: [PATCH 076/225] A fix and a test case for Bug#6513 "Test Suite: Values inserted by using cursor is interpreted latin1 character and Bug#9819 "Cursors: Mysql Server Crash while fetching from table with 5 million records." A fix for a possible memory leak when fetching into an SP cursor in a long loop. The patch uses a common implementation of cursors in the binary protocol and in stored procedures and implements materialized cursors. For implementation details, see comments in sql_cursor.cc include/my_sys.h: - declaration for multi_alloc_root libmysqld/Makefile.am: - drop protocol_cursor.cc, add sql_cursor.cc (replaces the old implementation of cursors with a new one) mysql-test/r/ctype_ujis.result: - test results fixed (a test case for Bug#6513) mysql-test/r/sp-big.result: - test results fixed (a test case for Bug#9819) mysql-test/t/ctype_ujis.test: Add a test case for Bug#6513 "Test Suite: Values inserted by using cursor is interpreted latin1 character" mysql-test/t/sp-big.test: Add a restricted test case for Bug#9819 "Cursors: Mysql Server Crash while fetching from table with 5 million records." mysys/my_alloc.c: - an implementation of multi_alloc_root; this is largely a copy-paste from mulalloc.c, but the function is small and there is no easy way to reuse the existing C function. sql/Makefile.am: - add sql_cursor.h, sql_cursor.cc (a new implementation of stored procedure cursors) and drop protocol_cursor.cc (the old one) sql/handler.cc: - now TABLE object has its mem_root always initialized. Adjust the implementation handler::ha_open sql/item_subselect.cc: - adjust to the changed declaration of st_select_lex_unit::prepare sql/protocol.h: - drop Protocol_cursor sql/sp_head.cc: - move juggling with Query_arena::free_list and Item::next to sp_eval_func_item, as this is needed in 3 places already. sql/sp_head.h: - declare a no-op implementation for cleanup_stmt in sp_instr_cpush. This method is needed for non-materializing cursors, which are yet not used in stored procedures. - declaration for sp_eval_func_item sql/sp_rcontext.cc: - reimplement sp_cursor using the new implementation of server side cursors. - use sp_eval_func_item to assign values of SP variables from the row fetched from a cursor. This should fix a possible memory leak in the old implementation of sp_cursor::fetch sql/sp_rcontext.h: - reimplement sp_cursor using the new implementation of server side cursors. sql/sql_class.cc: - disable the functionality that closes transient cursors at commit/rollback; transient cursors are not used in 5.0, instead we use materialized ones. To be enabled in a later version. sql/sql_class.h: - adjust to the rename Cursor -> Server_side_cursor - additional declarations of select_union used in materialized cursors sql/sql_derived.cc: - reuse bits of tmp table code in UNION, derived tables, and materialized cursors - cleanup comments sql/sql_lex.h: - declarations of auxiliary methods used by materialized cursors - a cleanup in st_select_lex_unit interface sql/sql_list.h: - add an array operator new[] to class Sql_alloc sql/sql_prepare.cc: - split the tight coupling of cursors and prepared statements to reuse the same implementation in stored procedures - cleanups of error processing in Prepared_statement::{prepare,execute} sql/sql_select.cc: - move the implementation of sensitive (non-materializing) cursors to sql_cursor.cc - make temporary tables self-contained: the table, its record and fields are allocated in TABLE::mem_root. This implementation is not clean and resets thd->mem_root several times because of the way create_tmp_table works (many additional things are done inside it). - adjust to the changed declaration of st_select_lex_unit::prepare sql/sql_select.h: - move the declaration of sensitive (non-materializing) cursors to sql_cursor.cc sql/sql_union.cc: - move pieces of st_select_unit::prepare to select_union and st_table methods to be able to reuse code in the implementation of materialized cursors sql/sql_view.cc: - adjust to the changed signature of st_select_lex_unit::prepare sql/table.cc: - implement auxiliary st_table methods for use with temporary tables sql/table.h: - add declarations for auxiliary methods of st_table used to work with temporary tables tests/mysql_client_test.c: - if cursors are materialized, a parallel update of the table used in the cursor may go through: update the test. sql/sql_cursor.cc: New BitKeeper file ``sql/sql_cursor.cc'' -- implementation of server side cursors sql/sql_cursor.h: New BitKeeper file ``sql/sql_cursor.h'' - declarations for server side cursors. --- include/my_sys.h | 1 + libmysqld/Makefile.am | 2 +- mysql-test/r/ctype_ujis.result | 30 ++ mysql-test/r/sp-big.result | 46 +++ mysql-test/t/ctype_ujis.test | 42 +++ mysql-test/t/sp-big.test | 49 +++ mysys/my_alloc.c | 51 +++ sql/Makefile.am | 4 +- sql/handler.cc | 8 +- sql/item_subselect.cc | 2 +- sql/protocol.h | 24 -- sql/sp_head.cc | 112 +++--- sql/sp_head.h | 9 + sql/sp_rcontext.cc | 217 ++++------- sql/sp_rcontext.h | 43 ++- sql/sql_class.cc | 28 +- sql/sql_class.h | 26 +- sql/sql_cursor.cc | 660 +++++++++++++++++++++++++++++++++ sql/sql_cursor.h | 65 ++++ sql/sql_derived.cc | 43 +-- sql/sql_lex.h | 10 +- sql/sql_list.h | 2 + sql/sql_prepare.cc | 256 +++++++------ sql/sql_select.cc | 390 +++++-------------- sql/sql_select.h | 59 +-- sql/sql_union.cc | 176 +++++---- sql/sql_view.cc | 2 +- sql/table.cc | 57 +++ sql/table.h | 3 + tests/mysql_client_test.c | 7 +- 30 files changed, 1567 insertions(+), 857 deletions(-) create mode 100644 sql/sql_cursor.cc create mode 100644 sql/sql_cursor.h diff --git a/include/my_sys.h b/include/my_sys.h index 836b2a85528..b842e23bcb9 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -775,6 +775,7 @@ extern void my_free_lock(byte *ptr,myf flags); extern void init_alloc_root(MEM_ROOT *mem_root, uint block_size, uint pre_alloc_size); extern gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size); +extern gptr multi_alloc_root(MEM_ROOT *mem_root, ...); extern void free_root(MEM_ROOT *root, myf MyFLAGS); extern void set_prealloc_root(MEM_ROOT *root, char *ptr); extern void reset_root_defaults(MEM_ROOT *mem_root, uint block_size, diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index 9aef03f20d2..1f5c707f538 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -60,7 +60,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \ sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \ unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \ - spatial.cc gstream.cc sql_help.cc tztime.cc protocol_cursor.cc \ + spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \ sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \ parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \ ha_blackhole.cc diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result index 0bc101d491d..0fee6fc3456 100644 --- a/mysql-test/r/ctype_ujis.result +++ b/mysql-test/r/ctype_ujis.result @@ -2271,3 +2271,33 @@ select c1 from t1 where c1 like 'abcde111%' order by c1; c1 abcde111 drop table t1; +DROP TABLE IF EXISTS t1, t2; +DROP PROCEDURE IF EXISTS sp1; +set names ujis; +set character_set_database = ujis; +set character_set_server = ujis; +CREATE TABLE t1(c1 char(2)) default charset = ujis; +CREATE TABLE t2(c2 char(2)) default charset = ujis; +INSERT INTO t1 VALUES(_ujis 0xA4A2); +CREATE PROCEDURE sp1() +BEGIN +DECLARE a CHAR(1); +DECLARE cur1 CURSOR FOR SELECT c1 FROM t1; +OPEN cur1; +FETCH cur1 INTO a; +INSERT INTO t2 VALUES (a); +CLOSE cur1; +END| +CALL sp1(); +SELECT c1,c2 FROM t1,t2; +c1 c2 +╓╒ ╓╒ +SELECT hex(convert(_latin1 0xA4A2 using ujis)),hex(c2) FROM t1,t2; +hex(convert(_latin1 0xA4A2 using ujis)) hex(c2) +8FA2F0A1F1 A4A2 +DROP PROCEDURE sp1; +DROP TABLE t1; +DROP TABLE t2; +set names default; +set character_set_database=default; +set character_set_server=default; diff --git a/mysql-test/r/sp-big.result b/mysql-test/r/sp-big.result index 004ff586aab..1f0b6b34651 100644 --- a/mysql-test/r/sp-big.result +++ b/mysql-test/r/sp-big.result @@ -13,3 +13,49 @@ select @value; 3 drop procedure test.longprocedure; drop table t1; +create table t1 (f1 char(100) , f2 mediumint , f3 int , f4 real, f5 numeric); +insert into t1 (f1, f2, f3, f4, f5) values +("This is a test case for for Bug#9819", 1, 2, 3.0, 4.598); +Warnings: +Note 1265 Data truncated for column 'f5' at row 1 +create table t2 like t1; +select count(*) from t1; +count(*) +256 +select count(*) from t2; +count(*) +0 +create procedure p1() +begin +declare done integer default 0; +declare vf1 char(100) ; +declare vf2 mediumint; +declare vf3 int ; +declare vf4 real ; +declare vf5 numeric ; +declare cur1 cursor for select f1,f2,f3,f4,f5 from t1; +declare continue handler for sqlstate '02000' set done = 1; +open cur1; +while done <> 1 do +fetch cur1 into vf1, vf2, vf3, vf4, vf5; +if not done then +insert into t2 values (vf1, vf2, vf3, vf4, vf5); +end if; +end while; +close cur1; +end| +call p1(); +select count(*) from t1; +count(*) +256 +select count(*) from t2; +count(*) +256 +select f1 from t1 limit 1; +f1 +This is a test case for for Bug#9819 +select f1 from t2 limit 1; +f1 +This is a test case for for Bug#9819 +drop procedure p1; +drop table t1, t2; diff --git a/mysql-test/t/ctype_ujis.test b/mysql-test/t/ctype_ujis.test index 88386500c9f..7730fd0db6d 100644 --- a/mysql-test/t/ctype_ujis.test +++ b/mysql-test/t/ctype_ujis.test @@ -1151,3 +1151,45 @@ SET collation_connection='ujis_bin'; -- source include/ctype_innodb_like.inc # End of 4.1 tests +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +DROP PROCEDURE IF EXISTS sp1; +--enable_warnings + +set names ujis; +set character_set_database = ujis; +set character_set_server = ujis; + +CREATE TABLE t1(c1 char(2)) default charset = ujis; +CREATE TABLE t2(c2 char(2)) default charset = ujis; + +INSERT INTO t1 VALUES(_ujis 0xA4A2); + +DELIMITER |; +CREATE PROCEDURE sp1() +BEGIN + DECLARE a CHAR(1); + DECLARE cur1 CURSOR FOR SELECT c1 FROM t1; + OPEN cur1; + FETCH cur1 INTO a; + INSERT INTO t2 VALUES (a); + CLOSE cur1; +END| +DELIMITER ;| +CALL sp1(); + +#The data in t1 and t2 should be the same but different +SELECT c1,c2 FROM t1,t2; + +#Since the result of hex(convert(_latin1 0xA4A2 using ujis)) +#equals to hex(c2), it seems that the value which was inserted +#by using cursor is interpreted as latin1 character set +SELECT hex(convert(_latin1 0xA4A2 using ujis)),hex(c2) FROM t1,t2; + +DROP PROCEDURE sp1; +DROP TABLE t1; +DROP TABLE t2; + +set names default; +set character_set_database=default; +set character_set_server=default; diff --git a/mysql-test/t/sp-big.test b/mysql-test/t/sp-big.test index 769d77dbef9..389a6f04504 100644 --- a/mysql-test/t/sp-big.test +++ b/mysql-test/t/sp-big.test @@ -31,3 +31,52 @@ call test.longprocedure(@value); select @value; drop procedure test.longprocedure; drop table t1; +# +# Bug #9819 "Cursors: Mysql Server Crash while fetching from table with 5 +# million records.": +# To really test the bug, increase the number of loop iterations ($1). +# For 4 millions set $1 to 22. +create table t1 (f1 char(100) , f2 mediumint , f3 int , f4 real, f5 numeric); +insert into t1 (f1, f2, f3, f4, f5) values +("This is a test case for for Bug#9819", 1, 2, 3.0, 4.598); +create table t2 like t1; +let $1=8; +--disable_query_log +--disable_result_log +while ($1) +{ + eval insert into t1 select * from t1; + dec $1; +} +--enable_result_log +--enable_query_log +select count(*) from t1; +select count(*) from t2; +delimiter |; +create procedure p1() +begin + declare done integer default 0; + declare vf1 char(100) ; + declare vf2 mediumint; + declare vf3 int ; + declare vf4 real ; + declare vf5 numeric ; + declare cur1 cursor for select f1,f2,f3,f4,f5 from t1; + declare continue handler for sqlstate '02000' set done = 1; + open cur1; + while done <> 1 do + fetch cur1 into vf1, vf2, vf3, vf4, vf5; + if not done then + insert into t2 values (vf1, vf2, vf3, vf4, vf5); + end if; + end while; + close cur1; +end| +delimiter ;| +call p1(); +select count(*) from t1; +select count(*) from t2; +select f1 from t1 limit 1; +select f1 from t2 limit 1; +drop procedure p1; +drop table t1, t2; diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c index fd5a4908572..d5346d530c3 100644 --- a/mysys/my_alloc.c +++ b/mysys/my_alloc.c @@ -221,6 +221,57 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size) #endif } + +/* + Allocate many pointers at the same time. + + DESCRIPTION + ptr1, ptr2, etc all point into big allocated memory area. + + SYNOPSIS + multi_alloc_root() + root Memory root + ptr1, length1 Multiple arguments terminated by a NULL pointer + ptr2, length2 ... + ... + NULL + + RETURN VALUE + A pointer to the beginning of the allocated memory block + in case of success or NULL if out of memory. +*/ + +gptr multi_alloc_root(MEM_ROOT *root, ...) +{ + va_list args; + char **ptr, *start, *res; + uint tot_length, length; + DBUG_ENTER("multi_alloc_root"); + + va_start(args, root); + tot_length= 0; + while ((ptr= va_arg(args, char **))) + { + length= va_arg(args, uint); + tot_length+= ALIGN_SIZE(length); + } + va_end(args); + + if (!(start= (char*) alloc_root(root, tot_length))) + DBUG_RETURN(0); /* purecov: inspected */ + + va_start(args, root); + res= start; + while ((ptr= va_arg(args, char **))) + { + *ptr= res; + length= va_arg(args, uint); + res+= ALIGN_SIZE(length); + } + va_end(args); + DBUG_RETURN((gptr) start); +} + #define TRASH_MEM(X) TRASH(((char*)(X) + ((X)->size-(X)->left)), (X)->left) /* Mark all data in blocks free for reusage */ diff --git a/sql/Makefile.am b/sql/Makefile.am index 4824a75d6fa..60c485d79f9 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -61,7 +61,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ tztime.h my_decimal.h\ sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h \ parse_file.h sql_view.h sql_trigger.h \ - sql_array.h \ + sql_array.h sql_cursor.h \ examples/ha_example.h examples/ha_archive.h \ examples/ha_tina.h ha_blackhole.h \ ha_federated.h @@ -94,7 +94,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \ client.c sql_client.cc mini_client_errors.c pack.c\ stacktrace.c repl_failsafe.h repl_failsafe.cc \ sql_olap.cc sql_view.cc \ - gstream.cc spatial.cc sql_help.cc protocol_cursor.cc \ + gstream.cc spatial.cc sql_help.cc sql_cursor.cc \ tztime.cc my_time.c my_decimal.cc\ sp_head.cc sp_pcontext.cc sp_rcontext.cc sp.cc \ sp_cache.cc parse_file.cc sql_trigger.cc \ diff --git a/sql/handler.cc b/sql/handler.cc index b3754891d05..52edc6d8623 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1339,11 +1339,9 @@ int handler::ha_open(const char *name, int mode, int test_if_locked) table->db_stat|=HA_READ_ONLY; (void) extra(HA_EXTRA_NO_READCHECK); // Not needed in SQL - if (!alloc_root_inited(&table->mem_root)) // If temporary table - ref=(byte*) sql_alloc(ALIGN_SIZE(ref_length)*2); - else - ref=(byte*) alloc_root(&table->mem_root, ALIGN_SIZE(ref_length)*2); - if (!ref) + DBUG_ASSERT(alloc_root_inited(&table->mem_root)); + + if (!(ref= (byte*) alloc_root(&table->mem_root, ALIGN_SIZE(ref_length)*2))) { close(); error=HA_ERR_OUT_OF_MEM; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 52a74b6f4c6..1ef3a92f548 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -1468,7 +1468,7 @@ int subselect_single_select_engine::prepare() int subselect_union_engine::prepare() { - return unit->prepare(thd, result, SELECT_NO_UNLOCK, ""); + return unit->prepare(thd, result, SELECT_NO_UNLOCK); } int subselect_uniquesubquery_engine::prepare() diff --git a/sql/protocol.h b/sql/protocol.h index 2717d2258fa..c00bbba4cc9 100644 --- a/sql/protocol.h +++ b/sql/protocol.h @@ -150,30 +150,6 @@ public: virtual bool store(Field *field); }; -class Protocol_cursor :public Protocol_simple -{ -public: - MEM_ROOT *alloc; - MYSQL_FIELD *fields; - MYSQL_ROWS *data; - MYSQL_ROWS **prev_record; - ulong row_count; - - Protocol_cursor() :data(NULL) {} - Protocol_cursor(THD *thd_arg, MEM_ROOT *ini_alloc) :Protocol_simple(thd_arg), alloc(ini_alloc), data(NULL) {} - bool prepare_for_send(List *item_list) - { - row_count= 0; - fields= NULL; - data= NULL; - prev_record= &data; - return Protocol_simple::prepare_for_send(item_list); - } - bool send_fields(List *list, uint flags); - bool write(); - uint get_field_count() { return field_count; } -}; - void send_warning(THD *thd, uint sql_errno, const char *err=0); void net_printf_error(THD *thd, uint sql_errno, ...); void net_send_error(THD *thd, uint sql_errno=0, const char *err=0); diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 1a7599d7bbc..1b0d0254da0 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -199,11 +199,18 @@ sp_eval_func_item(THD *thd, Item **it_addr, enum enum_field_types type, Item *it= sp_prepare_func_item(thd, it_addr); uint rsize; Query_arena backup_arena; + Item *old_item_next, *old_free_list, **p_free_list; DBUG_PRINT("info", ("type: %d", type)); if (!it) - { DBUG_RETURN(NULL); + + if (reuse) + { + old_item_next= reuse->next; + p_free_list= use_callers_arena ? &thd->spcont->callers_arena->free_list : + &thd->free_list; + old_free_list= *p_free_list; } switch (sp_map_result_type(type)) { @@ -312,15 +319,23 @@ sp_eval_func_item(THD *thd, Item **it_addr, enum enum_field_types type, default: DBUG_ASSERT(0); } - it->rsize= rsize; - - DBUG_RETURN(it); + goto end; return_null_item: CREATE_ON_CALLERS_ARENA(it= new(reuse, &rsize) Item_null(), use_callers_arena, &backup_arena); +end: it->rsize= rsize; + if (reuse && it == reuse) + { + /* + The Item constructor registered itself in the arena free list, + while the item slot is reused, so we have to restore the list. + */ + it->next= old_item_next; + *p_free_list= old_free_list; + } DBUG_RETURN(it); } @@ -1358,14 +1373,6 @@ int sp_head::execute_procedure(THD *thd, List *args) uint offset= static_cast(it)->get_offset(); Item *val= nctx->get_item(i); Item *orig= octx->get_item(offset); - Item *o_item_next; - /* we'll use callers_arena in sp_eval_func_item */ - Item *o_free_list= thd->spcont->callers_arena->free_list; - - LINT_INIT(o_item_next); - - if (orig) - o_item_next= orig->next; /* We might need to allocate new item if we weren't able to @@ -1380,15 +1387,6 @@ int sp_head::execute_procedure(THD *thd, List *args) } if (copy != orig) octx->set_item(offset, copy); - if (orig && copy == orig) - { - /* - A reused item slot, where the constructor put it in the - free_list, so we have to restore the list. - */ - thd->spcont->callers_arena->free_list= o_free_list; - copy->next= o_item_next; - } } else { @@ -2476,6 +2474,10 @@ sp_instr_cpop::backpatch(uint dest, sp_pcontext *dst_ctx) int sp_instr_copen::execute(THD *thd, uint *nextp) { + /* + We don't store a pointer to the cursor in the instruction to be + able to reuse the same instruction among different threads in future. + */ sp_cursor *c= thd->spcont->get_cursor(m_cursor); int res; DBUG_ENTER("sp_instr_copen::execute"); @@ -2484,41 +2486,33 @@ sp_instr_copen::execute(THD *thd, uint *nextp) res= -1; else { - sp_lex_keeper *lex_keeper= c->pre_open(thd); - if (!lex_keeper) // cursor already open or OOM - { - res= -1; - *nextp= m_ip+1; - } - else - { - Query_arena *old_arena= thd->stmt_arena; + sp_lex_keeper *lex_keeper= c->get_lex_keeper(); + Query_arena *old_arena= thd->stmt_arena; - /* - Get the Query_arena from the cpush instruction, which contains - the free_list of the query, so new items (if any) are stored in - the right free_list, and we can cleanup after each open. - */ - thd->stmt_arena= c->get_instr(); - res= lex_keeper->reset_lex_and_exec_core(thd, nextp, FALSE, this); - /* Cleanup the query's items */ - if (thd->stmt_arena->free_list) - cleanup_items(thd->stmt_arena->free_list); - thd->stmt_arena= old_arena; - /* - Work around the fact that errors in selects are not returned properly - (but instead converted into a warning), so if a condition handler - caught, we have lost the result code. - */ - if (!res) - { - uint dummy1, dummy2; + /* + Get the Query_arena from the cpush instruction, which contains + the free_list of the query, so new items (if any) are stored in + the right free_list, and we can cleanup after each open. + */ + thd->stmt_arena= c->get_instr(); + res= lex_keeper->reset_lex_and_exec_core(thd, nextp, FALSE, this); + /* Cleanup the query's items */ + if (thd->stmt_arena->free_list) + cleanup_items(thd->stmt_arena->free_list); + thd->stmt_arena= old_arena; + /* + Work around the fact that errors in selects are not returned properly + (but instead converted into a warning), so if a condition handler + caught, we have lost the result code. + */ + if (!res) + { + uint dummy1, dummy2; - if (thd->spcont->found_handler(&dummy1, &dummy2)) - res= -1; - } - c->post_open(thd, res ? FALSE : TRUE); + if (thd->spcont->found_handler(&dummy1, &dummy2)) + res= -1; } + /* TODO: Assert here that we either have an error or a cursor */ } DBUG_RETURN(res); } @@ -2527,7 +2521,8 @@ sp_instr_copen::execute(THD *thd, uint *nextp) int sp_instr_copen::exec_core(THD *thd, uint *nextp) { - int res= mysql_execute_command(thd); + sp_cursor *c= thd->spcont->get_cursor(m_cursor); + int res= c->open(thd); *nextp= m_ip+1; return res; } @@ -2582,14 +2577,7 @@ sp_instr_cfetch::execute(THD *thd, uint *nextp) Query_arena backup_arena; DBUG_ENTER("sp_instr_cfetch::execute"); - if (! c) - res= -1; - else - { - thd->set_n_backup_active_arena(thd->spcont->callers_arena, &backup_arena); - res= c->fetch(thd, &m_varlist); - thd->restore_active_arena(thd->spcont->callers_arena, &backup_arena); - } + res= c ? c->fetch(thd, &m_varlist) : -1; *nextp= m_ip+1; DBUG_RETURN(res); diff --git a/sql/sp_head.h b/sql/sp_head.h index 9888fe74149..f8d2a39458e 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -860,6 +860,12 @@ public: virtual void print(String *str); + /* + This call is used to cleanup the instruction when a sensitive + cursor is closed. For now stored procedures always use materialized + cursors and the call is not used. + */ + virtual void cleanup_stmt() { /* no op */ } private: sp_lex_keeper m_lex_keeper; @@ -1041,4 +1047,7 @@ sp_add_to_query_tables(THD *thd, LEX *lex, const char *db, const char *name, thr_lock_type locktype); +Item *sp_eval_func_item(THD *thd, Item **it, enum_field_types type, + Item *reuse, bool use_callers_arena); + #endif /* _SP_HEAD_H_ */ diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc index 748c09f56c7..fcb7719aeb1 100644 --- a/sql/sp_rcontext.cc +++ b/sql/sp_rcontext.cc @@ -25,6 +25,7 @@ #include "mysql.h" #include "sp_head.h" +#include "sql_cursor.h" #include "sp_rcontext.h" #include "sp_pcontext.h" @@ -45,31 +46,18 @@ int sp_rcontext::set_item_eval(THD *thd, uint idx, Item **item_addr, enum_field_types type) { - extern Item *sp_eval_func_item(THD *thd, Item **it, enum_field_types type, - Item *reuse, bool use_callers_arena); Item *it; Item *reuse_it; - Item *old_item_next; /* sp_eval_func_item will use callers_arena */ - Item *old_free_list= thd->spcont->callers_arena->free_list; int res; - LINT_INIT(old_item_next); - if ((reuse_it= get_item(idx))) - old_item_next= reuse_it->next; + reuse_it= get_item(idx); it= sp_eval_func_item(thd, item_addr, type, reuse_it, TRUE); if (! it) res= -1; else { res= 0; - if (reuse_it && it == reuse_it) - { - // A reused item slot, where the constructor put it in the free_list, - // so we have to restore the list. - thd->spcont->callers_arena->free_list= old_free_list; - it->next= old_item_next; - } set_item(idx, it); } @@ -170,7 +158,8 @@ sp_rcontext::pop_cursors(uint count) */ sp_cursor::sp_cursor(sp_lex_keeper *lex_keeper, sp_instr_cpush *i) - :m_lex_keeper(lex_keeper), m_prot(NULL), m_isopen(0), m_current_row(NULL), + :m_lex_keeper(lex_keeper), + server_side_cursor(NULL), m_i(i) { /* @@ -182,59 +171,37 @@ sp_cursor::sp_cursor(sp_lex_keeper *lex_keeper, sp_instr_cpush *i) /* - pre_open cursor + Open an SP cursor SYNOPSIS - pre_open() - THD Thread handler + open() + THD Thread handler - NOTES - We have to open cursor in two steps to make it easy for sp_instr_copen - to reuse the sp_instr::exec_stmt() code. - If this function returns 0, post_open should not be called RETURN - 0 ERROR + 0 in case of success, -1 otherwise */ -sp_lex_keeper* -sp_cursor::pre_open(THD *thd) +int +sp_cursor::open(THD *thd) { - if (m_isopen) + if (server_side_cursor) { my_message(ER_SP_CURSOR_ALREADY_OPEN, ER(ER_SP_CURSOR_ALREADY_OPEN), MYF(0)); - return NULL; + return -1; } - init_alloc_root(&m_mem_root, MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC); - if ((m_prot= new Protocol_cursor(thd, &m_mem_root)) == NULL) - return NULL; - - /* Save for execution. Will be restored in post_open */ - m_oprot= thd->protocol; - m_nseof= thd->net.no_send_eof; - - /* Change protocol for execution */ - thd->protocol= m_prot; - thd->net.no_send_eof= TRUE; - return m_lex_keeper; -} - - -void -sp_cursor::post_open(THD *thd, my_bool was_opened) -{ - thd->net.no_send_eof= m_nseof; // Restore the originals - thd->protocol= m_oprot; - if ((m_isopen= was_opened)) - m_current_row= m_prot->data; + if (mysql_open_cursor(thd, (uint) ALWAYS_MATERIALIZED_CURSOR, &result, + &server_side_cursor)) + return -1; + return 0; } int sp_cursor::close(THD *thd) { - if (! m_isopen) + if (! server_side_cursor) { my_message(ER_SP_CURSOR_NOT_OPEN, ER(ER_SP_CURSOR_NOT_OPEN), MYF(0)); return -1; @@ -247,106 +214,82 @@ sp_cursor::close(THD *thd) void sp_cursor::destroy() { - if (m_prot) - { - delete m_prot; - m_prot= NULL; - free_root(&m_mem_root, MYF(0)); - } - m_isopen= FALSE; + delete server_side_cursor; + server_side_cursor= 0; } + int sp_cursor::fetch(THD *thd, List *vars) { - List_iterator_fast li(*vars); - sp_pvar_t *pv; - MYSQL_ROW row; - uint fldcount; - - if (! m_isopen) + if (! server_side_cursor) { my_message(ER_SP_CURSOR_NOT_OPEN, ER(ER_SP_CURSOR_NOT_OPEN), MYF(0)); return -1; } - if (m_current_row == NULL) - { - my_message(ER_SP_FETCH_NO_DATA, ER(ER_SP_FETCH_NO_DATA), MYF(0)); - return -1; - } - - row= m_current_row->data; - for (fldcount= 0 ; (pv= li++) ; fldcount++) - { - Item *it; - Item *reuse; - uint rsize; - Item *old_item_next; - Item *old_free_list= thd->free_list; - const char *s; - LINT_INIT(old_item_next); - - if (fldcount >= m_prot->get_field_count()) - { - my_message(ER_SP_WRONG_NO_OF_FETCH_ARGS, - ER(ER_SP_WRONG_NO_OF_FETCH_ARGS), MYF(0)); - return -1; - } - - if ((reuse= thd->spcont->get_item(pv->offset))) - old_item_next= reuse->next; - - s= row[fldcount]; - if (!s) - it= new(reuse, &rsize) Item_null(); - else - { - /* - Length of data can be calculated as: - pointer_to_next_not_null_object - s -1 - where the last -1 is to remove the end \0 - */ - uint len; - MYSQL_ROW next= row+fldcount+1; - while (!*next) // Skip nulls - next++; - len= (*next -s)-1; - switch (sp_map_result_type(pv->type)) { - case INT_RESULT: - it= new(reuse, &rsize) Item_int(s); - break; - case REAL_RESULT: - it= new(reuse, &rsize) Item_float(s, len); - break; - case DECIMAL_RESULT: - it= new(reuse, &rsize) Item_decimal(s, len, thd->db_charset); - break; - case STRING_RESULT: - /* TODO: Document why we do an extra copy of the string 's' here */ - it= new(reuse, &rsize) Item_string(thd->strmake(s, len), len, - thd->db_charset); - break; - case ROW_RESULT: - default: - DBUG_ASSERT(0); - } - } - it->rsize= rsize; - if (reuse && it == reuse) - { - // A reused item slot, where the constructor put it in the free_list, - // so we have to restore the list. - thd->free_list= old_free_list; - it->next= old_item_next; - } - thd->spcont->set_item(pv->offset, it); - } - if (fldcount < m_prot->get_field_count()) + if (vars->elements != result.get_field_count()) { my_message(ER_SP_WRONG_NO_OF_FETCH_ARGS, ER(ER_SP_WRONG_NO_OF_FETCH_ARGS), MYF(0)); return -1; } - m_current_row= m_current_row->next; + + result.set_spvar_list(vars); + + /* Attempt to fetch one row */ + if (server_side_cursor->is_open()) + server_side_cursor->fetch(1); + + /* + If the cursor was pointing after the last row, the fetch will + close it instead of sending any rows. + */ + if (! server_side_cursor->is_open()) + { + my_message(ER_SP_FETCH_NO_DATA, ER(ER_SP_FETCH_NO_DATA), MYF(0)); + return -1; + } + return 0; } + + +/*************************************************************************** + Select_fetch_into_spvars +****************************************************************************/ + +int Select_fetch_into_spvars::prepare(List &fields, SELECT_LEX_UNIT *u) +{ + /* + Cache the number of columns in the result set in order to easily + return an error if column count does not match value count. + */ + field_count= fields.elements; + return select_result_interceptor::prepare(fields, u); +} + + +bool Select_fetch_into_spvars::send_data(List &items) +{ + List_iterator_fast pv_iter(*spvar_list); + List_iterator_fast item_iter(items); + sp_pvar_t *pv; + Item *item; + + /* Must be ensured by the caller */ + DBUG_ASSERT(spvar_list->elements == items.elements); + + /* + Assign the row fetched from a server side cursor to stored + procedure variables. + */ + for (; pv= pv_iter++, item= item_iter++; ) + { + Item *reuse= thd->spcont->get_item(pv->offset); + /* Evaluate a new item on the arena of the calling instruction */ + Item *it= sp_eval_func_item(thd, &item, pv->type, reuse, TRUE); + + thd->spcont->set_item(pv->offset, it); + } + return FALSE; +} diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h index 36380952e5d..9c0fa88fe34 100644 --- a/sql/sp_rcontext.h +++ b/sql/sp_rcontext.h @@ -216,6 +216,27 @@ private: }; // class sp_rcontext : public Sql_alloc +/* + An interceptor of cursor result set used to implement + FETCH INTO . +*/ + +class Select_fetch_into_spvars: public select_result_interceptor +{ + List *spvar_list; + uint field_count; +public: + uint get_field_count() { return field_count; } + void set_spvar_list(List *vars) { spvar_list= vars; } + + virtual bool send_eof() { return FALSE; } + virtual bool send_data(List &items); + virtual int prepare(List &list, SELECT_LEX_UNIT *u); +}; + + +/* A mediator between stored procedures and server side cursors */ + class sp_cursor : public Sql_alloc { public: @@ -227,12 +248,11 @@ public: destroy(); } - // We have split this in two to make it easy for sp_instr_copen - // to reuse the sp_instr::exec_stmt() code. sp_lex_keeper * - pre_open(THD *thd); - void - post_open(THD *thd, my_bool was_opened); + get_lex_keeper() { return m_lex_keeper; } + + int + open(THD *thd); int close(THD *thd); @@ -240,7 +260,7 @@ public: inline my_bool is_open() { - return m_isopen; + return test(server_side_cursor); } int @@ -251,18 +271,13 @@ public: { return m_i; } - + private: - MEM_ROOT m_mem_root; // My own mem_root + Select_fetch_into_spvars result; sp_lex_keeper *m_lex_keeper; - Protocol_cursor *m_prot; - my_bool m_isopen; - my_bool m_nseof; // Original no_send_eof - Protocol *m_oprot; // Original protcol - MYSQL_ROWS *m_current_row; + Server_side_cursor *server_side_cursor; sp_instr_cpush *m_i; // My push instruction - void destroy(); diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 2699a4fa628..2dcc0d5aad0 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1544,6 +1544,19 @@ void Query_arena::free_items() } +void Query_arena::set_query_arena(Query_arena *set) +{ + mem_root= set->mem_root; + free_list= set->free_list; + state= set->state; +} + + +void Query_arena::cleanup_stmt() +{ + DBUG_ASSERT("Query_arena::cleanup_stmt()" == "not implemented"); +} + /* Statement functions */ @@ -1601,12 +1614,6 @@ void Statement::restore_backup_statement(Statement *stmt, Statement *backup) } -void Statement::close_cursor() -{ - DBUG_ASSERT("Statement::close_cursor()" == "not implemented"); -} - - void THD::end_statement() { /* Cleanup SQL processing state to resuse this statement in next query. */ @@ -1648,13 +1655,6 @@ void THD::restore_active_arena(Query_arena *set, Query_arena *backup) DBUG_VOID_RETURN; } -void Query_arena::set_query_arena(Query_arena *set) -{ - mem_root= set->mem_root; - free_list= set->free_list; - state= set->state; -} - Statement::~Statement() { /* @@ -1723,9 +1723,11 @@ int Statement_map::insert(Statement *statement) void Statement_map::close_transient_cursors() { +#ifdef TO_BE_IMPLEMENTED Statement *stmt; while ((stmt= transient_cursor_list.head())) stmt->close_cursor(); /* deletes itself from the list */ +#endif } diff --git a/sql/sql_class.h b/sql/sql_class.h index 1a215d39841..c853162be2d 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -737,10 +737,12 @@ public: void set_query_arena(Query_arena *set); void free_items(); + /* Close the active state associated with execution of this statement */ + virtual void cleanup_stmt(); }; -class Cursor; +class Server_side_cursor; /* State of a single command executed against this connection. @@ -816,7 +818,7 @@ public: */ char *query; uint32 query_length; // current query length - Cursor *cursor; + Server_side_cursor *cursor; public: @@ -833,8 +835,6 @@ public: void restore_backup_statement(Statement *stmt, Statement *backup); /* return class type */ virtual Type type() const; - /* Close the cursor open for this statement, if there is one */ - virtual void close_cursor(); }; @@ -886,9 +886,6 @@ public: } hash_delete(&st_hash, (byte *) statement); } - void add_transient_cursor(Statement *stmt) - { transient_cursor_list.append(stmt); } - void erase_transient_cursor(Statement *stmt) { stmt->unlink(); } /* Close all cursors of this connection that use tables of a storage engine that has transaction-specific state and therefore can not @@ -1812,18 +1809,21 @@ public: } }; -class select_union :public select_result_interceptor { - public: - TABLE *table; +class select_union :public select_result_interceptor +{ TMP_TABLE_PARAM tmp_table_param; +public: + TABLE *table; - select_union(TABLE *table_par); - ~select_union(); + select_union() :table(0) {} int prepare(List &list, SELECT_LEX_UNIT *u); bool send_data(List &items); bool send_eof(); bool flush(); - void set_table(TABLE *tbl) { table= tbl; } + + bool create_result_table(THD *thd, List *column_types, + bool is_distinct, ulonglong options, + const char *alias); }; /* Base subselect interface class */ diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc new file mode 100644 index 00000000000..e8da691ea18 --- /dev/null +++ b/sql/sql_cursor.cc @@ -0,0 +1,660 @@ +/* Copyright (C) 2005 MySQL AB & MySQL Finland AB & TCX DataKonsult AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifdef USE_PRAGMA_IMPLEMENTATION +#pragma implementation /* gcc class implementation */ +#endif + +#include "mysql_priv.h" +#include "sql_cursor.h" +#include "sql_select.h" + +/**************************************************************************** + Declarations. +****************************************************************************/ + +/* + Sensitive_cursor -- a sensitive non-materialized server side + cursor An instance of this class cursor has its own runtime + state -- list of used items and memory root for runtime memory, + open and locked tables, change list for the changes of the + parsed tree. This state is freed when the cursor is closed. +*/ + +class Sensitive_cursor: public Server_side_cursor +{ + MEM_ROOT main_mem_root; + Query_arena *stmt_arena; + JOIN *join; + TABLE *open_tables; + MYSQL_LOCK *lock; + TABLE *derived_tables; + /* List of items created during execution */ + query_id_t query_id; + struct Engine_info + { + const handlerton *ht; + void *read_view; + }; + Engine_info ht_info[MAX_HA]; + Item_change_list change_list; + my_bool close_at_commit; + THR_LOCK_OWNER lock_id; +private: + /* bzero cursor state in THD */ + void reset_thd(THD *thd); +public: + Sensitive_cursor(THD *thd, select_result *result_arg); + + THR_LOCK_OWNER *get_lock_id() { return &lock_id; } + /* Save THD state into cursor */ + void post_open(THD *thd); + + virtual bool is_open() const { return join != 0; } + virtual int open(JOIN *join); + virtual void fetch(ulong num_rows); + virtual void close(); + virtual ~Sensitive_cursor(); +}; + + +/* + Materialized_cursor -- an insensitive materialized server-side + cursor. The result set of this cursor is saved in a temporary + table at open. The cursor itself is simply an interface for the + handler of the temporary table. +*/ + +class Materialized_cursor: public Server_side_cursor +{ + MEM_ROOT main_mem_root; + /* A fake unit to supply to select_send when fetching */ + SELECT_LEX_UNIT fake_unit; + TABLE *table; + List item_list; + ulong fetch_limit; + ulong fetch_count; +public: + Materialized_cursor(select_result *result, TABLE *table); + + virtual bool is_open() const { return table != 0; } + virtual int open(JOIN *join __attribute__((unused))); + virtual void fetch(ulong num_rows); + virtual void close(); + virtual ~Materialized_cursor(); +}; + + +/* + Select_materialize -- a mediator between a cursor query and the + protocol. In case we were not able to open a non-materialzed + cursor, it creates an internal temporary HEAP table, and insert + all rows into it. When the table reaches max_heap_table_size, + it's converted to a MyISAM table. Later this table is used to + create a Materialized_cursor. +*/ + +class Select_materialize: public select_union +{ + select_result *result; /* the result object of the caller (PS or SP) */ +public: + Select_materialize(select_result *result_arg) :result(result_arg) {} + virtual bool send_fields(List &list, uint flags); +}; + + +/**************************************************************************/ + +/* + Attempt to open a materialized or non-materialized cursor. + + SYNOPSIS + mysql_open_cursor() + thd thread handle + flags [in] create a materialized cursor or not + result [in] result class of the caller used as a destination + for the rows fetched from the cursor + pcursor [out] a pointer to store a pointer to cursor in + + RETURN VALUE + 0 the query has been successfully executed; in this + case pcursor may or may not contain + a pointer to an open cursor. + non-zero an error, 'pcursor' has been left intact. +*/ + +int mysql_open_cursor(THD *thd, uint flags, select_result *result, + Server_side_cursor **pcursor) +{ + Sensitive_cursor *sensitive_cursor; + select_result *save_result; + Select_materialize *result_materialize; + LEX *lex= thd->lex; + int rc; + + /* + The lifetime of the sensitive cursor is the same or less as the + lifetime of the runtime memory of the statement it's opened for. + */ + if (! (result_materialize= new (thd->mem_root) Select_materialize(result))) + return 1; + + if (! (sensitive_cursor= new (thd->mem_root) Sensitive_cursor(thd, result))) + { + delete result; + return 1; + } + + save_result= lex->result; + + lex->result= result_materialize; + if (! (flags & (uint) ALWAYS_MATERIALIZED_CURSOR)) + { + thd->lock_id= sensitive_cursor->get_lock_id(); + thd->cursor= sensitive_cursor; + } + + rc= mysql_execute_command(thd); + + lex->result= save_result; + thd->lock_id= &thd->main_lock_id; + thd->cursor= 0; + + /* + Possible options here: + - a sensitive cursor is open. In this case rc is 0 and + result_materialize->table is NULL, or + - a materialized cursor is open. In this case rc is 0 and + result_materialize->table is not NULL + - an error occured during materializaton. + result_materialize->table is not NULL, but rc != 0 + - successful completion of mysql_execute_command without + a cursor: rc is 0, result_materialize->table is NULL, + sensitive_cursor is not open. + This is possible if some command writes directly to the + network, bypassing select_result mechanism. An example of + such command is SHOW VARIABLES or SHOW STATUS. + */ + if (rc) + goto err_open; + + if (sensitive_cursor->is_open()) + { + DBUG_ASSERT(!result_materialize->table); + /* + It's safer if we grab THD state after mysql_execute_command + is finished and not in Sensitive_cursor::open(), because + currently the call to Sensitive_cursor::open is buried deep + in JOIN::exec of the top level join. + */ + sensitive_cursor->post_open(thd); + *pcursor= sensitive_cursor; + goto end; + } + else if (result_materialize->table) + { + Materialized_cursor *materialized_cursor; + TABLE *table= result_materialize->table; + MEM_ROOT *mem_root= &table->mem_root; + + if (!(materialized_cursor= new (mem_root) + Materialized_cursor(result, table))) + { + rc= 1; + goto err_open; + } + + if ((rc= materialized_cursor->open(0))) + { + delete materialized_cursor; + goto err_open; + } + + *pcursor= materialized_cursor; + thd->stmt_arena->cleanup_stmt(); + goto end; + } + +err_open: + DBUG_ASSERT(! (sensitive_cursor && sensitive_cursor->is_open())); + delete sensitive_cursor; + if (result_materialize->table) + free_tmp_table(thd, result_materialize->table); +end: + delete result_materialize; + return rc; +} + +/**************************************************************************** + Server_side_cursor +****************************************************************************/ + +Server_side_cursor::~Server_side_cursor() +{ +} + + +void Server_side_cursor::operator delete(void *ptr, size_t size) +{ + Server_side_cursor *cursor= (Server_side_cursor*) ptr; + MEM_ROOT own_root= *cursor->mem_root; + + DBUG_ENTER("Server_side_cursor::operator delete"); + TRASH(ptr, size); + /* + If this cursor has never been opened mem_root is empty. Otherwise + mem_root points to the memory the cursor object was allocated in. + In this case it's important to call free_root last, and free a copy + instead of *mem_root to avoid writing into freed memory. + */ + free_root(&own_root, MYF(0)); + DBUG_VOID_RETURN; +} + +/**************************************************************************** + Sensitive_cursor +****************************************************************************/ + +Sensitive_cursor::Sensitive_cursor(THD *thd, select_result *result_arg) + :Server_side_cursor(&main_mem_root, result_arg), + stmt_arena(0), + join(0), + close_at_commit(FALSE) +{ + /* We will overwrite it at open anyway. */ + init_sql_alloc(&main_mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0); + thr_lock_owner_init(&lock_id, &thd->lock_info); + bzero((void*) ht_info, sizeof(ht_info)); +} + + +void +Sensitive_cursor::post_open(THD *thd) +{ + Engine_info *info; + /* + We need to save and reset thd->mem_root, otherwise it'll be + freed later in mysql_parse. + + We can't just change thd->mem_root here as we want to keep the + things that are already allocated in thd->mem_root for + Sensitive_cursor::fetch() + */ + *mem_root= *thd->mem_root; + stmt_arena= thd->stmt_arena; + state= stmt_arena->state; + /* Allocate a new memory root for thd */ + init_sql_alloc(thd->mem_root, + thd->variables.query_alloc_block_size, + thd->variables.query_prealloc_size); + + /* + Save tables and zero THD pointers to prevent table close in + close_thread_tables. + */ + derived_tables= thd->derived_tables; + open_tables= thd->open_tables; + lock= thd->lock; + query_id= thd->query_id; + free_list= thd->free_list; + change_list= thd->change_list; + reset_thd(thd); + /* Now we have an active cursor and can cause a deadlock */ + thd->lock_info.n_cursors++; + + close_at_commit= FALSE; /* reset in case we're reusing the cursor */ + info= &ht_info[0]; + for (handlerton **pht= thd->transaction.stmt.ht; *pht; pht++) + { + const handlerton *ht= *pht; + close_at_commit|= test(ht->flags & HTON_CLOSE_CURSORS_AT_COMMIT); + if (ht->create_cursor_read_view) + { + info->ht= ht; + info->read_view= (ht->create_cursor_read_view)(); + ++info; + } + } + /* + XXX: thd->locked_tables is not changed. + What problems can we have with it if cursor is open? + TODO: must be fixed because of the prelocked mode. + */ +} + + +void +Sensitive_cursor::reset_thd(THD *thd) +{ + thd->derived_tables= 0; + thd->open_tables= 0; + thd->lock= 0; + thd->free_list= 0; + thd->change_list.empty(); +} + + +int +Sensitive_cursor::open(JOIN *join_arg) +{ + join= join_arg; + THD *thd= join->thd; + /* First non-constant table */ + JOIN_TAB *join_tab= join->join_tab + join->const_tables; + DBUG_ENTER("Sensitive_cursor::open"); + + join->change_result(result); + /* + Send fields description to the client; server_status is sent + in 'EOF' packet, which follows send_fields(). + We don't simply use SEND_EOF flag of send_fields because we also + want to flush the network buffer, which is done only in a standalone + send_eof(). + */ + result->send_fields(*join->fields, Protocol::SEND_NUM_ROWS); + thd->server_status|= SERVER_STATUS_CURSOR_EXISTS; + result->send_eof(); + thd->server_status&= ~SERVER_STATUS_CURSOR_EXISTS; + + /* Prepare JOIN for reading rows. */ + join->tmp_table= 0; + join->join_tab[join->tables-1].next_select= setup_end_select_func(join); + join->send_records= 0; + join->fetch_limit= join->unit->offset_limit_cnt; + + /* Disable JOIN CACHE as it is not working with cursors yet */ + for (JOIN_TAB *tab= join_tab; + tab != join->join_tab + join->tables - 1; + tab++) + { + if (tab->next_select == sub_select_cache) + tab->next_select= sub_select; + } + + DBUG_ASSERT(join_tab->table->reginfo.not_exists_optimize == 0); + DBUG_ASSERT(join_tab->not_used_in_distinct == 0); + /* + null_row is set only if row not found and it's outer join: should never + happen for the first table in join_tab list + */ + DBUG_ASSERT(join_tab->table->null_row == 0); + DBUG_RETURN(0); +} + + +/* + SYNOPSIS + Sensitive_cursor::fetch() + num_rows fetch up to this number of rows (maybe less) + + DESCRIPTION + Fetch next num_rows rows from the cursor and send them to the client + + Precondition: + Sensitive_cursor is open + + RETURN VALUES: + none, this function will send OK to the clinet or set an error + message in THD +*/ + +void +Sensitive_cursor::fetch(ulong num_rows) +{ + THD *thd= join->thd; + JOIN_TAB *join_tab= join->join_tab + join->const_tables; + enum_nested_loop_state error= NESTED_LOOP_OK; + Query_arena backup_arena; + Engine_info *info; + DBUG_ENTER("Sensitive_cursor::fetch"); + DBUG_PRINT("enter",("rows: %lu", num_rows)); + + DBUG_ASSERT(thd->derived_tables == 0 && thd->open_tables == 0 && + thd->lock == 0); + + thd->derived_tables= derived_tables; + thd->open_tables= open_tables; + thd->lock= lock; + thd->query_id= query_id; + thd->change_list= change_list; + /* save references to memory allocated during fetch */ + thd->set_n_backup_active_arena(this, &backup_arena); + + for (info= ht_info; info->read_view ; info++) + (info->ht->set_cursor_read_view)(info->read_view); + + join->fetch_limit+= num_rows; + + error= sub_select(join, join_tab, 0); + if (error == NESTED_LOOP_OK || error == NESTED_LOOP_NO_MORE_ROWS) + error= sub_select(join,join_tab,1); + if (error == NESTED_LOOP_QUERY_LIMIT) + error= NESTED_LOOP_OK; /* select_limit used */ + if (error == NESTED_LOOP_CURSOR_LIMIT) + join->resume_nested_loop= TRUE; + +#ifdef USING_TRANSACTIONS + ha_release_temporary_latches(thd); +#endif + /* Grab free_list here to correctly free it in close */ + thd->restore_active_arena(this, &backup_arena); + + change_list= thd->change_list; + reset_thd(thd); + + for (info= ht_info; info->read_view; info++) + (info->ht->set_cursor_read_view)(0); + + if (error == NESTED_LOOP_CURSOR_LIMIT) + { + /* Fetch limit worked, possibly more rows are there */ + thd->server_status|= SERVER_STATUS_CURSOR_EXISTS; + result->send_eof(); + thd->server_status&= ~SERVER_STATUS_CURSOR_EXISTS; + } + else + { + close(); + if (error == NESTED_LOOP_OK) + { + thd->server_status|= SERVER_STATUS_LAST_ROW_SENT; + result->send_eof(); + thd->server_status&= ~SERVER_STATUS_LAST_ROW_SENT; + } + else if (error != NESTED_LOOP_KILLED) + my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0)); + } + DBUG_VOID_RETURN; +} + + +void +Sensitive_cursor::close() +{ + THD *thd= join->thd; + DBUG_ENTER("Sensitive_cursor::close"); + + for (Engine_info *info= ht_info; info->read_view; info++) + { + (info->ht->close_cursor_read_view)(info->read_view); + info->read_view= 0; + info->ht= 0; + } + + thd->change_list= change_list; + { + /* + XXX: Another hack: we need to set THD state as if in a fetch to be + able to call stmt close. + */ + DBUG_ASSERT(lock || open_tables || derived_tables); + + TABLE *tmp_derived_tables= thd->derived_tables; + MYSQL_LOCK *tmp_lock= thd->lock; + + thd->open_tables= open_tables; + thd->derived_tables= derived_tables; + thd->lock= lock; + + /* Is expected to at least close tables and empty thd->change_list */ + stmt_arena->cleanup_stmt(); + + thd->open_tables= tmp_derived_tables; + thd->derived_tables= tmp_derived_tables; + thd->lock= tmp_lock; + } + thd->lock_info.n_cursors--; /* Decrease the number of active cursors */ + join= 0; + stmt_arena= 0; + free_items(); + change_list.empty(); + DBUG_VOID_RETURN; +} + + +Sensitive_cursor::~Sensitive_cursor() +{ + if (is_open()) + close(); +} + +/*************************************************************************** + Materialized_cursor +****************************************************************************/ + +Materialized_cursor::Materialized_cursor(select_result *result_arg, + TABLE *table_arg) + :Server_side_cursor(&table_arg->mem_root, result_arg), + table(table_arg), + fetch_limit(0), + fetch_count(0) +{ + fake_unit.init_query(); + fake_unit.thd= table->in_use; +} + + +int Materialized_cursor::open(JOIN *join __attribute__((unused))) +{ + THD *thd= fake_unit.thd; + int rc; + Query_arena backup_arena; + + thd->set_n_backup_active_arena(this, &backup_arena); + /* Create a list of fields and start sequential scan */ + rc= (table->fill_item_list(&item_list) || + result->prepare(item_list, &fake_unit) || + table->file->ha_rnd_init(TRUE)); + thd->restore_active_arena(this, &backup_arena); + return rc; +} + + +/* + Fetch up to the given number of rows from a materialized cursor. + + DESCRIPTION + Precondition: the cursor is open. + + If the cursor points after the last row, the fetch will automatically + close the cursor and not send any data (except the 'EOF' packet + with SERVER_STATUS_LAST_ROW_SENT). This is an extra round trip + and probably should be improved to return + SERVER_STATUS_LAST_ROW_SENT along with the last row. + + RETURN VALUE + none, in case of success the row is sent to the client, otherwise + an error message is set in THD +*/ + +void Materialized_cursor::fetch(ulong num_rows) +{ + THD *thd= table->in_use; + + int res= 0; + for (fetch_limit+= num_rows; fetch_count < fetch_limit; fetch_count++) + { + if ((res= table->file->rnd_next(table->record[0]))) + break; + /* Send data only if the read was successful. */ + result->send_data(item_list); + } + + switch (res) { + case 0: + thd->server_status|= SERVER_STATUS_CURSOR_EXISTS; + result->send_eof(); + thd->server_status&= ~SERVER_STATUS_CURSOR_EXISTS; + break; + case HA_ERR_END_OF_FILE: + thd->server_status|= SERVER_STATUS_LAST_ROW_SENT; + result->send_eof(); + thd->server_status&= ~SERVER_STATUS_LAST_ROW_SENT; + close(); + break; + default: + table->file->print_error(res, MYF(0)); + close(); + break; + } +} + + +void Materialized_cursor::close() +{ + /* Free item_list items */ + free_items(); + (void) table->file->ha_rnd_end(); + /* + We need to grab table->mem_root to prevent free_tmp_table from freeing: + the cursor object was allocated in this memory. + */ + main_mem_root= table->mem_root; + mem_root= &main_mem_root; + clear_alloc_root(&table->mem_root); + free_tmp_table(table->in_use, table); + table= 0; +} + + +Materialized_cursor::~Materialized_cursor() +{ + if (is_open()) + close(); +} + + +/*************************************************************************** + Select_materialize +****************************************************************************/ + +bool Select_materialize::send_fields(List &list, uint flags) +{ + bool rc; + DBUG_ASSERT(table == 0); + if (create_result_table(unit->thd, unit->get_unit_column_types(), + FALSE, thd->options | TMP_TABLE_ALL_COLUMNS, "")) + return TRUE; + /* + We can't simply supply SEND_EOF flag to send_fields, because send_fields + doesn't flush the network buffer. + */ + rc= result->send_fields(list, Protocol::SEND_NUM_ROWS); + thd->server_status|= SERVER_STATUS_CURSOR_EXISTS; + result->send_eof(); + thd->server_status&= ~SERVER_STATUS_CURSOR_EXISTS; + return rc; +} + diff --git a/sql/sql_cursor.h b/sql/sql_cursor.h new file mode 100644 index 00000000000..d1156dfba8d --- /dev/null +++ b/sql/sql_cursor.h @@ -0,0 +1,65 @@ +#ifndef _sql_cursor_h_ +#define _sql_cursor_h_ +/* Copyright (C) 2005 MySQL AB & MySQL Finland AB & TCX DataKonsult AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifdef USE_PRAGMA_INTERFACE +#pragma interface /* gcc class interface */ +#endif + +/* + Declarations for implementation of server side cursors. Only + read-only non-scrollable cursors are currently implemented. +*/ + +/* + Server_side_cursor -- an interface for materialized and + sensitive (non-materialized) implementation of cursors. All + cursors are self-contained (created in their own memory root). + For that reason they must be deleted only using a pointer to + Server_side_cursor, not to its base class. +*/ + +class Server_side_cursor: protected Query_arena, public Sql_alloc +{ +protected: + /* Row destination used for fetch */ + select_result *result; +public: + Server_side_cursor(MEM_ROOT *mem_root_arg, select_result *result_arg) + :Query_arena(mem_root_arg, INITIALIZED), result(result_arg) + {} + + virtual bool is_open() const= 0; + + virtual int open(JOIN *top_level_join)= 0; + virtual void fetch(ulong num_rows)= 0; + virtual void close()= 0; + virtual ~Server_side_cursor(); + + static void operator delete(void *ptr, size_t size); +}; + + +int mysql_open_cursor(THD *thd, uint flags, + select_result *result, + Server_side_cursor **res); + +/* Possible values for flags */ + +enum { ANY_CURSOR= 1, ALWAYS_MATERIALIZED_CURSOR= 2 }; + +#endif /* _sql_cusor_h_ */ diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 7b9191cd841..74b239e1637 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -27,7 +27,7 @@ /* - call given derived table processor (preparing or filling tables) + Call given derived table processor (preparing or filling tables) SYNOPSIS mysql_handle_derived() @@ -36,7 +36,6 @@ RETURN 0 ok - -1 Error 1 Error and error message given */ @@ -97,14 +96,14 @@ out: RETURN 0 ok - 1 Error - -1 Error and error message given - */ + 1 Error and an error message was given +*/ int mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *orig_table_list) { SELECT_LEX_UNIT *unit= orig_table_list->derived; int res= 0; + ulonglong create_options; DBUG_ENTER("mysql_derived_prepare"); if (unit) { @@ -118,21 +117,18 @@ int mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *orig_table_list) for (SELECT_LEX *sl= first_select; sl; sl= sl->next_select()) sl->context.outer_context= 0; - if (!(derived_result= new select_union(0))) + if (!(derived_result= new select_union)) DBUG_RETURN(1); // out of memory // st_select_lex_unit::prepare correctly work for single select - if ((res= unit->prepare(thd, derived_result, 0, orig_table_list->alias))) + if ((res= unit->prepare(thd, derived_result, 0))) goto exit; - if (check_duplicate_names(unit->types, 0)) - { - res= -1; + if ((res= check_duplicate_names(unit->types, 0))) goto exit; - } - derived_result->tmp_table_param.init(); - derived_result->tmp_table_param.field_count= unit->types.elements; + create_options= (first_select->options | thd->options | + TMP_TABLE_ALL_COLUMNS); /* Temp table is created so that it hounours if UNION without ALL is to be processed @@ -143,18 +139,12 @@ int mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *orig_table_list) !unit->union_distinct->next_select() (i.e. it is union and last distinct SELECT is last SELECT of UNION). */ - if (!(table= create_tmp_table(thd, &derived_result->tmp_table_param, - unit->types, (ORDER*) 0, - FALSE, 1, - (first_select->options | thd->options | - TMP_TABLE_ALL_COLUMNS), - HA_POS_ERROR, - orig_table_list->alias))) - { - res= -1; + if ((res= derived_result->create_result_table(thd, &unit->types, FALSE, + create_options, + orig_table_list->alias))) goto exit; - } - derived_result->set_table(table); + + table= derived_result->table; exit: /* Hide "Unknown column" or "Unknown function" error */ @@ -231,9 +221,8 @@ exit: RETURN 0 ok - 1 Error - -1 Error and error message given - */ + 1 Error and an error message was given +*/ int mysql_derived_filling(THD *thd, LEX *lex, TABLE_LIST *orig_table_list) { diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 76ea7f5c270..7de3463e1e2 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -432,10 +432,6 @@ public: { return my_reinterpret_cast(st_select_lex*)(slave); } - st_select_lex* first_select_in_union() - { - return my_reinterpret_cast(st_select_lex*)(slave); - } st_select_lex_unit* next_unit() { return my_reinterpret_cast(st_select_lex_unit*)(next); @@ -445,8 +441,7 @@ public: void exclude_tree(); /* UNION methods */ - bool prepare(THD *thd, select_result *result, ulong additional_options, - const char *tmp_table_alias); + bool prepare(THD *thd, select_result *result, ulong additional_options); bool exec(); bool cleanup(); inline void unclean() { cleaned= 0; } @@ -462,7 +457,10 @@ public: friend void lex_start(THD *thd, uchar *buf, uint length); friend int subselect_union_engine::exec(); + + List *get_unit_column_types(); }; + typedef class st_select_lex_unit SELECT_LEX_UNIT; /* diff --git a/sql/sql_list.h b/sql/sql_list.h index e4a34cc0aa1..285f1d6e501 100644 --- a/sql/sql_list.h +++ b/sql/sql_list.h @@ -32,6 +32,8 @@ public: { return (void*) sql_alloc((uint) size); } + static void *operator new[](size_t size, MEM_ROOT *mem_root) + { return (void*) alloc_root(mem_root, (uint) size); } static void *operator new(size_t size, MEM_ROOT *mem_root) { return (void*) alloc_root(mem_root, (uint) size); } static void operator delete(void *ptr, size_t size) { TRASH(ptr, size); } diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 6eea101de8f..f0b5c9cba1b 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -71,6 +71,7 @@ When one supplies long data for a placeholder: #include "mysql_priv.h" #include "sql_select.h" // for JOIN +#include "sql_cursor.h" #include "sp_head.h" #include "sp.h" #include "sp_cache.h" @@ -81,6 +82,18 @@ When one supplies long data for a placeholder: #include #endif +/* A result class used to send cursor rows using the binary protocol. */ + +class Select_fetch_protocol_prep: public select_send +{ + Protocol_prep protocol; +public: + Select_fetch_protocol_prep(THD *thd); + virtual bool send_fields(List &list, uint flags); + virtual bool send_data(List &items); + virtual bool send_eof(); +}; + /****************************************************************************** Prepared_statement: a statement that can contain placeholders ******************************************************************************/ @@ -89,6 +102,7 @@ class Prepared_statement: public Statement { public: THD *thd; + Select_fetch_protocol_prep result; Protocol *protocol; Item_param **param_array; uint param_count; @@ -109,8 +123,9 @@ public: virtual ~Prepared_statement(); void setup_set_params(); virtual Query_arena::Type type() const; - virtual void close_cursor(); + virtual void cleanup_stmt(); bool set_name(LEX_STRING *name); + inline void close_cursor() { delete cursor; cursor= 0; } bool prepare(const char *packet, uint packet_length); bool execute(String *expanded_query, bool open_cursor); @@ -140,8 +155,6 @@ inline bool is_param_null(const uchar *pos, ulong param_no) return pos[param_no/8] & (1 << (param_no & 7)); } -enum { STMT_QUERY_LOG_LENGTH= 8192 }; - /* Find a prepared statement in the statement map by id. @@ -1264,7 +1277,7 @@ static int mysql_test_select(Prepared_statement *stmt, It is not SELECT COMMAND for sure, so setup_tables will be called as usual, and we pass 0 as setup_tables_done_option */ - if (unit->prepare(thd, 0, 0, "")) + if (unit->prepare(thd, 0, 0)) goto error; if (!lex->describe && !text_protocol) { @@ -1395,7 +1408,7 @@ static bool select_like_stmt_test(Prepared_statement *stmt, thd->used_tables= 0; // Updated by setup_fields /* Calls JOIN::prepare */ - DBUG_RETURN(lex->unit.prepare(thd, 0, setup_tables_done_option, "")); + DBUG_RETURN(lex->unit.prepare(thd, 0, setup_tables_done_option)); } /* @@ -1785,19 +1798,6 @@ static bool init_param_array(Prepared_statement *stmt) } -/* Cleanup PS after execute/prepare and restore THD state */ - -static void cleanup_stmt_and_thd_after_use(Statement *stmt, THD *thd) -{ - DBUG_ENTER("cleanup_stmt_and_thd_after_use"); - stmt->lex->unit.cleanup(); - cleanup_items(stmt->free_list); - thd->rollback_item_tree_changes(); - thd->cleanup_after_query(); - DBUG_VOID_RETURN; -} - - /* COM_STMT_PREPARE handler. @@ -2221,16 +2221,14 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length) test(flags & (ulong) CURSOR_TYPE_READ_ONLY)); if (!(specialflag & SPECIAL_NO_PRIOR)) my_pthread_setprio(pthread_self(), WAIT_PRIOR); - if (rc) - goto err; - mysql_log.write(thd, COM_STMT_EXECUTE, "[%lu] %s", stmt->id, thd->query); + if (rc == 0) + mysql_log.write(thd, COM_STMT_EXECUTE, "[%lu] %s", stmt->id, thd->query); DBUG_VOID_RETURN; set_params_data_err: my_error(ER_WRONG_ARGUMENTS, MYF(0), "mysql_stmt_execute"); -err: reset_stmt_params(stmt); DBUG_VOID_RETURN; } @@ -2285,14 +2283,16 @@ void mysql_sql_stmt_execute(THD *thd) if (stmt->set_params_from_vars(stmt, lex->prepared_stmt_params, &expanded_query)) - { - my_error(ER_WRONG_ARGUMENTS, MYF(0), "EXECUTE"); - DBUG_VOID_RETURN; - } + goto set_params_data_err; (void) stmt->execute(&expanded_query, FALSE); DBUG_VOID_RETURN; + +set_params_data_err: + my_error(ER_WRONG_ARGUMENTS, MYF(0), "EXECUTE"); + reset_stmt_params(stmt); + DBUG_VOID_RETURN; } @@ -2313,7 +2313,7 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length) ulong num_rows= uint4korr(packet+4); Prepared_statement *stmt; Statement stmt_backup; - Cursor *cursor; + Server_side_cursor *cursor; DBUG_ENTER("mysql_stmt_fetch"); statistic_increment(thd->status_var.com_stmt_fetch, &LOCK_status); @@ -2321,7 +2321,7 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length) DBUG_VOID_RETURN; cursor= stmt->cursor; - if (!cursor || !cursor->is_open()) + if (!cursor) { my_error(ER_STMT_HAS_NO_OPEN_CURSOR, MYF(0), stmt_id); DBUG_VOID_RETURN; @@ -2333,25 +2333,16 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length) if (!(specialflag & SPECIAL_NO_PRIOR)) my_pthread_setprio(pthread_self(), QUERY_PRIOR); - thd->protocol= stmt->protocol; // Switch to binary protocol cursor->fetch(num_rows); - thd->protocol= &thd->protocol_simple; // Use normal protocol if (!(specialflag & SPECIAL_NO_PRIOR)) my_pthread_setprio(pthread_self(), WAIT_PRIOR); if (!cursor->is_open()) { - /* We're done with the fetch: reset PS for next execution */ - cleanup_stmt_and_thd_after_use(stmt, thd); + stmt->close_cursor(); + thd->cursor= 0; reset_stmt_params(stmt); - /* - Must be the last, as some memory is still needed for - the previous calls. - */ - free_root(cursor->mem_root, MYF(0)); - if (cursor->close_at_commit) - thd->stmt_map.erase_transient_cursor(stmt); } thd->restore_backup_statement(stmt, &stmt_backup); @@ -2384,14 +2375,19 @@ void mysql_stmt_reset(THD *thd, char *packet) /* There is always space for 4 bytes in buffer */ ulong stmt_id= uint4korr(packet); Prepared_statement *stmt; - Cursor *cursor; DBUG_ENTER("mysql_stmt_reset"); statistic_increment(thd->status_var.com_stmt_reset, &LOCK_status); if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_reset"))) DBUG_VOID_RETURN; - stmt->close_cursor(); /* will reset statement params */ + stmt->close_cursor(); + + /* + Clear parameters from data which could be set by + mysql_stmt_send_long_data() call. + */ + reset_stmt_params(stmt); stmt->state= Query_arena::PREPARED; @@ -2533,11 +2529,65 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length) } +/*************************************************************************** + Select_fetch_protocol_prep +****************************************************************************/ + +Select_fetch_protocol_prep::Select_fetch_protocol_prep(THD *thd) + :protocol(thd) +{} + +bool Select_fetch_protocol_prep::send_fields(List &list, uint flags) +{ + bool rc; + Protocol *save_protocol= thd->protocol; + + /* + Protocol::send_fields caches the information about column types: + this information is later used to send data. Therefore, the same + dedicated Protocol object must be used for all operations with + a cursor. + */ + thd->protocol= &protocol; + rc= select_send::send_fields(list, flags); + thd->protocol= save_protocol; + + return rc; +} + +bool Select_fetch_protocol_prep::send_eof() +{ + Protocol *save_protocol= thd->protocol; + + thd->protocol= &protocol; + ::send_eof(thd); + thd->protocol= save_protocol; + return FALSE; +} + + +bool +Select_fetch_protocol_prep::send_data(List &fields) +{ + Protocol *save_protocol= thd->protocol; + bool rc; + + thd->protocol= &protocol; + rc= select_send::send_data(fields); + thd->protocol= save_protocol; + return rc; +} + +/*************************************************************************** + Prepared_statement +****************************************************************************/ + Prepared_statement::Prepared_statement(THD *thd_arg, Protocol *protocol_arg) :Statement(INITIALIZED, ++thd_arg->statement_id_counter, thd_arg->variables.query_alloc_block_size, thd_arg->variables.query_prealloc_size), thd(thd_arg), + result(thd_arg), protocol(protocol_arg), param_array(0), param_count(0), @@ -2585,17 +2635,7 @@ Prepared_statement::~Prepared_statement() { DBUG_ENTER("Prepared_statement::~Prepared_statement"); DBUG_PRINT("enter",("stmt: %p cursor: %p", this, cursor)); - if (cursor) - { - if (cursor->is_open()) - { - cursor->close(FALSE); - cleanup_items(free_list); - thd->rollback_item_tree_changes(); - free_root(cursor->mem_root, MYF(0)); - } - cursor->Cursor::~Cursor(); - } + delete cursor; /* We have to call free on the items even if cleanup is called as some items, like Item_param, don't free everything until free_items() @@ -2612,25 +2652,18 @@ Query_arena::Type Prepared_statement::type() const } -void Prepared_statement::close_cursor() +void Prepared_statement::cleanup_stmt() { - DBUG_ENTER("Prepared_statement::close_cursor"); + DBUG_ENTER("Prepared_statement::cleanup_stmt"); DBUG_PRINT("enter",("stmt: %p", this)); - if (cursor && cursor->is_open()) - { - thd->change_list= cursor->change_list; - cursor->close(FALSE); - cleanup_stmt_and_thd_after_use(this, thd); - free_root(cursor->mem_root, MYF(0)); - if (cursor->close_at_commit) - thd->stmt_map.erase_transient_cursor(this); - } - /* - Clear parameters from data which could be set by - mysql_stmt_send_long_data() call. - */ - reset_stmt_params(this); + /* The order is important */ + lex->unit.cleanup(); + cleanup_items(free_list); + thd->cleanup_after_query(); + close_thread_tables(thd); + thd->rollback_item_tree_changes(); + DBUG_VOID_RETURN; } @@ -2734,14 +2767,13 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len) if (rc == 0) rc= check_prepared_statement(this, name.str != 0); - if (rc && thd->lex->sphead) + if (rc && lex->sphead) { - delete thd->lex->sphead; - thd->lex->sphead= NULL; + delete lex->sphead; + lex->sphead= NULL; } lex_end(lex); - close_thread_tables(thd); - cleanup_stmt_and_thd_after_use(this, thd); + cleanup_stmt(); thd->restore_backup_statement(this, &stmt_backup); thd->stmt_arena= old_stmt_arena; @@ -2781,7 +2813,7 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) Statement stmt_backup; Query_arena *old_stmt_arena; Item *old_free_list; - bool rc= 1; + bool rc= TRUE; statistic_increment(thd->status_var.com_stmt_execute, &LOCK_status); @@ -2789,18 +2821,35 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) if (state == Query_arena::ERROR) { my_message(last_errno, last_error, MYF(0)); - return 1; + return TRUE; } if (flags & IS_IN_USE) { my_error(ER_PS_NO_RECURSION, MYF(0)); - return 1; + return TRUE; } + + /* + For SHOW VARIABLES lex->result is NULL, as it's a non-SELECT + command. For such queries we don't return an error and don't + open a cursor -- the client library will recognize this case and + materialize the result set. + For SELECT statements lex->result is created in + check_prepared_statement. lex->result->simple_select() is FALSE + in INSERT ... SELECT and similar commands. + */ + + if (open_cursor && lex->result && !lex->result->simple_select()) + { + DBUG_PRINT("info",("Cursor asked for not SELECT stmt")); + my_error(ER_SP_BAD_CURSOR_QUERY, MYF(0)); + return TRUE; + } + /* In case the command has a call to SP which re-uses this statement name */ flags|= IS_IN_USE; - if (cursor && cursor->is_open()) - close_cursor(); + close_cursor(); /* If the free_list is not empty, we'll wrongly free some externally @@ -2808,32 +2857,6 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) */ DBUG_ASSERT(thd->change_list.is_empty()); DBUG_ASSERT(thd->free_list == NULL); - if (open_cursor) - { - if (!lex->result || !lex->result->simple_select()) - { - DBUG_PRINT("info",("Cursor asked for not SELECT stmt")); - /* - If lex->result is set in the parser, this is not a SELECT - statement: we can't open a cursor for it. - */ - my_error(ER_SP_BAD_CURSOR_QUERY, MYF(0)); - goto error; - } - - DBUG_PRINT("info",("Using READ_ONLY cursor")); - if (!cursor && !(cursor= new (mem_root) Cursor(thd))) - goto error; - /* If lex->result is set, mysql_execute_command will use it */ - lex->result= &cursor->result; - protocol= &cursor->protocol; - thd->lock_id= &cursor->lock_id; - /* - Currently cursors can be used only from C API, so - we don't have to create an own memory root for them: - the one in THD is clean and can be used. - */ - } thd->set_n_backup_statement(this, &stmt_backup); if (expanded_query->length() && alloc_query(thd, (char*) expanded_query->ptr(), @@ -2862,38 +2885,27 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) reinit_stmt_before_use(thd, lex); thd->protocol= protocol; /* activate stmt protocol */ - mysql_execute_command(thd); + rc= open_cursor ? mysql_open_cursor(thd, (uint) ALWAYS_MATERIALIZED_CURSOR, + &result, &cursor) : + mysql_execute_command(thd); thd->protocol= &thd->protocol_simple; /* use normal protocol */ - if (cursor && cursor->is_open()) - { - /* - It's safer if we grab THD state after mysql_execute_command is - finished and not in Cursor::open(), because currently the call to - Cursor::open is buried deep in JOIN::exec of the top level join. - */ - cursor->init_from_thd(thd); + /* Assert that if an error, no cursor is open */ + DBUG_ASSERT(! (rc && cursor)); - if (cursor->close_at_commit) - thd->stmt_map.add_transient_cursor(this); - } - else + if (! cursor) { - close_thread_tables(thd); - cleanup_stmt_and_thd_after_use(this, thd); + cleanup_stmt(); reset_stmt_params(this); } thd->set_statement(&stmt_backup); - thd->lock_id= &thd->main_lock_id; thd->stmt_arena= old_stmt_arena; if (state == Query_arena::PREPARED) state= Query_arena::EXECUTED; - rc= 0; error: - thd->lock_id= &thd->main_lock_id; flags&= ~IS_IN_USE; return rc; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 74c9b793886..e03879f0cbb 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -23,6 +23,7 @@ #include "mysql_priv.h" #include "sql_select.h" +#include "sql_cursor.h" #include #include @@ -107,20 +108,15 @@ static bool const_expression_in_where(COND *conds,Item *item, Item **comp_item); static bool open_tmp_table(TABLE *table); static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param, ulong options); -static Next_select_func setup_end_select_func(JOIN *join); static int do_select(JOIN *join,List *fields,TABLE *tmp_table, Procedure *proc); -static enum_nested_loop_state -sub_select_cache(JOIN *join, JOIN_TAB *join_tab, bool end_of_records); static enum_nested_loop_state evaluate_join_record(JOIN *join, JOIN_TAB *join_tab, int error, my_bool *report_error); static enum_nested_loop_state evaluate_null_complemented_join_record(JOIN *join, JOIN_TAB *join_tab); static enum_nested_loop_state -sub_select(JOIN *join,JOIN_TAB *join_tab, bool end_of_records); -static enum_nested_loop_state flush_cached_records(JOIN *join, JOIN_TAB *join_tab, bool skip_last); static enum_nested_loop_state end_send(JOIN *join, JOIN_TAB *join_tab, bool end_of_records); @@ -1716,262 +1712,6 @@ JOIN::destroy() DBUG_RETURN(error); } - -/************************* Cursor ******************************************/ - -Cursor::Cursor(THD *thd) - :Query_arena(&main_mem_root, INITIALIZED), - join(0), unit(0), - protocol(thd), - close_at_commit(FALSE) -{ - /* We will overwrite it at open anyway. */ - init_sql_alloc(&main_mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0); - thr_lock_owner_init(&lock_id, &thd->lock_info); - bzero((void*) ht_info, sizeof(ht_info)); -} - - -void -Cursor::init_from_thd(THD *thd) -{ - Engine_info *info; - /* - We need to save and reset thd->mem_root, otherwise it'll be freed - later in mysql_parse. - - We can't just change the thd->mem_root here as we want to keep the - things that are already allocated in thd->mem_root for Cursor::fetch() - */ - main_mem_root= *thd->mem_root; - state= thd->stmt_arena->state; - /* Allocate new memory root for thd */ - init_sql_alloc(thd->mem_root, - thd->variables.query_alloc_block_size, - thd->variables.query_prealloc_size); - - /* - The same is true for open tables and lock: save tables and zero THD - pointers to prevent table close in close_thread_tables (This is a part - of the temporary solution to make cursors work with minimal changes to - the current source base). - */ - derived_tables= thd->derived_tables; - open_tables= thd->open_tables; - lock= thd->lock; - query_id= thd->query_id; - free_list= thd->free_list; - change_list= thd->change_list; - reset_thd(thd); - /* Now we have an active cursor and can cause a deadlock */ - thd->lock_info.n_cursors++; - - close_at_commit= FALSE; /* reset in case we're reusing the cursor */ - info= &ht_info[0]; - for (handlerton **pht= thd->transaction.stmt.ht; *pht; pht++) - { - const handlerton *ht= *pht; - close_at_commit|= test(ht->flags & HTON_CLOSE_CURSORS_AT_COMMIT); - if (ht->create_cursor_read_view) - { - info->ht= ht; - info->read_view= (ht->create_cursor_read_view)(); - ++info; - } - } - /* - XXX: thd->locked_tables is not changed. - What problems can we have with it if cursor is open? - TODO: must be fixed because of the prelocked mode. - */ -} - - -void -Cursor::reset_thd(THD *thd) -{ - thd->derived_tables= 0; - thd->open_tables= 0; - thd->lock= 0; - thd->free_list= 0; - thd->change_list.empty(); -} - - -int -Cursor::open(JOIN *join_arg) -{ - join= join_arg; - THD *thd= join->thd; - /* First non-constant table */ - JOIN_TAB *join_tab= join->join_tab + join->const_tables; - DBUG_ENTER("Cursor::open"); - - /* - Send fields description to the client; server_status is sent - in 'EOF' packet, which ends send_fields(). - */ - thd->server_status|= SERVER_STATUS_CURSOR_EXISTS; - join->result->send_fields(*join->fields, Protocol::SEND_NUM_ROWS); - ::send_eof(thd); - thd->server_status&= ~SERVER_STATUS_CURSOR_EXISTS; - - /* Prepare JOIN for reading rows. */ - join->tmp_table= 0; - join->join_tab[join->tables-1].next_select= setup_end_select_func(join); - join->send_records= 0; - join->fetch_limit= join->unit->offset_limit_cnt; - - /* Disable JOIN CACHE as it is not working with cursors yet */ - for (JOIN_TAB *tab= join_tab; - tab != join->join_tab + join->tables - 1; - tab++) - { - if (tab->next_select == sub_select_cache) - tab->next_select= sub_select; - } - - DBUG_ASSERT(join_tab->table->reginfo.not_exists_optimize == 0); - DBUG_ASSERT(join_tab->not_used_in_distinct == 0); - /* - null_row is set only if row not found and it's outer join: should never - happen for the first table in join_tab list - */ - DBUG_ASSERT(join_tab->table->null_row == 0); - DBUG_RETURN(0); -} - - -/* - DESCRIPTION - Fetch next num_rows rows from the cursor and sent them to the client - PRECONDITION: - Cursor is open - RETURN VALUES: - none, this function will send error or OK to network if necessary. -*/ - -void -Cursor::fetch(ulong num_rows) -{ - THD *thd= join->thd; - JOIN_TAB *join_tab= join->join_tab + join->const_tables; - enum_nested_loop_state error= NESTED_LOOP_OK; - Query_arena backup_arena; - Engine_info *info; - DBUG_ENTER("Cursor::fetch"); - DBUG_PRINT("enter",("rows: %lu", num_rows)); - - DBUG_ASSERT(thd->derived_tables == 0 && thd->open_tables == 0 && - thd->lock == 0); - - thd->derived_tables= derived_tables; - thd->open_tables= open_tables; - thd->lock= lock; - thd->query_id= query_id; - thd->change_list= change_list; - /* save references to memory, allocated during fetch */ - thd->set_n_backup_active_arena(this, &backup_arena); - - for (info= ht_info; info->read_view ; info++) - (info->ht->set_cursor_read_view)(info->read_view); - - join->fetch_limit+= num_rows; - - error= sub_select(join, join_tab, 0); - if (error == NESTED_LOOP_OK || error == NESTED_LOOP_NO_MORE_ROWS) - error= sub_select(join,join_tab,1); - if (error == NESTED_LOOP_QUERY_LIMIT) - error= NESTED_LOOP_OK; /* select_limit used */ - if (error == NESTED_LOOP_CURSOR_LIMIT) - join->resume_nested_loop= TRUE; - -#ifdef USING_TRANSACTIONS - ha_release_temporary_latches(thd); -#endif - /* Grab free_list here to correctly free it in close */ - thd->restore_active_arena(this, &backup_arena); - - for (info= ht_info; info->read_view; info++) - (info->ht->set_cursor_read_view)(0); - - if (error == NESTED_LOOP_CURSOR_LIMIT) - { - /* Fetch limit worked, possibly more rows are there */ - thd->server_status|= SERVER_STATUS_CURSOR_EXISTS; - ::send_eof(thd); - thd->server_status&= ~SERVER_STATUS_CURSOR_EXISTS; - change_list= thd->change_list; - reset_thd(thd); - } - else - { - close(TRUE); - if (error == NESTED_LOOP_OK) - { - thd->server_status|= SERVER_STATUS_LAST_ROW_SENT; - ::send_eof(thd); - thd->server_status&= ~SERVER_STATUS_LAST_ROW_SENT; - } - else if (error != NESTED_LOOP_KILLED) - my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0)); - } - DBUG_VOID_RETURN; -} - - -void -Cursor::close(bool is_active) -{ - THD *thd= join->thd; - DBUG_ENTER("Cursor::close"); - - /* - In case of UNIONs JOIN is freed inside of unit->cleanup(), - otherwise in select_lex->cleanup(). - */ - if (unit) - (void) unit->cleanup(); - else - (void) join->select_lex->cleanup(); - - for (Engine_info *info= ht_info; info->read_view; info++) - { - (info->ht->close_cursor_read_view)(info->read_view); - info->read_view= 0; - info->ht= 0; - } - - if (is_active) - close_thread_tables(thd); - else - { - /* XXX: Another hack: closing tables used in the cursor */ - DBUG_ASSERT(lock || open_tables || derived_tables); - - TABLE *tmp_derived_tables= thd->derived_tables; - MYSQL_LOCK *tmp_lock= thd->lock; - - thd->open_tables= open_tables; - thd->derived_tables= derived_tables; - thd->lock= lock; - close_thread_tables(thd); - - thd->open_tables= tmp_derived_tables; - thd->derived_tables= tmp_derived_tables; - thd->lock= tmp_lock; - } - thd->lock_info.n_cursors--; /* Decrease the number of active cursors */ - join= 0; - unit= 0; - free_items(); - change_list.empty(); - DBUG_VOID_RETURN; -} - - -/*********************************************************************/ - /* An entry point to single-unit select (a select without UNION). @@ -2051,9 +1791,9 @@ mysql_select(THD *thd, Item ***rref_pointer_array, } else { - if (join->prepare(rref_pointer_array, tables, wild_num, - conds, og_num, order, group, having, proc_param, - select_lex, unit)) + if (err= join->prepare(rref_pointer_array, tables, wild_num, + conds, og_num, order, group, having, proc_param, + select_lex, unit)) { goto err; } @@ -2068,9 +1808,9 @@ mysql_select(THD *thd, Item ***rref_pointer_array, DBUG_RETURN(TRUE); thd->proc_info="init"; thd->used_tables=0; // Updated by setup_fields - if (join->prepare(rref_pointer_array, tables, wild_num, - conds, og_num, order, group, having, proc_param, - select_lex, unit)) + if (err= join->prepare(rref_pointer_array, tables, wild_num, + conds, og_num, order, group, having, proc_param, + select_lex, unit)) { goto err; } @@ -2112,7 +1852,7 @@ err: if (free_join) { thd->proc_info="end"; - err= select_lex->cleanup(); + err|= select_lex->cleanup(); DBUG_RETURN(err || thd->net.report_error); } DBUG_RETURN(join->error); @@ -5976,7 +5716,7 @@ void JOIN::join_free(bool full) cleanup(full); for (unit= select_lex->first_inner_unit(); unit; unit= unit->next_unit()) - for (sl= unit->first_select_in_union(); sl; sl= sl->next_select()) + for (sl= unit->first_select(); sl; sl= sl->next_select()) { JOIN *join= sl->join; if (join) @@ -8122,9 +7862,31 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, /* Create a temp table according to a field list. - Set distinct if duplicates could be removed - Given fields field pointers are changed to point at tmp_table - for send_fields + + SYNOPSIS + create_tmp_table() + thd thread handle + param a description used as input to create the table + fields list of items that will be used to define + column types of the table (also see NOTES) + group TODO document + distinct should table rows be distinct + save_sum_fields see NOTES + select_options + rows_limit + table_alias possible name of the temporary table that can be used + for name resolving; can be "". + + DESCRIPTION + Given field pointers are changed to point at tmp_table for + send_fields. The table object is self contained: it's + allocated in its own memory root, as well as Field objects + created for table columns. + This function will replace Item_sum items in 'fields' list with + corresponding Item_field items, pointing at the fields in the + temporary table, unless this was prohibited by TRUE + value of argument save_sum_fields. The Item_field objects + are created in THD memory root. */ #define STRING_TOTAL_LENGTH_TO_PACK_ROWS 128 @@ -8138,6 +7900,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, ulonglong select_options, ha_rows rows_limit, char *table_alias) { + MEM_ROOT *mem_root_save, own_root; TABLE *table; uint i,field_count,null_count,null_pack_length; uint hidden_null_count, hidden_null_pack_length, hidden_field_count; @@ -8202,29 +7965,33 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, field_count=param->field_count+param->func_count+param->sum_func_count; hidden_field_count=param->hidden_field_count; - if (!my_multi_malloc(MYF(MY_WME), - &table,sizeof(*table), - ®_field, sizeof(Field*)*(field_count+1), - &blob_field, sizeof(uint)*(field_count+1), - &from_field, sizeof(Field*)*field_count, - ©_func,sizeof(*copy_func)*(param->func_count+1), - ¶m->keyinfo,sizeof(*param->keyinfo), - &key_part_info, - sizeof(*key_part_info)*(param->group_parts+1), - ¶m->start_recinfo, - sizeof(*param->recinfo)*(field_count*2+4), - &tmpname,(uint) strlen(path)+1, - &group_buff,group && ! using_unique_constraint ? - param->group_length : 0, - NullS)) + + init_sql_alloc(&own_root, TABLE_ALLOC_BLOCK_SIZE, 0); + + if (!multi_alloc_root(&own_root, + &table, sizeof(*table), + ®_field, sizeof(Field*) * (field_count+1), + &blob_field, sizeof(uint)*(field_count+1), + &from_field, sizeof(Field*)*field_count, + ©_func, sizeof(*copy_func)*(param->func_count+1), + ¶m->keyinfo, sizeof(*param->keyinfo), + &key_part_info, + sizeof(*key_part_info)*(param->group_parts+1), + ¶m->start_recinfo, + sizeof(*param->recinfo)*(field_count*2+4), + &tmpname, (uint) strlen(path)+1, + &group_buff, group && ! using_unique_constraint ? + param->group_length : 0, + NullS)) { bitmap_clear_bit(&temp_pool, temp_pool_slot); DBUG_RETURN(NULL); /* purecov: inspected */ } - if (!(param->copy_field=copy=new Copy_field[field_count])) + /* Copy_field belongs to TMP_TABLE_PARAM, allocate it in THD mem_root */ + if (!(param->copy_field= copy= new (thd->mem_root) Copy_field[field_count])) { bitmap_clear_bit(&temp_pool, temp_pool_slot); - my_free((gptr) table,MYF(0)); /* purecov: inspected */ + free_root(&own_root, MYF(0)); /* purecov: inspected */ DBUG_RETURN(NULL); /* purecov: inspected */ } param->items_to_copy= copy_func; @@ -8234,6 +8001,11 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, bzero((char*) table,sizeof(*table)); bzero((char*) reg_field,sizeof(Field*)*(field_count+1)); bzero((char*) from_field,sizeof(Field*)*field_count); + + table->mem_root= own_root; + mem_root_save= thd->mem_root; + thd->mem_root= &table->mem_root; + table->field=reg_field; table->alias= table_alias; table->reginfo.lock_type=TL_WRITE; /* Will be updated */ @@ -8318,7 +8090,9 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, string_count++; string_total_length+= new_field->pack_length(); } + thd->mem_root= mem_root_save; thd->change_item_tree(argp, new Item_field(new_field)); + thd->mem_root= &table->mem_root; if (!(new_field->flags & NOT_NULL_FLAG)) { null_count++; @@ -8432,7 +8206,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, { uint alloc_length=ALIGN_SIZE(reclength+MI_UNIQUE_HASH_LENGTH+1); table->s->rec_buff_length= alloc_length; - if (!(table->record[0]= (byte *) my_malloc(alloc_length*3, MYF(MY_WME)))) + if (!(table->record[0]= (byte*) + alloc_root(&table->mem_root, alloc_length*3))) goto err; table->record[1]= table->record[0]+alloc_length; table->s->default_values= table->record[1]+alloc_length; @@ -8618,8 +8393,10 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, table->s->uniques= 1; } if (!(key_part_info= (KEY_PART_INFO*) - sql_calloc((keyinfo->key_parts)*sizeof(KEY_PART_INFO)))) + alloc_root(&table->mem_root, + keyinfo->key_parts * sizeof(KEY_PART_INFO)))) goto err; + bzero((void*) key_part_info, keyinfo->key_parts * sizeof(KEY_PART_INFO)); table->key_info=keyinfo; keyinfo->key_part=key_part_info; keyinfo->flags=HA_NOSAME | HA_NULL_ARE_EQUAL; @@ -8667,10 +8444,15 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, if (create_myisam_tmp_table(table,param,select_options)) goto err; } - if (!open_tmp_table(table)) - DBUG_RETURN(table); + if (open_tmp_table(table)) + goto err; - err: + thd->mem_root= mem_root_save; + + DBUG_RETURN(table); + +err: + thd->mem_root= mem_root_save; free_tmp_table(thd,table); /* purecov: inspected */ bitmap_clear_bit(&temp_pool, temp_pool_slot); DBUG_RETURN(NULL); /* purecov: inspected */ @@ -8815,11 +8597,12 @@ static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param, if (table->s->keys) { // Get keys for ni_create bool using_unique_constraint=0; - HA_KEYSEG *seg= (HA_KEYSEG*) sql_calloc(sizeof(*seg) * - keyinfo->key_parts); + HA_KEYSEG *seg= (HA_KEYSEG*) alloc_root(&table->mem_root, + sizeof(*seg) * keyinfo->key_parts); if (!seg) goto err; + bzero(seg, sizeof(*seg) * keyinfo->key_parts); if (keyinfo->key_length >= table->file->max_key_length() || keyinfo->key_parts > table->file->max_key_parts() || table->s->uniques) @@ -8916,13 +8699,14 @@ static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param, void free_tmp_table(THD *thd, TABLE *entry) { + MEM_ROOT own_root= entry->mem_root; const char *save_proc_info; DBUG_ENTER("free_tmp_table"); DBUG_PRINT("enter",("table: %s",entry->alias)); save_proc_info=thd->proc_info; thd->proc_info="removing tmp table"; - free_blobs(entry); + if (entry->file) { if (entry->db_stat) @@ -8943,12 +8727,11 @@ free_tmp_table(THD *thd, TABLE *entry) /* free blobs */ for (Field **ptr=entry->field ; *ptr ; ptr++) (*ptr)->free(); - my_free((gptr) entry->record[0],MYF(0)); free_io_cache(entry); bitmap_clear_bit(&temp_pool, entry->temp_pool_slot); - my_free((gptr) entry,MYF(0)); + free_root(&own_root, MYF(0)); /* the table is allocated in its own root */ thd->proc_info=save_proc_info; DBUG_VOID_RETURN; @@ -9063,7 +8846,7 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param, end_select function to use. This function can't fail. */ -static Next_select_func setup_end_select_func(JOIN *join) +Next_select_func setup_end_select_func(JOIN *join) { TABLE *table= join->tmp_table; Next_select_func end_select; @@ -9218,7 +9001,7 @@ do_select(JOIN *join,List *fields,TABLE *table,Procedure *procedure) } -static enum_nested_loop_state +enum_nested_loop_state sub_select_cache(JOIN *join,JOIN_TAB *join_tab,bool end_of_records) { enum_nested_loop_state rc; @@ -9359,7 +9142,7 @@ sub_select_cache(JOIN *join,JOIN_TAB *join_tab,bool end_of_records) return one of enum_nested_loop_state, except NESTED_LOOP_NO_MORE_ROWS. */ -static enum_nested_loop_state +enum_nested_loop_state sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records) { join_tab->table->null_row=0; @@ -13782,8 +13565,7 @@ bool mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit, select_result *result) unit->fake_select_lex->select_number= UINT_MAX; // jost for initialization unit->fake_select_lex->type= "UNION RESULT"; unit->fake_select_lex->options|= SELECT_DESCRIBE; - if (!(res= unit->prepare(thd, result, SELECT_NO_UNLOCK | SELECT_DESCRIBE, - ""))) + if (!(res= unit->prepare(thd, result, SELECT_NO_UNLOCK | SELECT_DESCRIBE))) res= unit->exec(); res|= unit->cleanup(); } diff --git a/sql/sql_select.h b/sql/sql_select.h index 47906c2697e..0dc4be8c104 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -101,7 +101,7 @@ enum enum_nested_loop_state typedef enum_nested_loop_state (*Next_select_func)(JOIN *, struct st_join_table *, bool); typedef int (*Read_record_func)(struct st_join_table *tab); - +Next_select_func setup_end_select_func(JOIN *join); typedef struct st_join_table { TABLE *table; @@ -140,6 +140,11 @@ typedef struct st_join_table { void cleanup(); } JOIN_TAB; +enum_nested_loop_state sub_select_cache(JOIN *join, JOIN_TAB *join_tab, bool + end_of_records); +enum_nested_loop_state sub_select(JOIN *join,JOIN_TAB *join_tab, bool + end_of_records); + typedef struct st_position /* Used in find_best */ { @@ -372,58 +377,6 @@ class JOIN :public Sql_alloc }; -/* - Server-side cursor (now stands only for basic read-only cursor) - See class implementation in sql_select.cc - A cursor has its own runtime state - list of used items and memory root of - used memory - which is different from Prepared statement runtime: it must - be different at least for the purpose of reusing the same prepared - statement for many cursors. -*/ - -class Cursor: public Sql_alloc, public Query_arena -{ - MEM_ROOT main_mem_root; - JOIN *join; - SELECT_LEX_UNIT *unit; - - TABLE *open_tables; - MYSQL_LOCK *lock; - TABLE *derived_tables; - /* List of items created during execution */ - query_id_t query_id; - struct Engine_info - { - const handlerton *ht; - void *read_view; - }; - Engine_info ht_info[MAX_HA]; -public: - Protocol_prep protocol; - Item_change_list change_list; - select_send result; - THR_LOCK_OWNER lock_id; - my_bool close_at_commit; - - /* Temporary implementation as now we replace THD state by value */ - /* Save THD state into cursor */ - void init_from_thd(THD *thd); - /* bzero cursor state in THD */ - void reset_thd(THD *thd); - - int open(JOIN *join); - void fetch(ulong num_rows); - void reset() { join= 0; } - bool is_open() const { return join != 0; } - - void close(bool is_active); - - void set_unit(SELECT_LEX_UNIT *unit_arg) { unit= unit_arg; } - Cursor(THD *thd); - ~Cursor() {} -}; - - typedef struct st_select_check { uint const_ref,reg_ref; } SELECT_CHECK; diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 556493f4fc8..951248e8cd8 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -23,6 +23,7 @@ #include "mysql_priv.h" #include "sql_select.h" +#include "sql_cursor.h" bool mysql_union(THD *thd, LEX *lex, select_result *result, SELECT_LEX_UNIT *unit, ulong setup_tables_done_option) @@ -30,13 +31,9 @@ bool mysql_union(THD *thd, LEX *lex, select_result *result, DBUG_ENTER("mysql_union"); bool res; if (!(res= unit->prepare(thd, result, SELECT_NO_UNLOCK | - setup_tables_done_option, ""))) + setup_tables_done_option))) res= unit->exec(); - if (!res && thd->cursor && thd->cursor->is_open()) - { - thd->cursor->set_unit(unit); - } - else + if (res || !thd->cursor || !thd->cursor->is_open()) res|= unit->cleanup(); DBUG_RETURN(res); } @@ -46,16 +43,6 @@ bool mysql_union(THD *thd, LEX *lex, select_result *result, ** store records in temporary table for UNION ***************************************************************************/ -select_union::select_union(TABLE *table_par) - :table(table_par) -{ -} - -select_union::~select_union() -{ -} - - int select_union::prepare(List &list, SELECT_LEX_UNIT *u) { unit= u; @@ -103,6 +90,45 @@ bool select_union::flush() return 0; } +/* + Create a temporary table to store the result of select_union. + + SYNOPSIS + select_union::create_result_table() + thd thread handle + column_types a list of items used to define columns of the + temporary table + is_union_distinct if set, the temporary table will eliminate + duplicates on insert + options create options + + DESCRIPTION + Create a temporary table that is used to store the result of a UNION, + derived table, or a materialized cursor. + + RETURN VALUE + 0 The table has been created successfully. + 1 create_tmp_table failed. +*/ + +bool +select_union::create_result_table(THD *thd, List *column_types, + bool is_union_distinct, ulonglong options, + const char *alias) +{ + DBUG_ASSERT(table == 0); + tmp_table_param.init(); + tmp_table_param.field_count= column_types->elements; + + if (! (table= create_tmp_table(thd, &tmp_table_param, *column_types, + (ORDER*) 0, is_union_distinct, 1, + options, HA_POS_ERROR, (char*) alias))) + return TRUE; + table->file->extra(HA_EXTRA_WRITE_CACHE); + table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); + return FALSE; +} + /* initialization procedures before fake_select_lex preparation() @@ -133,11 +159,10 @@ st_select_lex_unit::init_prepare_fake_select_lex(THD *thd) bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, - ulong additional_options, - const char *tmp_table_alias) + ulong additional_options) { SELECT_LEX *lex_select_save= thd_arg->lex->current_select; - SELECT_LEX *sl, *first_select; + SELECT_LEX *sl, *first_sl= first_select(); select_result *tmp_result; bool is_union; TABLE *empty_table= 0; @@ -156,7 +181,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, if (describe) { /* fast reinit for EXPLAIN */ - for (sl= first_select_in_union(); sl; sl= sl->next_select()) + for (sl= first_sl; sl; sl= sl->next_select()) { sl->join->result= result; select_limit_cnt= HA_POS_ERROR; @@ -175,17 +200,16 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, prepared= 1; res= FALSE; - thd_arg->lex->current_select= sl= first_select= first_select_in_union(); - found_rows_for_union= first_select->options & OPTION_FOUND_ROWS; - is_union= test(first_select->next_select()); + thd_arg->lex->current_select= sl= first_sl; + found_rows_for_union= first_sl->options & OPTION_FOUND_ROWS; + is_union= test(first_sl->next_select()); /* Global option */ if (is_union) { - if (!(tmp_result= union_result= new select_union(0))) + if (!(tmp_result= union_result= new select_union)) goto err; - union_result->tmp_table_param.init(); if (describe) tmp_result= sel_result; } @@ -238,8 +262,8 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, information about fields lengths and exact types */ if (!is_union) - types= first_select_in_union()->item_list; - else if (sl == first_select) + types= first_sl->item_list; + else if (sl == first_sl) { /* We need to create an empty table object. It is used @@ -287,7 +311,6 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, all collations together for UNION. */ List_iterator_fast tp(types); - Query_arena *arena= thd->stmt_arena; Item *type; ulonglong create_options; @@ -301,7 +324,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, } } - create_options= (first_select_in_union()->options | thd_arg->options | + create_options= (first_sl->options | thd_arg->options | TMP_TABLE_ALL_COLUMNS); /* Force the temporary table to be a MyISAM table if we're going to use @@ -312,47 +335,35 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, if (global_parameters->ftfunc_list->elements) create_options= create_options | TMP_TABLE_FORCE_MYISAM; - union_result->tmp_table_param.field_count= types.elements; - if (!(table= create_tmp_table(thd_arg, - &union_result->tmp_table_param, types, - (ORDER*) 0, (bool) union_distinct, 1, - create_options, HA_POS_ERROR, - (char *) tmp_table_alias))) + if (union_result->create_result_table(thd, &types, test(union_distinct), + create_options, "")) goto err; - table->file->extra(HA_EXTRA_WRITE_CACHE); - table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); bzero((char*) &result_table_list, sizeof(result_table_list)); result_table_list.db= (char*) ""; result_table_list.table_name= result_table_list.alias= (char*) "union"; - result_table_list.table= table; - union_result->set_table(table); + result_table_list.table= table= union_result->table; thd_arg->lex->current_select= lex_select_save; if (!item_list.elements) { - Field **field; - Query_arena *tmp_arena,backup; - tmp_arena= thd->activate_stmt_arena_if_needed(&backup); + Query_arena *arena, backup_arena; - for (field= table->field; *field; field++) + arena= thd->activate_stmt_arena_if_needed(&backup_arena); + + res= table->fill_item_list(&item_list); + + if (arena) + thd->restore_active_arena(arena, &backup_arena); + + if (res) + goto err; + + if (thd->stmt_arena->is_stmt_prepare()) { - Item_field *item= new Item_field(*field); - if (!item || item_list.push_back(item)) - { - if (tmp_arena) - thd->restore_active_arena(tmp_arena, &backup); - DBUG_RETURN(TRUE); - } - } - if (tmp_arena) - thd->restore_active_arena(tmp_arena, &backup); - if (arena->is_stmt_prepare_or_first_sp_execute()) - { - /* prepare fake select to initialize it correctly */ + /* Validate the global parameters of this union */ + init_prepare_fake_select_lex(thd); - /* - Should be done only once (the only item_list per statement). - */ + /* Should be done only once (the only item_list per statement) */ DBUG_ASSERT(fake_select_lex->join == 0); if (!(fake_select_lex->join= new JOIN(thd, item_list, thd->options, result))) @@ -375,19 +386,14 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, fake_select_lex->table_list.empty(); } } - else if (!arena->is_conventional()) + else { + DBUG_ASSERT(!thd->stmt_arena->is_conventional()); /* We're in execution of a prepared statement or stored procedure: reset field items to point at fields from the created temporary table. */ - List_iterator_fast it(item_list); - for (Field **field= table->field; *field; field++) - { - Item_field *item_field= (Item_field*) it++; - DBUG_ASSERT(item_field != 0); - item_field->reset_field(*field); - } + table->reset_item_list(&item_list); } } @@ -404,7 +410,7 @@ err: bool st_select_lex_unit::exec() { SELECT_LEX *lex_select_save= thd->lex->current_select; - SELECT_LEX *select_cursor=first_select_in_union(); + SELECT_LEX *select_cursor=first_select(); ulonglong add_rows=0; ha_rows examined_rows= 0; DBUG_ENTER("st_select_lex_unit::exec"); @@ -595,7 +601,7 @@ bool st_select_lex_unit::cleanup() table= 0; // Safety } - for (SELECT_LEX *sl= first_select_in_union(); sl; sl= sl->next_select()) + for (SELECT_LEX *sl= first_select(); sl; sl= sl->next_select()) error|= sl->cleanup(); if (fake_select_lex) @@ -652,7 +658,7 @@ bool st_select_lex_unit::change_result(select_subselect *result, select_subselect *old_result) { bool res= FALSE; - for (SELECT_LEX *sl= first_select_in_union(); sl; sl= sl->next_select()) + for (SELECT_LEX *sl= first_select(); sl; sl= sl->next_select()) { if (sl->join && sl->join->result == old_result) if (sl->join->change_result(result)) @@ -663,6 +669,36 @@ bool st_select_lex_unit::change_result(select_subselect *result, return (res); } +/* + Get column type information for this unit. + + SYNOPSIS + st_select_lex_unit::get_unit_column_types() + + DESCRIPTION + For a single-select the column types are taken + from the list of selected items. For a union this function + assumes that st_select_lex_unit::prepare has been called + and returns the type holders that were created for unioned + column types of all selects. + + NOTES + The implementation of this function should be in sync with + st_select_lex_unit::prepare() +*/ + +List *st_select_lex_unit::get_unit_column_types() +{ + bool is_union= test(first_select()->next_select()); + + if (is_union) + { + DBUG_ASSERT(prepared); + /* Types are generated during prepare */ + return &types; + } + return &first_select()->item_list; +} bool st_select_lex::cleanup() { diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 5155e605ce0..20f45ffc329 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -378,7 +378,7 @@ bool mysql_create_view(THD *thd, /* prepare select to resolve all fields */ lex->view_prepare_mode= 1; - if (unit->prepare(thd, 0, 0, view->view_name.str)) + if (unit->prepare(thd, 0, 0)) { /* some errors from prepare are reported to user, if is not then diff --git a/sql/table.cc b/sql/table.cc index c0d599bd8b4..86b3b0b0804 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1687,6 +1687,63 @@ db_type get_table_type(THD *thd, const char *name) DBUG_RETURN(ha_checktype(thd,(enum db_type) (uint) *(head+3),0,0)); } +/* + Create Item_field for each column in the table. + + SYNPOSIS + st_table::fill_item_list() + item_list a pointer to an empty list used to store items + + DESCRIPTION + Create Item_field object for each column in the table and + initialize it with the corresponding Field. New items are + created in the current THD memory root. + + RETURN VALUE + 0 success + 1 out of memory +*/ + +bool st_table::fill_item_list(List *item_list) const +{ + /* + All Item_field's created using a direct pointer to a field + are fixed in Item_field constructor. + */ + for (Field **ptr= field; *ptr; ptr++) + { + Item_field *item= new Item_field(*ptr); + if (!item || item_list->push_back(item)) + return TRUE; + } + return FALSE; +} + +/* + Reset an existing list of Item_field items to point to the + Fields of this table. + + SYNPOSIS + st_table::fill_item_list() + item_list a non-empty list with Item_fields + + DESCRIPTION + This is a counterpart of fill_item_list used to redirect + Item_fields to the fields of a newly created table. + The caller must ensure that number of items in the item_list + is the same as the number of columns in the table. +*/ + +void st_table::reset_item_list(List *item_list) const +{ + List_iterator_fast it(*item_list); + for (Field **ptr= field; *ptr; ptr++) + { + Item_field *item_field= (Item_field*) it++; + DBUG_ASSERT(item_field != 0); + item_field->reset_field(*ptr); + } +} /* calculate md5 of query diff --git a/sql/table.h b/sql/table.h index 43b6fddeee6..b01d774bf10 100644 --- a/sql/table.h +++ b/sql/table.h @@ -267,6 +267,9 @@ struct st_table { GRANT_INFO grant; FILESORT_INFO sort; TABLE_SHARE share_not_to_be_used; /* To be deleted when true shares */ + + bool fill_item_list(List *item_list) const; + void reset_item_list(List *item_list) const; }; diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 84a32b52284..65a4617445c 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -13828,8 +13828,11 @@ static void test_bug10760() rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); rc= mysql_query(mysql, "update t1 set id=id+100"); - DIE_UNLESS(rc); - if (!opt_silent) + /* + If cursors are not materialized, the update will return an error; + we mainly test that it won't deadlock. + */ + if (rc && !opt_silent) printf("Got error (as expected): %s\n", mysql_error(mysql)); /* 2: check that MyISAM tables used in cursors survive From 7d6d4c8355a5a532de73156ae5e3b0b106f12cb7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 03:23:07 +0300 Subject: [PATCH 077/225] Fixed problems found by valgrind Fixed problems in test suite where some test failed Fixed access to not initialized memory in federated Fixed access to not initialized memory when using BIT fields in internal temporary tables BitKeeper/etc/ignore: added libmysqld/sql_cursor.h mysql-test/r/information_schema.result: Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middlecd mysql-test/r/information_schema_inno.result: Remove used tables at start mysql-test/r/multi_statement.result: Remove used tables at start mysql-test/r/temp_table.result: Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle mysql-test/r/type_bit.result: More tests mysql-test/t/information_schema.test: Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle mysql-test/t/information_schema_inno.test: Remove used tables at start mysql-test/t/multi_statement.test: Remove used tables at start mysql-test/t/temp_table.test: Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle mysql-test/t/type_bit.test: More tests mysql-test/valgrind.supp: Removed some valgrind warnings that isn't errors sql/ha_federated.cc: Fixed errors discovered by valgrind: - Socket was not initialized - share->scheme was deleted while there was still pointer into it from the hash sql/item_func.h: Remove access to table object from cleanup() as the table object may have been dropped earlier (In case of temporary tables or of close_thread_tables() is run before cleanup()) This fixed a bug with access to already freed memory sql/sql_base.cc: Reset variables used by fulltext sql/sql_select.cc: Fixed various problems with bit fields when used in internal temporary tables. Calculate space needed for bit fields correctly (previously we allocated more space than needed for rows in heap/myisam tables) --- .bzrignore | 2 ++ mysql-test/r/information_schema.result | 23 ++++++------ mysql-test/r/information_schema_inno.result | 2 +- mysql-test/r/multi_statement.result | 1 + mysql-test/r/temp_table.result | 29 +++++++-------- mysql-test/r/type_bit.result | 10 ++++++ mysql-test/t/information_schema.test | 11 +++--- mysql-test/t/information_schema_inno.test | 2 +- mysql-test/t/multi_statement.test | 4 +++ mysql-test/t/temp_table.test | 25 ++++++------- mysql-test/t/type_bit.test | 2 ++ mysql-test/valgrind.supp | 24 +++++++++++-- sql/ha_federated.cc | 16 ++++----- sql/item_func.h | 3 -- sql/sql_base.cc | 2 ++ sql/sql_select.cc | 40 ++++++++++++++++----- 16 files changed, 130 insertions(+), 66 deletions(-) diff --git a/.bzrignore b/.bzrignore index 3932ed4d127..7f325fcd11a 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1125,3 +1125,5 @@ vio/test-ssl vio/test-sslclient vio/test-sslserver vio/viotest-ssl +libmysqld/sql_cursor.cc +libmysqld/sql_cursor.h diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index e2812283901..d7ce6a7a96a 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -1,4 +1,5 @@ -DROP TABLE IF EXISTS t0,t1,t2,t3,t5; +DROP TABLE IF EXISTS t0,t1,t2,t3,t4,t5; +DROP VIEW IF EXISTS v1; show variables where variable_name like "skip_show_database"; Variable_name Value skip_show_database OFF @@ -638,8 +639,8 @@ use test; create function sub1(i int) returns int return i+1; create table t1(f1 int); -create view t2 (c) as select f1 from t1; -create view t3 (c) as select sub1(1); +create view v2 (c) as select f1 from t1; +create view v3 (c) as select sub1(1); create table t4(f1 int, KEY f1_key (f1)); drop table t1; drop function sub1; @@ -647,29 +648,29 @@ select table_name from information_schema.views where table_schema='test'; table_name Warnings: -Warning 1356 View 'test.t2' references invalid table(s) or column(s) or function(s) -Warning 1356 View 'test.t3' references invalid table(s) or column(s) or function(s) +Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) +Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) select table_name from information_schema.views where table_schema='test'; table_name Warnings: -Warning 1356 View 'test.t2' references invalid table(s) or column(s) or function(s) -Warning 1356 View 'test.t3' references invalid table(s) or column(s) or function(s) +Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) +Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) select column_name from information_schema.columns where table_schema='test'; column_name f1 Warnings: -Warning 1356 View 'test.t2' references invalid table(s) or column(s) or function(s) -Warning 1356 View 'test.t3' references invalid table(s) or column(s) or function(s) +Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) +Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) select index_name from information_schema.statistics where table_schema='test'; index_name f1_key select constraint_name from information_schema.table_constraints where table_schema='test'; constraint_name -drop view t2; -drop view t3; +drop view v2; +drop view v3; drop table t4; select * from information_schema.table_names; ERROR 42S02: Unknown table 'table_names' in information_schema diff --git a/mysql-test/r/information_schema_inno.result b/mysql-test/r/information_schema_inno.result index 9dd92baf62f..fb6584673f6 100644 --- a/mysql-test/r/information_schema_inno.result +++ b/mysql-test/r/information_schema_inno.result @@ -1,4 +1,4 @@ -DROP TABLE IF EXISTS t1,t2; +DROP TABLE IF EXISTS t1,t2,t3; CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id, id), FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE, diff --git a/mysql-test/r/multi_statement.result b/mysql-test/r/multi_statement.result index 3a8d86bf349..ff19cbdd698 100644 --- a/mysql-test/r/multi_statement.result +++ b/mysql-test/r/multi_statement.result @@ -1,3 +1,4 @@ +DROP TABLE IF EXISTS t1; select 1; 1 1 diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result index 726861bb525..82479504b10 100644 --- a/mysql-test/r/temp_table.result +++ b/mysql-test/r/temp_table.result @@ -1,4 +1,5 @@ drop table if exists t1,t2; +drop view if exists v1; CREATE TABLE t1 (c int not null, d char (10) not null); insert into t1 values(1,""),(2,"a"),(3,"b"); CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null); @@ -99,32 +100,32 @@ Variable_name Value Created_tmp_disk_tables 0 Created_tmp_tables 2 drop table t1; -create temporary table t1 as select 'This is temp. table' A; -create view t1 as select 'This is view' A; -select * from t1; +create temporary table v1 as select 'This is temp. table' A; +create view v1 as select 'This is view' A; +select * from v1; A This is temp. table -show create table t1; +show create table v1; Table Create Table -t1 CREATE TEMPORARY TABLE `t1` ( +v1 CREATE TEMPORARY TABLE `v1` ( `A` varchar(19) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -show create view t1; +show create view v1; View Create View -t1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `t1` AS select _latin1'This is view' AS `A` -drop view t1; -select * from t1; +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select _latin1'This is view' AS `A` +drop view v1; +select * from v1; A This is temp. table -create view t1 as select 'This is view again' A; -select * from t1; +create view v1 as select 'This is view again' A; +select * from v1; A This is temp. table -drop table t1; -select * from t1; +drop table v1; +select * from v1; A This is view again -drop view t1; +drop view v1; create table t1 (a int, b int, index(a), index(b)); create table t2 (c int auto_increment, d varchar(255), primary key (c)); insert into t1 values (3,1),(3,2); diff --git a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result index 5988b4f745e..0213dbaffde 100644 --- a/mysql-test/r/type_bit.result +++ b/mysql-test/r/type_bit.result @@ -553,3 +553,13 @@ sum(a1) b1+0 b2+0 2 0 0 4 2 2 8 1 1 +select 1 from t1 join t2 on b1 = b2 group by b1 order by 1; +1 +1 +1 +1 +select b1+0,sum(b1), sum(b2) from t1 join t2 on b1 = b2 group by b1 order by 1; +b1+0 sum(b1) sum(b2) +0 0 0 +1 4 4 +2 2 2 diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 51cca0a3db1..f351d315680 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -5,7 +5,8 @@ # show databases --disable_warnings -DROP TABLE IF EXISTS t0,t1,t2,t3,t5; +DROP TABLE IF EXISTS t0,t1,t2,t3,t4,t5; +DROP VIEW IF EXISTS v1; --enable_warnings @@ -364,8 +365,8 @@ use test; create function sub1(i int) returns int return i+1; create table t1(f1 int); -create view t2 (c) as select f1 from t1; -create view t3 (c) as select sub1(1); +create view v2 (c) as select f1 from t1; +create view v3 (c) as select sub1(1); create table t4(f1 int, KEY f1_key (f1)); drop table t1; drop function sub1; @@ -378,8 +379,8 @@ where table_schema='test'; select index_name from information_schema.statistics where table_schema='test'; select constraint_name from information_schema.table_constraints where table_schema='test'; -drop view t2; -drop view t3; +drop view v2; +drop view v3; drop table t4; # diff --git a/mysql-test/t/information_schema_inno.test b/mysql-test/t/information_schema_inno.test index dd7015bfd9a..9cd64a54ad9 100644 --- a/mysql-test/t/information_schema_inno.test +++ b/mysql-test/t/information_schema_inno.test @@ -1,6 +1,6 @@ -- source include/have_innodb.inc --disable_warnings -DROP TABLE IF EXISTS t1,t2; +DROP TABLE IF EXISTS t1,t2,t3; --enable_warnings # diff --git a/mysql-test/t/multi_statement.test b/mysql-test/t/multi_statement.test index eb8d867f3f0..785aa749f5e 100644 --- a/mysql-test/t/multi_statement.test +++ b/mysql-test/t/multi_statement.test @@ -1,6 +1,10 @@ # PS doesn't support multi-statements --disable_ps_protocol +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + select 1; delimiter ||||; select 2; diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test index 9a7678ed712..6b3991c9c78 100644 --- a/mysql-test/t/temp_table.test +++ b/mysql-test/t/temp_table.test @@ -4,6 +4,7 @@ --disable_warnings drop table if exists t1,t2; +drop view if exists v1; --enable_warnings CREATE TABLE t1 (c int not null, d char (10) not null); @@ -91,18 +92,18 @@ show status like "created_tmp%tables"; drop table t1; # Fix for BUG#8921: Check that temporary table is ingored by view commands. -create temporary table t1 as select 'This is temp. table' A; -create view t1 as select 'This is view' A; -select * from t1; -show create table t1; -show create view t1; -drop view t1; -select * from t1; -create view t1 as select 'This is view again' A; -select * from t1; -drop table t1; -select * from t1; -drop view t1; +create temporary table v1 as select 'This is temp. table' A; +create view v1 as select 'This is view' A; +select * from v1; +show create table v1; +show create view v1; +drop view v1; +select * from v1; +create view v1 as select 'This is view again' A; +select * from v1; +drop table v1; +select * from v1; +drop view v1; # Bug #8497: tmpdir with extra slashes would cause failures # diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test index 6906cfc2808..0c45dea21bb 100644 --- a/mysql-test/t/type_bit.test +++ b/mysql-test/t/type_bit.test @@ -224,3 +224,5 @@ select a1, a2, b1+0, b2+0 from t1 join t2 on a1 = a2; select a1, a2, b1+0, b2+0 from t1 join t2 on a1 = a2 order by a1; select a1, a2, b1+0, b2+0 from t1 join t2 on b1 = b2; select sum(a1), b1+0, b2+0 from t1 join t2 on b1 = b2 group by b1 order by 1; +select 1 from t1 join t2 on b1 = b2 group by b1 order by 1; +select b1+0,sum(b1), sum(b2) from t1 join t2 on b1 = b2 group by b1 order by 1; diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp index 26f3477140b..7737810653d 100644 --- a/mysql-test/valgrind.supp +++ b/mysql-test/valgrind.supp @@ -51,6 +51,16 @@ fun:pthread_create } +{ + pthread pthread_key_create + Memcheck:Leak + fun:malloc + fun:* + fun:* + fun:pthread_key_create + fun:my_thread_global_init +} + { pthread strstr uninit Memcheck:Cond @@ -127,8 +137,18 @@ { libz deflate Memcheck:Cond - obj:/usr/lib/libz.so.* - obj:/usr/lib/libz.so.* + obj:*/libz.so.* + obj:*/libz.so.* fun:deflate fun:compress2 } + +{ + libz deflate2 + Memcheck:Cond + obj:*/libz.so.* + obj:*/libz.so.* + fun:deflate + obj:*/libz.so.* + fun:gzflush +} diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index 6230fa7bb3c..6d5c5b48ab6 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -588,12 +588,14 @@ static int parse_url(FEDERATED_SHARE *share, TABLE *table, DBUG_ENTER("ha_federated::parse_url"); share->port= 0; + share->socket= 0; DBUG_PRINT("info", ("Length %d \n", table->s->connect_string.length)); DBUG_PRINT("info", ("String %.*s \n", table->s->connect_string.length, table->s->connect_string.str)); - share->scheme= my_strdup_with_length( - (const byte*)table->s->connect_string.str, - table->s->connect_string.length+1, MYF(0)); + share->scheme= my_strdup_with_length((const byte*)table->s-> + connect_string.str, + table->s->connect_string.length, + MYF(0)); // Add a null for later termination of table name share->scheme[table->s->connect_string.length]= 0; @@ -1375,13 +1377,9 @@ static int free_share(FEDERATED_SHARE *share) if (!--share->use_count) { - if (share->scheme) - { - my_free((gptr) share->scheme, MYF(0)); - share->scheme= 0; - } - hash_delete(&federated_open_tables, (byte*) share); + my_free((gptr) share->scheme, MYF(MY_ALLOW_ZERO_PTR0)); + share->scheme= 0; thr_lock_delete(&share->lock); VOID(pthread_mutex_destroy(&share->mutex)); my_free((gptr) share, MYF(0)); diff --git a/sql/item_func.h b/sql/item_func.h index 019abb0c072..e23f251d4a2 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1286,9 +1286,6 @@ public: { ft_handler->please->close_search(ft_handler); ft_handler=0; - if (join_key) - table->file->ft_handler=0; - table->fulltext_searched=0; } concat= 0; DBUG_VOID_RETURN; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index fb23093731a..c083aa37d06 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1327,6 +1327,8 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, table->keys_in_use_for_query= table->s->keys_in_use; table->insert_values= 0; table->used_keys= table->s->keys_for_keyread; + table->fulltext_searched= 0; + table->file->ft_handler= 0; if (table->timestamp_field) table->timestamp_field_type= table->timestamp_field->get_auto_set_type(); table_list->updatable= 1; // It is not derived table nor non-updatable VIEW diff --git a/sql/sql_select.cc b/sql/sql_select.cc index e03879f0cbb..5154eb73ebe 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7817,18 +7817,24 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, if (field->maybe_null && !field->field->maybe_null()) { result= create_tmp_field_from_item(thd, item, table, NULL, - modify_item, convert_blob_length); + modify_item, convert_blob_length); *from_field= field->field; if (result && modify_item) - ((Item_field*)item)->result_field= result; + field->result_field= result; } - else if (table_cant_handle_bit_fields && field->field->type() == FIELD_TYPE_BIT) + else if (table_cant_handle_bit_fields && field->field->type() == + FIELD_TYPE_BIT) + { + *from_field= field->field; result= create_tmp_field_from_item(thd, item, table, copy_func, modify_item, convert_blob_length); + if (result && modify_item) + field->result_field= result; + } else result= create_tmp_field_from_field(thd, (*from_field= field->field), item->name, table, - modify_item ? (Item_field*) item : + modify_item ? field : NULL, convert_blob_length); if (orig_type == Item::REF_ITEM && orig_modify) @@ -8071,7 +8077,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, Field *new_field= create_tmp_field(thd, table, arg, arg->type(), ©_func, tmp_from_field, group != 0,not_all_columns, - group || distinct, + distinct, param->convert_blob_length); if (!new_field) goto err; // Should be OOM @@ -8082,6 +8088,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, *blob_field++= (uint) (reg_field - table->field); blob_count++; } + if (new_field->type() == FIELD_TYPE_BIT) + total_uneven_bit_length+= new_field->field_length & 7; new_field->field_index= (uint) (reg_field - table->field); *(reg_field++)= new_field; if (new_field->real_type() == MYSQL_TYPE_STRING || @@ -8117,12 +8125,16 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, write rows to the temporary table. We here distinguish between UNION and multi-table-updates by the fact that in the later case group is set to the row pointer. + + The test for item->marker == 4 is ensure we don't create a group-by + key over a bit field as heap tables can't handle that. */ Field *new_field= (param->schema_table) ? create_tmp_field_for_schema(thd, item, table) : create_tmp_field(thd, table, item, type, ©_func, tmp_from_field, group != 0, - not_all_columns || group != 0, 0, + not_all_columns || group != 0, + item->marker == 4, param->convert_blob_length); if (!new_field) @@ -8154,7 +8166,14 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, *(reg_field++) =new_field; } if (!--hidden_field_count) + { + /* + This was the last hidden field; Remember how many hidden fields could + have null + */ hidden_null_count=null_count; + null_count= 0; + } } DBUG_ASSERT(field_count >= (uint) (reg_field - table->field)); field_count= (uint) (reg_field - table->field); @@ -8189,8 +8208,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, null_count++; } hidden_null_pack_length=(hidden_null_count+7)/8; - null_pack_length= hidden_null_count + - (null_count + total_uneven_bit_length + 7) / 8; + null_pack_length= (hidden_null_pack_length + + (null_count + total_uneven_bit_length + 7) / 8); reclength+=null_pack_length; if (!reclength) reclength=1; // Dummy select @@ -12161,6 +12180,11 @@ calc_group_buffer(JOIN *join,ORDER *group) key_length+=MAX_BLOB_WIDTH; // Can't be used as a key else if (field->type() == MYSQL_TYPE_VARCHAR) key_length+= field->field_length + HA_KEY_BLOB_LENGTH; + else if (field->type() == FIELD_TYPE_BIT) + { + /* Bit is usually stored as a longlong key for group fields */ + key_length+= 8; // Big enough + } else key_length+= field->pack_length(); } From 449fb0b184a474f8850a601a95be1c67183f5aa4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 07:11:53 +0200 Subject: [PATCH 078/225] ndb - fix gcc4 compile problem ndb/src/ndbapi/Ndbinit.cpp: fix gcc4 compile problem --- ndb/src/ndbapi/Ndbinit.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp index 03704537c0a..59a6a825be4 100644 --- a/ndb/src/ndbapi/Ndbinit.cpp +++ b/ndb/src/ndbapi/Ndbinit.cpp @@ -29,6 +29,10 @@ #include #include #include "ObjectMap.hpp" +#include +#include +#include "NdbUtil.hpp" +#include class NdbGlobalEventBufferHandle; NdbGlobalEventBufferHandle *NdbGlobalEventBuffer_init(int); From ff50190af19ec160031b34e1a81c91f8095d7982 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 15:48:40 +1000 Subject: [PATCH 079/225] GCC4 build fix ndb/src/ndbapi/NdbUtil.hpp: gcc4 build fix --- ndb/src/ndbapi/NdbUtil.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ndb/src/ndbapi/NdbUtil.hpp b/ndb/src/ndbapi/NdbUtil.hpp index d14ac65ddef..268f6c69e6f 100644 --- a/ndb/src/ndbapi/NdbUtil.hpp +++ b/ndb/src/ndbapi/NdbUtil.hpp @@ -31,6 +31,7 @@ Comment: #include +class Ndb; class NdbApiSignal; class NdbOperation; From 7ce3ffe1edbca3dac5c79121c29ef3e7ec4b04de Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 16:35:03 +1000 Subject: [PATCH 080/225] GCC4 build fix --- ndb/src/ndbapi/NdbUtil.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ndb/src/ndbapi/NdbUtil.hpp b/ndb/src/ndbapi/NdbUtil.hpp index d14ac65ddef..268f6c69e6f 100644 --- a/ndb/src/ndbapi/NdbUtil.hpp +++ b/ndb/src/ndbapi/NdbUtil.hpp @@ -31,6 +31,7 @@ Comment: #include +class Ndb; class NdbApiSignal; class NdbOperation; From 86713962d94e488e87d44755998c03ebff3da97b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 08:35:27 +0200 Subject: [PATCH 081/225] bug#13316 ndb alter table with big dicttabinfo send alter_tab_req fragmented as signal can get larger than MAX_MESSAGE_SIZE ndb/src/kernel/blocks/dbdict/Dbdict.cpp: DictTabInfo used during alter table can easily becom larger than MAX_MESSAGE_SIZE send fragmented instead --- ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 90f4ac73411..5bd35812b47 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -3036,8 +3036,8 @@ Dbdict::alterTable_backup_mutex_locked(Signal* signal, lreq->gci = tablePtr.p->gciTableCreated; lreq->requestType = AlterTabReq::AlterTablePrepare; - sendSignal(rg, GSN_ALTER_TAB_REQ, signal, - AlterTabReq::SignalLength, JBB); + sendFragmentedSignal(rg, GSN_ALTER_TAB_REQ, signal, + AlterTabReq::SignalLength, JBB); } void Dbdict::alterTableRef(Signal * signal, @@ -3521,8 +3521,8 @@ Dbdict::execALTER_TAB_CONF(Signal * signal){ lreq->gci = gci; lreq->requestType = AlterTabReq::AlterTableCommit; - sendSignal(rg, GSN_ALTER_TAB_REQ, signal, - AlterTabReq::SignalLength, JBB); + sendFragmentedSignal(rg, GSN_ALTER_TAB_REQ, signal, + AlterTabReq::SignalLength, JBB); } } else { From 6367a2c631b5a28908ecd5a8db50ce1bdcc4a667 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 11:45:16 +0500 Subject: [PATCH 082/225] a fix (#11553: gives error if aggregate user-defined function in HAVING clause). sql/sql_yacc.yy: a fix (#11553: gives error if aggregate user-defined function in HAVING clause). udf_sum_expr_list rule introduced and used for aggregate udf functions: - call inc_in_sum_expr() before udf_expr_list parsing (as in_sum_expr rule does). --- sql/sql_yacc.yy | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index e29aaac8f94..a85b877838c 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -644,7 +644,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); NUM_literal %type - expr_list udf_expr_list when_list ident_list ident_list_arg + expr_list udf_expr_list udf_sum_expr_list when_list ident_list + ident_list_arg %type key_type opt_unique_or_fulltext constraint_key_type @@ -3137,21 +3138,21 @@ simple_expr: { $$= new Item_func_trim($5,$3); } | TRUNCATE_SYM '(' expr ',' expr ')' { $$= new Item_func_round($3,$5,1); } - | UDA_CHAR_SUM '(' udf_expr_list ')' + | UDA_CHAR_SUM '(' udf_sum_expr_list ')' { if ($3 != NULL) $$ = new Item_sum_udf_str($1, *$3); else $$ = new Item_sum_udf_str($1); } - | UDA_FLOAT_SUM '(' udf_expr_list ')' + | UDA_FLOAT_SUM '(' udf_sum_expr_list ')' { if ($3 != NULL) $$ = new Item_sum_udf_float($1, *$3); else $$ = new Item_sum_udf_float($1); } - | UDA_INT_SUM '(' udf_expr_list ')' + | UDA_INT_SUM '(' udf_sum_expr_list ')' { if ($3 != NULL) $$ = new Item_sum_udf_int($1, *$3); @@ -3289,6 +3290,21 @@ udf_expr_list: /* empty */ { $$= NULL; } | expr_list { $$= $1;}; +udf_sum_expr_list: + { + LEX *lex= Lex; + if (lex->current_select->inc_in_sum_expr()) + { + yyerror(ER(ER_SYNTAX_ERROR)); + YYABORT; + } + } + udf_expr_list + { + Select->in_sum_expr--; + $$= $2; + }; + sum_expr: AVG_SYM '(' in_sum_expr ')' { $$=new Item_sum_avg($3); } From 8e78ba93ec9e19c301f6b080a147d8a249f5a326 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 09:09:27 +0200 Subject: [PATCH 083/225] Add testcase for bug#13316 ndb big alter table mysql-test/r/ndb_alter_table.result: Add testcase for bug#13316 mysql-test/t/ndb_alter_table.test: Add testcase for bug#13316 --- mysql-test/r/ndb_alter_table.result | 116 +++++++++++++++++++++++++++ mysql-test/t/ndb_alter_table.test | 119 ++++++++++++++++++++++++++++ 2 files changed, 235 insertions(+) diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result index 63afc07718f..3714ea14e16 100644 --- a/mysql-test/r/ndb_alter_table.result +++ b/mysql-test/r/ndb_alter_table.result @@ -200,3 +200,119 @@ a drop table t4; show tables; Tables_in_test +create table t1 ( +ai bigint auto_increment, +c001 int(11) not null, +c002 int(11) not null, +c003 int(11) not null, +c004 int(11) not null, +c005 int(11) not null, +c006 int(11) not null, +c007 int(11) not null, +c008 int(11) not null, +c009 int(11) not null, +c010 int(11) not null, +c011 int(11) not null, +c012 int(11) not null, +c013 int(11) not null, +c014 int(11) not null, +c015 int(11) not null, +c016 int(11) not null, +c017 int(11) not null, +c018 int(11) not null, +c019 int(11) not null, +c020 int(11) not null, +c021 int(11) not null, +c022 int(11) not null, +c023 int(11) not null, +c024 int(11) not null, +c025 int(11) not null, +c026 int(11) not null, +c027 int(11) not null, +c028 int(11) not null, +c029 int(11) not null, +c030 int(11) not null, +c031 int(11) not null, +c032 int(11) not null, +c033 int(11) not null, +c034 int(11) not null, +c035 int(11) not null, +c036 int(11) not null, +c037 int(11) not null, +c038 int(11) not null, +c039 int(11) not null, +c040 int(11) not null, +c041 int(11) not null, +c042 int(11) not null, +c043 int(11) not null, +c044 int(11) not null, +c045 int(11) not null, +c046 int(11) not null, +c047 int(11) not null, +c048 int(11) not null, +c049 int(11) not null, +c050 int(11) not null, +c051 int(11) not null, +c052 int(11) not null, +c053 int(11) not null, +c054 int(11) not null, +c055 int(11) not null, +c056 int(11) not null, +c057 int(11) not null, +c058 int(11) not null, +c059 int(11) not null, +c060 int(11) not null, +c061 int(11) not null, +c062 int(11) not null, +c063 int(11) not null, +c064 int(11) not null, +c065 int(11) not null, +c066 int(11) not null, +c067 int(11) not null, +c068 int(11) not null, +c069 int(11) not null, +c070 int(11) not null, +c071 int(11) not null, +c072 int(11) not null, +c073 int(11) not null, +c074 int(11) not null, +c075 int(11) not null, +c076 int(11) not null, +c077 int(11) not null, +c078 int(11) not null, +c079 int(11) not null, +c080 int(11) not null, +c081 int(11) not null, +c082 int(11) not null, +c083 int(11) not null, +c084 int(11) not null, +c085 int(11) not null, +c086 int(11) not null, +c087 int(11) not null, +c088 int(11) not null, +c089 int(11) not null, +c090 int(11) not null, +c091 int(11) not null, +c092 int(11) not null, +c093 int(11) not null, +c094 int(11) not null, +c095 int(11) not null, +c096 int(11) not null, +c097 int(11) not null, +c098 int(11) not null, +c099 int(11) not null, +c100 int(11) not null, +c101 int(11) not null, +c102 int(11) not null, +c103 int(11) not null, +c104 int(11) not null, +c105 int(11) not null, +c106 int(11) not null, +c107 int(11) not null, +c108 int(11) not null, +c109 int(11) not null, +primary key (ai), +unique key tx1 (c002, c003, c004, c005)) engine=ndb; +create index tx2 +on t1 (c010, c011, c012, c013); +drop table t1; diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test index b5b73ad1998..5c792f76316 100644 --- a/mysql-test/t/ndb_alter_table.test +++ b/mysql-test/t/ndb_alter_table.test @@ -199,4 +199,123 @@ drop table t4; show tables; connection server1; +create table t1 ( +ai bigint auto_increment, +c001 int(11) not null, +c002 int(11) not null, +c003 int(11) not null, +c004 int(11) not null, +c005 int(11) not null, +c006 int(11) not null, +c007 int(11) not null, +c008 int(11) not null, +c009 int(11) not null, +c010 int(11) not null, +c011 int(11) not null, +c012 int(11) not null, +c013 int(11) not null, +c014 int(11) not null, +c015 int(11) not null, +c016 int(11) not null, +c017 int(11) not null, +c018 int(11) not null, +c019 int(11) not null, +c020 int(11) not null, +c021 int(11) not null, +c022 int(11) not null, +c023 int(11) not null, +c024 int(11) not null, +c025 int(11) not null, +c026 int(11) not null, +c027 int(11) not null, +c028 int(11) not null, +c029 int(11) not null, +c030 int(11) not null, +c031 int(11) not null, +c032 int(11) not null, +c033 int(11) not null, +c034 int(11) not null, +c035 int(11) not null, +c036 int(11) not null, +c037 int(11) not null, +c038 int(11) not null, +c039 int(11) not null, +c040 int(11) not null, +c041 int(11) not null, +c042 int(11) not null, +c043 int(11) not null, +c044 int(11) not null, +c045 int(11) not null, +c046 int(11) not null, +c047 int(11) not null, +c048 int(11) not null, +c049 int(11) not null, +c050 int(11) not null, +c051 int(11) not null, +c052 int(11) not null, +c053 int(11) not null, +c054 int(11) not null, +c055 int(11) not null, +c056 int(11) not null, +c057 int(11) not null, +c058 int(11) not null, +c059 int(11) not null, +c060 int(11) not null, +c061 int(11) not null, +c062 int(11) not null, +c063 int(11) not null, +c064 int(11) not null, +c065 int(11) not null, +c066 int(11) not null, +c067 int(11) not null, +c068 int(11) not null, +c069 int(11) not null, +c070 int(11) not null, +c071 int(11) not null, +c072 int(11) not null, +c073 int(11) not null, +c074 int(11) not null, +c075 int(11) not null, +c076 int(11) not null, +c077 int(11) not null, +c078 int(11) not null, +c079 int(11) not null, +c080 int(11) not null, +c081 int(11) not null, +c082 int(11) not null, +c083 int(11) not null, +c084 int(11) not null, +c085 int(11) not null, +c086 int(11) not null, +c087 int(11) not null, +c088 int(11) not null, +c089 int(11) not null, +c090 int(11) not null, +c091 int(11) not null, +c092 int(11) not null, +c093 int(11) not null, +c094 int(11) not null, +c095 int(11) not null, +c096 int(11) not null, +c097 int(11) not null, +c098 int(11) not null, +c099 int(11) not null, +c100 int(11) not null, +c101 int(11) not null, +c102 int(11) not null, +c103 int(11) not null, +c104 int(11) not null, +c105 int(11) not null, +c106 int(11) not null, +c107 int(11) not null, +c108 int(11) not null, +c109 int(11) not null, +primary key (ai), +unique key tx1 (c002, c003, c004, c005)) engine=ndb; + +create index tx2 +on t1 (c010, c011, c012, c013); + +drop table t1; + # End of 4.1 tests From 91ed9588bf3c3dfddf9c4eee823b36e53c85a3f5 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 12:46:01 +0500 Subject: [PATCH 084/225] Fix for bug#12053 LOAD DATA INFILE ignores NO_AUTO_VALUE_ON_ZERO setting set auto_increment_field_not_null to true to preserve zero values for autoincrement fields during LOAD DATA execution if NO_AUTO_VALUE_ON_ZERO sql mode is set mysql-test/r/loaddata.result: Fix for bug#12053 LOAD DATA INFILE ignores NO_AUTO_VALUE_ON_ZERO setting test case mysql-test/t/loaddata.test: Fix for bug#12053 LOAD DATA INFILE ignores NO_AUTO_VALUE_ON_ZERO setting test case --- mysql-test/r/loaddata.result | 10 ++++++++++ mysql-test/t/loaddata.test | 27 +++++++++++++++++++++++++++ sql/sql_load.cc | 4 ++++ 3 files changed, 41 insertions(+) diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index c0baabcc507..46db14a5871 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -66,3 +66,13 @@ a b 3 row 3 0 drop table t1; +SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO; +create table t1(id integer not null auto_increment primary key); +insert into t1 values(0); +select * from t1; +id +0 +select * from t1; +id +0 +SET @@SQL_MODE=@OLD_SQL_MODE; diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index 689bdbbf92d..86fbdc62702 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -31,4 +31,31 @@ load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated select * from t1; drop table t1; + +# +# Bug #12053 LOAD DATA INFILE ignores NO_AUTO_VALUE_ON_ZERO setting +# +SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO; +create table t1(id integer not null auto_increment primary key); +insert into t1 values(0); +disable_query_log; +eval SELECT * INTO OUTFILE '$MYSQL_TEST_DIR/var/tmp/t1' from t1; +delete from t1; +eval load data infile '$MYSQL_TEST_DIR/var/tmp/t1' into table t1; +enable_query_log; +select * from t1; +--exec rm $MYSQL_TEST_DIR/var/tmp/t1 + +disable_query_log; +eval SELECT * INTO OUTFILE '$MYSQL_TEST_DIR/var/tmp/t1' +FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n' +FROM t1; +delete from t1; +eval load data infile '$MYSQL_TEST_DIR/var/tmp/t1' into table t1 +FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'; +enable_query_log; +select * from t1; +--exec rm $MYSQL_TEST_DIR/var/tmp/t1 +SET @@SQL_MODE=@OLD_SQL_MODE; + # End of 4.1 tests diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 7b963c7ea31..f590038f899 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -429,6 +429,8 @@ read_fixed_length(THD *thd,COPY_INFO &info,TABLE *table,List &fields, while ((sql_field= (Item_field*) it++)) { Field *field= sql_field->field; + if (field == table->next_number_field) + table->auto_increment_field_not_null= TRUE; if (pos == read_info.row_end) { thd->cuted_fields++; /* Not enough fields */ @@ -520,6 +522,8 @@ read_sep_field(THD *thd,COPY_INFO &info,TABLE *table, length=(uint) (read_info.row_end-pos); Field *field=sql_field->field; + if (field == table->next_number_field) + table->auto_increment_field_not_null= TRUE; if (!read_info.enclosed && (enclosed_length && length == 4 && !memcmp(pos,"NULL",4)) || (length == 1 && read_info.found_null)) From aab7ac880d5b1737a060416716bc618ee7cfd78a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 13:09:14 +0300 Subject: [PATCH 085/225] InnoDB: correct two misleading comments innobase/include/data0type.ic: Correct the comment of dtype_get_min_size() sql/ha_innodb.h: Correct the comment of innobase_set_cursor_view() --- innobase/include/data0type.ic | 2 +- sql/ha_innodb.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/innobase/include/data0type.ic b/innobase/include/data0type.ic index 06d45dd5501..d4a7b3c64b8 100644 --- a/innobase/include/data0type.ic +++ b/innobase/include/data0type.ic @@ -420,7 +420,7 @@ dtype_get_fixed_size( } /*************************************************************************** -Returns the size of a fixed size data type, 0 if not a fixed size type. */ +Returns the minimum size of a data type. */ UNIV_INLINE ulint dtype_get_min_size( diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index 672e48d9817..1c02ac20bb4 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -344,4 +344,4 @@ restored to a transaction read view. */ void innobase_set_cursor_view( /*=====================*/ - void* curview); /* in: Consistent read view to be closed */ + void* curview); /* in: Consistent read view to be set */ From 17efbe9f485f8f3175ab31f20ce4535667d663a0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 12:19:09 +0200 Subject: [PATCH 086/225] Bug #13164 yassl: "SSL connection error" on several platforms - it's a requirement fo yaSSL that either /dev/urandom or /dev/random is available on the target system. - Added a fix that tries to open /dev/random if /dev/urandom is not available. extra/yassl/taocrypt/src/random.cpp: Try to open /dev/ranom if /dev/urandom is not available. --- extra/yassl/taocrypt/src/random.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extra/yassl/taocrypt/src/random.cpp b/extra/yassl/taocrypt/src/random.cpp index e1e6416eb00..cf0720b11d8 100644 --- a/extra/yassl/taocrypt/src/random.cpp +++ b/extra/yassl/taocrypt/src/random.cpp @@ -95,7 +95,11 @@ OS_Seed::OS_Seed() { fd_ = open("/dev/urandom",O_RDONLY); if (fd_ == -1) + { + fd_ = open("/dev/random",O_RDONLY); + if (fd_ == -1) error_.SetError(OPEN_RAN_E); + } } From 7d325ef2b3758d330420ca6e8c34abab42ef4b9e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 21:55:10 +1000 Subject: [PATCH 087/225] Add documentation about intricacies of MgmtSrvr::versionNode and ::status ndb/src/mgmsrv/MgmtSrvr.cpp: Document why getOwnNodeID==nodeId is different in ::versionNode ndb/src/mgmsrv/MgmtSrvr.hpp: Document the usage of the address pointer returned from status() --- ndb/src/mgmsrv/MgmtSrvr.cpp | 10 ++++++++++ ndb/src/mgmsrv/MgmtSrvr.hpp | 10 ++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index ccff959f260..3ee0dc6e750 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -695,6 +695,16 @@ MgmtSrvr::versionNode(int nodeId, Uint32 &version, const char **address) version= 0; if (getOwnNodeId() == nodeId) { + /** + * If we're inquiring about our own node id, + * We know what version we are (version implies connected for mgm) + * but would like to find out from elsewhere what address they're using + * to connect to us. This means that secondary mgm servers + * can list ip addresses for mgm servers. + * + * If we don't get an address (i.e. no db nodes), + * we get the address from the configuration. + */ sendVersionReq(nodeId, version, address); version= NDB_VERSION; if(!*address) diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index 8f16918b24a..927b610e75c 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -201,8 +201,14 @@ public: ~MgmtSrvr(); - int status(int processId, - ndb_mgm_node_status * status, + /** + * Get status on a node. + * address may point to a common area (e.g. from inet_addr) + * There is no gaurentee that it is preserved across calls. + * Copy the string if you are not going to use it immediately. + */ + int status(int nodeId, + ndb_mgm_node_status * status, Uint32 * version, Uint32 * phase, bool * systemShutdown, From 87ad1060d3239f08cdf9767612e744040dd6d3e2 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 16:05:05 +0200 Subject: [PATCH 088/225] fixed a memory leak in ha_tina.cc --- sql/examples/ha_tina.cc | 10 ++++++++++ sql/examples/ha_tina.h | 3 +++ sql/handler.cc | 4 ++++ 3 files changed, 17 insertions(+) diff --git a/sql/examples/ha_tina.cc b/sql/examples/ha_tina.cc index e01cc7cc980..5663cd829bd 100644 --- a/sql/examples/ha_tina.cc +++ b/sql/examples/ha_tina.cc @@ -234,6 +234,16 @@ static int free_share(TINA_SHARE *share) DBUG_RETURN(result_code); } +bool tina_end() +{ + if (tina_init) + { + hash_free(&tina_open_tables); + VOID(pthread_mutex_destroy(&tina_mutex)); + } + tina_init= 0; + return FALSE; +} /* Finds the end of a line. diff --git a/sql/examples/ha_tina.h b/sql/examples/ha_tina.h index 5679d77a4dc..1ccb3418771 100644 --- a/sql/examples/ha_tina.h +++ b/sql/examples/ha_tina.h @@ -126,3 +126,6 @@ public: int find_current_row(byte *buf); int chain_append(); }; + +bool tina_end(); + diff --git a/sql/handler.cc b/sql/handler.cc index 5f8fa33fecc..41fb3a31ddc 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -598,6 +598,10 @@ int ha_panic(enum ha_panic_function flag) #ifdef HAVE_ARCHIVE_DB if (have_archive_db == SHOW_OPTION_YES) error|= archive_db_end(); +#endif +#ifdef HAVE_CSV_DB + if (have_csv_db == SHOW_OPTION_YES) + error|= tina_end(); #endif if (ha_finish_errors()) error= 1; From ac9c1fa39bb770a568387c2bee08c8821abdbf92 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 18:57:07 +0200 Subject: [PATCH 089/225] Fixes needed to build 5.0.13 on Windows: - reflect two "Makefile.am" changes in the respective "VC project" files, - correct a typo in a (normally) unused macro parameter. VC++Files/libmysqld/libmysqld.vcproj: Reflect a change done by Kostja in the Unix "libmysqld/Makefile.am": New file "sql/sql_cursor.cpp" replaces "sql/protocol_cursor.cpp". VC++Files/sql/mysqld.vcproj: Reflect a change done by Kostja in the Unix "sql/Makefile.am": New file "sql/sql_cursor.cpp" replaces "sql/protocol_cursor.cpp". sql/ha_federated.cc: Correct a typo (matters only if "SAFEMALLOC" is set). --- VC++Files/libmysqld/libmysqld.vcproj | 2 +- VC++Files/sql/mysqld.vcproj | 2 +- sql/ha_federated.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VC++Files/libmysqld/libmysqld.vcproj b/VC++Files/libmysqld/libmysqld.vcproj index 4dcd6f0714c..eb411f79362 100755 --- a/VC++Files/libmysqld/libmysqld.vcproj +++ b/VC++Files/libmysqld/libmysqld.vcproj @@ -2299,7 +2299,7 @@ + RelativePath="..\sql\sql_cursor.cpp"> + RelativePath="sql_cursor.cpp"> use_count) { hash_delete(&federated_open_tables, (byte*) share); - my_free((gptr) share->scheme, MYF(MY_ALLOW_ZERO_PTR0)); + my_free((gptr) share->scheme, MYF(MY_ALLOW_ZERO_PTR)); share->scheme= 0; thr_lock_delete(&share->lock); VOID(pthread_mutex_destroy(&share->mutex)); From 0f0f72c74f87c4cffca23704bd4a94b86b3945af Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 11:40:22 -0700 Subject: [PATCH 090/225] Fix handling of NULL values in decimal fields in FORMAT(). (Bug #13361) mysql-test/r/func_str.result: Add new results mysql-test/t/func_str.test: Add new regression test sql/item_strfunc.cc: Handle NULL decimal fields in FORMAT(). --- mysql-test/r/func_str.result | 6 ++++++ mysql-test/t/func_str.test | 10 ++++++++++ sql/item_strfunc.cc | 2 ++ 3 files changed, 18 insertions(+) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 577f943ebde..3d7d693cdce 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -1011,3 +1011,9 @@ t 1000000 1 drop table t1; +create table t1 (d decimal default null); +insert into t1 values (null); +select format(d, 2) from t1; +format(d, 2) +NULL +drop table t1; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 4a6c98c8d7f..5f32b7b2b49 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -665,3 +665,13 @@ select rpad(i, 7, ' ') as t from t1; drop table t1; # End of 4.1 tests + +# +# Bug #13361: SELECT FORMAT(, 2) crashes +# +create table t1 (d decimal default null); +insert into t1 values (null); +select format(d, 2) from t1; +drop table t1; + +# End of 5.0 tests diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 54c476ce176..b9ae3140393 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1733,6 +1733,8 @@ String *Item_func_format::val_str(String *str) { my_decimal dec_val, rnd_dec, *res; res= args[0]->val_decimal(&dec_val); + if ((null_value=args[0]->null_value)) + return 0; /* purecov: inspected */ my_decimal_round(E_DEC_FATAL_ERROR, res, decimals, false, &rnd_dec); my_decimal2string(E_DEC_FATAL_ERROR, &rnd_dec, 0, 0, 0, str); str_length= str->length(); From 17feba98d47e477210a98fb44c2c95cf342571f7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 23:03:53 +0400 Subject: [PATCH 091/225] Fix for bug #13407 "Remote connecting crashes server" and couple of similar problems which were introduced during work on WL#2787 "Add view definer/owner to the view definition (.frm) to check privileges on used tables and stored routines when using a VIEW." In some cases it is better to use value from Security_context::host_or_ip instead of value from Security_context::host since the latter can be NULL in certain situations (When we can't resolve hostname or we have not done this yet). mysql-test/r/skip_name_resolve.result: Added test for bug #13407 "Remote connecting crashes server". mysql-test/t/skip_name_resolve.test: Added test for bug #13407 "Remote connecting crashes server". sql/item_strfunc.cc: Item_func_user::val_str(): It is better to use value from Security_context::host_or_ip instead of value from Security_context::host in the result of USER() function since the latter can be NULL in certain situations (When we can't resolve hostname or we have not done this yet. Reverted back to old code). sql/mysqld.cc: handle_connections_shared_memory(): THD::host member has moved to the Security_context class. New THD::security_ctx member points to active security context. sql/sql_show.cc: mysqld_list_processes(): It is better to use value from Security_context::host_or_ip instead of value from Security_context::host in the processlist since the latter can be NULL in certain situations (When we can't resolve hostname or we have not done this yet. Reverted back to old code). --- mysql-test/r/skip_name_resolve.result | 7 +++++++ mysql-test/t/skip_name_resolve.test | 10 ++++++++++ sql/item_strfunc.cc | 2 +- sql/mysqld.cc | 2 +- sql/sql_show.cc | 2 +- 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/skip_name_resolve.result b/mysql-test/r/skip_name_resolve.result index d8d873699a5..a969c5c9ae0 100644 --- a/mysql-test/r/skip_name_resolve.result +++ b/mysql-test/r/skip_name_resolve.result @@ -5,3 +5,10 @@ GRANT USAGE ON *.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255' GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255' REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255'; DROP USER mysqltest_1@'127.0.0.1/255.255.255.255'; +select user(); +user() +# +show processlist; +Id User Host db Command Time State Info +# root # test Sleep # NULL +# root # test Query # NULL show processlist diff --git a/mysql-test/t/skip_name_resolve.test b/mysql-test/t/skip_name_resolve.test index 02339ca14c5..b67869692d2 100644 --- a/mysql-test/t/skip_name_resolve.test +++ b/mysql-test/t/skip_name_resolve.test @@ -8,3 +8,13 @@ REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255'; DROP USER mysqltest_1@'127.0.0.1/255.255.255.255'; # End of 4.1 tests + +# Bug #13407 "Remote connecting crashes server". +# Server crashed when one used USER() function in connection for which +# was impossible to obtain peer hostname. +connect (con1, 127.0.0.1, root, , test, $MASTER_MYPORT, ); +--replace_column 1 # +select user(); +--replace_column 1 # 6 # 3 # +show processlist; +connection default; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 54c476ce176..f0486246a65 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1608,7 +1608,7 @@ String *Item_func_user::val_str(String *str) else { user= thd->main_security_ctx.user; - host= thd->main_security_ctx.host; + host= thd->main_security_ctx.host_or_ip; } // For system threads (e.g. replication SQL thread) user may be empty diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 097eb9ccf17..677b68ca946 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4208,7 +4208,7 @@ pthread_handler_decl(handle_connections_shared_memory,arg) errmsg= 0; goto errorconn; } - thd->host= my_strdup(my_localhost,MYF(0)); /* Host is unknown */ + thd->security_ctx->host= my_strdup(my_localhost, MYF(0)); /* Host is unknown */ create_new_thread(thd); connect_number++; continue; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index cdbe0194303..cdd2818d897 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1205,7 +1205,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) "%s:%u", tmp_sctx->host_or_ip, tmp->peer_port); } else - thd_info->host= thd->strdup(tmp_sctx->host); + thd_info->host= thd->strdup(tmp_sctx->host_or_ip); if ((thd_info->db=tmp->db)) // Safe test thd_info->db=thd->strdup(thd_info->db); thd_info->command=(int) tmp->command; From 727f0b8a1f2fdc3f458f6b5da5ebe3cc73620403 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 21:24:57 +0200 Subject: [PATCH 092/225] Bug #13384 mysqltest, no protocol when script contains only lines with eval client/mysqltest.c: Set query_executed also for eval, that results in a query being executed and output is likely. --- client/mysqltest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/client/mysqltest.c b/client/mysqltest.c index f5facccee3a..1b8a0658cc7 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -3914,6 +3914,7 @@ int main(int argc, char **argv) error|= run_query(&cur_con->mysql, q, QUERY_REAP|QUERY_SEND); display_result_vertically= old_display_result_vertically; q->last_argument= q->end; + query_executed= 1; break; } case Q_QUERY: From 2fec728eb73cbd9177564faf4dc7ef64c9288a54 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 21:52:04 +0200 Subject: [PATCH 093/225] Bug #13384 mysqltest, no protocol when script contains only lines with eval client/mysqltest.c: Set query_executed also for eval, that results in a query being executed and output is likely. Commited once again in 5.0 --- client/mysqltest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/client/mysqltest.c b/client/mysqltest.c index 287fa012b7d..fdc1dec6dc1 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -4125,6 +4125,7 @@ int main(int argc, char **argv) error|= run_query(&cur_con->mysql, q, QUERY_REAP|QUERY_SEND); display_result_vertically= old_display_result_vertically; q->last_argument= q->end; + query_executed= 1; break; } case Q_QUERY: From 1d5a9276e29bc1e4046fc6b3aa51120f6203c004 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 16:58:09 -0700 Subject: [PATCH 094/225] This fixed bug 13369. Note, I dislike goto's as well. The alias structure now is a bit more simple and just uses a pointer to replace with the currect name. The giant case statement should go away in the next patch. sql/handler.cc: Simplified the code, annd fixed build issue with engines not being compiled. I disliek the goto but Serg preferred it over the testing of aliases first :) sql/handler.h: Removed ht from alias structure. --- sql/handler.cc | 60 +++++++++++++++++--------------------------------- sql/handler.h | 1 - 2 files changed, 20 insertions(+), 41 deletions(-) diff --git a/sql/handler.cc b/sql/handler.cc index 5f8fa33fecc..0f5d70a113e 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -119,12 +119,12 @@ struct show_table_type_st sys_table_types[]= struct show_table_alias_st sys_table_aliases[]= { - {"INNOBASE", "InnoDB", NULL }, - {"NDB", "NDBCLUSTER", NULL}, - {"BDB", "BERKELEYDB", NULL}, - {"HEAP", "MEMORY", NULL}, - {"MERGE", "MRG_MYISAM", NULL}, - {NullS, NullS, NULL} + {"INNOBASE", "InnoDB"}, + {"NDB", "NDBCLUSTER"}, + {"BDB", "BERKELEYDB"}, + {"HEAP", "MEMORY"}, + {"MERGE", "MRG_MYISAM"}, + {NullS, NullS} }; const char *ha_row_type[] = { @@ -145,28 +145,32 @@ enum db_type ha_resolve_by_name(const char *name, uint namelen) THD *thd= current_thd; show_table_alias_st *table_alias; show_table_type_st *types; + const char *ptr= name; - if (thd && !my_strcasecmp(&my_charset_latin1, name, "DEFAULT")) { + if (thd && !my_strcasecmp(&my_charset_latin1, ptr, "DEFAULT")) return (enum db_type) thd->variables.table_type; - } +retest: for (types= sys_table_types; types->type; types++) { - if (!my_strcasecmp(&my_charset_latin1, name, types->type)) + if (!my_strcasecmp(&my_charset_latin1, ptr, types->type)) return (enum db_type) types->db_type; } /* - We check for the historical aliases next. + We check for the historical aliases. */ for (table_alias= sys_table_aliases; table_alias->type; table_alias++) { - if (!my_strcasecmp(&my_charset_latin1, name, table_alias->alias) && table_alias->st) - return (enum db_type) table_alias->st->db_type; + if (!my_strcasecmp(&my_charset_latin1, ptr, table_alias->alias)) + { + ptr= table_alias->type; + goto retest; + } } + return DB_TYPE_UNKNOWN; } - const char *ha_get_storage_engine(enum db_type db_type) { show_table_type_st *types; @@ -398,29 +402,20 @@ int ha_init() if (ha_init_errors()) return 1; + /* + This will go away soon. + */ for (types= sys_table_types; types->type; types++) { switch (types->db_type) { case DB_TYPE_HEAP: types->ht= &heap_hton; - for (table_alias= sys_table_aliases; table_alias->type; table_alias++) - { - if (!my_strcasecmp(&my_charset_latin1, types->ht->name, - table_alias->type)) - table_alias->st= types; - } break; case DB_TYPE_MYISAM: types->ht= &myisam_hton; break; case DB_TYPE_MRG_MYISAM: types->ht= &myisammrg_hton; - for (table_alias= sys_table_aliases; table_alias->type; table_alias++) - { - if (!my_strcasecmp(&my_charset_latin1, types->ht->name, - table_alias->type)) - table_alias->st= types; - } break; #ifdef HAVE_BERKELEY_DB case DB_TYPE_BERKELEY_DB: @@ -434,11 +429,6 @@ int ha_init() else { types->ht= &berkeley_hton; - for (table_alias= sys_table_aliases; table_alias->type; table_alias++) - { - if (!my_strcasecmp(&my_charset_latin1, types->ht->name, table_alias->type)) - table_alias->st= types; - } ha_was_inited_ok(ht++); } } @@ -457,11 +447,6 @@ int ha_init() { ha_was_inited_ok(ht++); types->ht= &innobase_hton; - for (table_alias= sys_table_aliases; table_alias->type; table_alias++) - { - if (!my_strcasecmp(&my_charset_latin1, types->ht->name, table_alias->type)) - table_alias->st= types; - } } } break; @@ -479,11 +464,6 @@ int ha_init() { ha_was_inited_ok(ht++); types->ht= &ndbcluster_hton; - for (table_alias= sys_table_aliases; table_alias->type; table_alias++) - { - if (!my_strcasecmp(&my_charset_latin1, types->ht->name, table_alias->type)) - table_alias->st= types; - } } } break; diff --git a/sql/handler.h b/sql/handler.h index 16b98f05655..f4f6a8592bb 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -367,7 +367,6 @@ struct show_table_type_st { struct show_table_alias_st { const char *alias; const char *type; - show_table_type_st *st; }; /* Possible flags of a handlerton */ From ea5d6776b0ddc753c543da378c461f1cd69b6e95 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Sep 2005 09:47:41 +0200 Subject: [PATCH 095/225] BUG#7037 MySQL Bugs: #7037: Test "mysql_protocols" fails on Solaris 8 + 9 /x86 mysys/my_init.c: Changed implementation slightly to use a local variable for keeping track of wheter we should print to the info_file even if the flag is not set in infoflag Explicitly turn off print_info if there is no DBUG_FILE --- mysys/my_init.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/mysys/my_init.c b/mysys/my_init.c index bee485c3bed..c50c00c1e5c 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -127,11 +127,18 @@ my_bool my_init(void) void my_end(int infoflag) { - FILE *info_file; - if (!(info_file=DBUG_FILE)) - info_file=stderr; - DBUG_PRINT("info",("Shutting down")); - if (infoflag & MY_CHECK_ERROR || info_file != stderr) + DBUG_ENTER("my_end"); + FILE *info_file= DBUG_FILE; + bool print_info= (info_file != stderr); + if (!info_file) + { + info_file= stderr; + print_info= 0; + } + + DBUG_PRINT("info",("Shutting down: print_info: %d", print_info)); + if ((infoflag & MY_CHECK_ERROR) || print_info) + { /* Test if some file is left open */ if (my_file_opened | my_stream_opened) { @@ -141,7 +148,8 @@ void my_end(int infoflag) } } my_once_free(); - if (infoflag & MY_GIVE_INFO || info_file != stderr) + + if ((infoflag & MY_GIVE_INFO) || print_info) { #ifdef HAVE_GETRUSAGE struct rusage rus; From 674c8165ea4b3430f397d84b0c79642de7b12ce4 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Sep 2005 10:15:11 +0200 Subject: [PATCH 096/225] Bug#9112 - Merge table with composite index producing invalid results with some queries The problem was an ab-use of last_rkey_length. Formerly we saved the packed key length (of the search key) in this element. But in certain cases it got replaced by the (packed) result key length. Now we use a new element of MI_INFO to save the packed key length of the search key. myisam/mi_dbug.c: Bug#9112 - Merge table with composite index producing invalid results with some queries Fixed the recognition of NULL values in _mi_print_key(). myisam/mi_rkey.c: Bug#9112 - Merge table with composite index producing invalid results with some queries Saved the packed key length in a new element of MI_INFO. myisam/mi_search.c: Bug#9112 - Merge table with composite index producing invalid results with some queries Added a comment and trace prints. myisam/myisamdef.h: Bug#9112 - Merge table with composite index producing invalid results with some queries Added a new element to store the packed key length for use by the MyISAMMRG engine. myisammrg/myrg_rkey.c: Bug#9112 - Merge table with composite index producing invalid results with some queries Changed to use the new element of MI_INFO to get at the packed key length. mysql-test/r/merge.result: Bug#9112 - Merge table with composite index producing invalid results with some queries The test result. mysql-test/t/merge.test: Bug#9112 - Merge table with composite index producing invalid results with some queries The test case. --- myisam/mi_dbug.c | 4 ++-- myisam/mi_rkey.c | 7 +++++-- myisam/mi_search.c | 16 +++++++++++++--- myisam/myisamdef.h | 1 + myisammrg/myrg_rkey.c | 17 ++++++++++++----- mysql-test/r/merge.result | 26 ++++++++++++++++++++++++++ mysql-test/t/merge.test | 33 +++++++++++++++++++++++++++++++++ 7 files changed, 92 insertions(+), 12 deletions(-) diff --git a/myisam/mi_dbug.c b/myisam/mi_dbug.c index fe5b36fd304..8e7777e92a5 100644 --- a/myisam/mi_dbug.c +++ b/myisam/mi_dbug.c @@ -40,12 +40,12 @@ void _mi_print_key(FILE *stream, register MI_KEYSEG *keyseg, end= key+ keyseg->length; if (keyseg->flag & HA_NULL_PART) { - if (!*key) + /* A NULL value is encoded by a 1-byte flag. Zero means NULL. */ + if (! *(key++)) { fprintf(stream,"NULL"); continue; } - key++; } switch (keyseg->type) { diff --git a/myisam/mi_rkey.c b/myisam/mi_rkey.c index 1bb478efd3d..70122288d6c 100644 --- a/myisam/mi_rkey.c +++ b/myisam/mi_rkey.c @@ -31,8 +31,8 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len, MI_KEYSEG *last_used_keyseg; uint pack_key_length, use_key_length, nextflag; DBUG_ENTER("mi_rkey"); - DBUG_PRINT("enter",("base: %lx inx: %d search_flag: %d", - info,inx,search_flag)); + DBUG_PRINT("enter", ("base: %p buf: %p inx: %d search_flag: %d", + info, buf, inx, search_flag)); if ((inx = _mi_check_index(info,inx)) < 0) DBUG_RETURN(my_errno); @@ -44,9 +44,12 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len, { if (key_len == 0) key_len=USE_WHOLE_KEY; + /* Save the packed key for later use in the second buffer of lastkey. */ key_buff=info->lastkey+info->s->base.max_key_length; pack_key_length=_mi_pack_key(info, (uint) inx, key_buff, (uchar*) key, key_len, &last_used_keyseg); + /* Save packed_key_length for use by the MERGE engine. */ + info->pack_key_length= pack_key_length; DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE, keyinfo->seg, key_buff, pack_key_length);); } diff --git a/myisam/mi_search.c b/myisam/mi_search.c index cfc1c5cc3c0..c0be1a427df 100644 --- a/myisam/mi_search.c +++ b/myisam/mi_search.c @@ -1237,11 +1237,21 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, reg1 MI_KEYSEG *keyseg; uchar *start_key,*page,*page_end,*from,*from_end; uint length,tmp; + DBUG_ENTER("_mi_get_binary_pack_key"); page= *page_pos; page_end=page+MI_MAX_KEY_BUFF+1; start_key=key; + /* + Keys are compressed the following way: + + prefix length Packed length of prefix for the prev key. (1 or 3 bytes) + for each key segment: + [is null] Null indicator if can be null (1 byte, zero means null) + [length] Packed length if varlength (1 or 3 bytes) + pointer Reference to the data file (last_keyseg->length). + */ get_key_length(length,page); if (length) { @@ -1251,7 +1261,7 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, length, keyinfo->maxlength, *page_pos)); DBUG_DUMP("key",(char*) *page_pos,16); my_errno=HA_ERR_CRASHED; - return 0; /* Wrong key */ + DBUG_RETURN(0); /* Wrong key */ } from=key; from_end=key+length; } @@ -1312,12 +1322,12 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, { DBUG_PRINT("error",("Error when unpacking key")); my_errno=HA_ERR_CRASHED; - return 0; /* Error */ + DBUG_RETURN(0); /* Error */ } memcpy((byte*) key,(byte*) from,(size_t) length); *page_pos= from+length; } - return((uint) (key-start_key)+keyseg->length); + DBUG_RETURN((uint) (key-start_key)+keyseg->length); } diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h index 51a2dd3a2b3..11d7a5ea21f 100644 --- a/myisam/myisamdef.h +++ b/myisam/myisamdef.h @@ -255,6 +255,7 @@ struct st_myisam_info { uint lastkey_length; /* Length of key in lastkey */ uint last_rkey_length; /* Last length in mi_rkey() */ uint save_lastkey_length; + uint pack_key_length; /* For MYISAMMRG */ int errkey; /* Got last error on this key */ int lock_type; /* How database was locked */ int tmp_lock_type; /* When locked by readinfo */ diff --git a/myisammrg/myrg_rkey.c b/myisammrg/myrg_rkey.c index fbfa7f24921..5208cb52ac2 100644 --- a/myisammrg/myrg_rkey.c +++ b/myisammrg/myrg_rkey.c @@ -44,11 +44,12 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key, MYRG_TABLE *table; MI_INFO *mi; int err; + DBUG_ENTER("myrg_rkey"); LINT_INIT(key_buff); LINT_INIT(pack_key_length); if (_myrg_init_queue(info,inx,search_flag)) - return my_errno; + DBUG_RETURN(my_errno); for (table=info->open_tables ; table != info->end_table ; table++) { @@ -57,8 +58,9 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key, if (table == info->open_tables) { err=mi_rkey(mi,0,inx,key,key_len,search_flag); + /* Get the saved packed key and packed key length. */ key_buff=(byte*) mi->lastkey+mi->s->base.max_key_length; - pack_key_length=mi->last_rkey_length; + pack_key_length=mi->pack_key_length; } else { @@ -72,16 +74,21 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key, { if (err == HA_ERR_KEY_NOT_FOUND) continue; - return err; + DBUG_PRINT("exit", ("err: %d", err)); + DBUG_RETURN(err); } /* adding to queue */ queue_insert(&(info->by_key),(byte *)table); } + DBUG_PRINT("info", ("tables with matches: %u", info->by_key.elements)); if (!info->by_key.elements) - return HA_ERR_KEY_NOT_FOUND; + DBUG_RETURN(HA_ERR_KEY_NOT_FOUND); mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table; - return _myrg_mi_read_record(mi,buf); + DBUG_PRINT("info", ("using table no: %d", + info->current_table - info->open_tables + 1)); + DBUG_DUMP("result key", (byte*) mi->lastkey, mi->lastkey_length); + DBUG_RETURN(_myrg_mi_read_record(mi,buf)); } diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 3585b8b0018..6cfde286351 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -619,3 +619,29 @@ INSERT TABLE 't1' isn't allowed in FROM table list create table t3 engine=merge union=(t1, t2) select * from t2; INSERT TABLE 't2' isn't allowed in FROM table list drop table t1, t2; +create table t1 ( +a double(16,6), +b varchar(10), +index (a,b) +) engine=merge union=(t2,t3); +create table t2 ( +a double(16,6), +b varchar(10), +index (a,b) +) engine=myisam; +create table t3 ( +a double(16,6), +b varchar(10), +index (a,b) +) engine=myisam; +insert into t2 values ( null, ''); +insert into t2 values ( 9999999999.999999, ''); +insert into t3 select * from t2; +select min(a), max(a) from t1; +min(a) max(a) +9999999999.999998 9999999999.999998 +flush tables; +select min(a), max(a) from t1; +min(a) max(a) +9999999999.999998 9999999999.999998 +drop table t1, t2, t3; diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 57770dc0a0b..4c1d10b47e3 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -264,3 +264,36 @@ create table t3 engine=merge union=(t1, t2) select * from t1; --error 1093 create table t3 engine=merge union=(t1, t2) select * from t2; drop table t1, t2; + +# +# Bug#9112 - Merge table with composite index producing invalid results with some queries +# This test case will fail only without the bugfix and some +# non-deterministic circumstances. It depends on properly initialized +# "un-initialized" memory. At the time it happens with a standard +# non-debug build. But there is no guarantee that this will be always so. +# +create table t1 ( + a double(16,6), + b varchar(10), + index (a,b) +) engine=merge union=(t2,t3); + +create table t2 ( + a double(16,6), + b varchar(10), + index (a,b) +) engine=myisam; + +create table t3 ( + a double(16,6), + b varchar(10), + index (a,b) +) engine=myisam; + +insert into t2 values ( null, ''); +insert into t2 values ( 9999999999.999999, ''); +insert into t3 select * from t2; +select min(a), max(a) from t1; +flush tables; +select min(a), max(a) from t1; +drop table t1, t2, t3; From 6fbbb1d5be323d08e622a018001453b49d8a0248 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Sep 2005 11:20:34 +0300 Subject: [PATCH 097/225] InnoDB: Fix bug #13315, index columns having a maximum length of 767. innobase/data/data0data.c: Adapt to DICT_MAX_COL_PREFIX_LEN rename. innobase/dict/dict0dict.c: Adapt to DICT_MAX_COL_PREFIX_LEN rename. innobase/include/dict0mem.h: Rename DICT_MAX_COL_PREFIX_LEN to DICT_MAX_INDEX_COL_LEN. innobase/include/row0mysql.h: Add field_lengths parameter to row_create_index_for_mysql. innobase/rem/rem0rec.c: Adapt to DICT_MAX_COL_PREFIX_LEN rename. innobase/row/row0mysql.c: Add field_lengths parameter to row_create_index_for_mysql and use it to check for too long index columns. mysql-test/r/innodb.result: New tests. mysql-test/t/innodb.test: New tests. sql/ha_innodb.cc: Create temporary field_lengths buffer and pass it to row_create_index_for_mysql. --- innobase/data/data0data.c | 10 ++++---- innobase/dict/dict0dict.c | 2 +- innobase/include/dict0mem.h | 14 +++++------ innobase/include/row0mysql.h | 10 ++++++-- innobase/rem/rem0rec.c | 2 +- innobase/row/row0mysql.c | 21 ++++++++++++---- mysql-test/r/innodb.result | 34 ++++++++++++++++++++++++++ mysql-test/t/innodb.test | 46 ++++++++++++++++++++++++++++++++++++ sql/ha_innodb.cc | 15 +++++++++--- 9 files changed, 131 insertions(+), 23 deletions(-) diff --git a/innobase/data/data0data.c b/innobase/data/data0data.c index 194213a04e1..19304a7a8e1 100644 --- a/innobase/data/data0data.c +++ b/innobase/data/data0data.c @@ -561,12 +561,12 @@ dtuple_convert_big_rec( } /* We do not store externally fields which are smaller than - DICT_MAX_COL_PREFIX_LEN */ + DICT_MAX_INDEX_COL_LEN */ - ut_a(DICT_MAX_COL_PREFIX_LEN > REC_1BYTE_OFFS_LIMIT); + ut_a(DICT_MAX_INDEX_COL_LEN > REC_1BYTE_OFFS_LIMIT); if (longest < BTR_EXTERN_FIELD_REF_SIZE + 10 - + DICT_MAX_COL_PREFIX_LEN) { + + DICT_MAX_INDEX_COL_LEN) { /* Cannot shorten more */ mem_heap_free(heap); @@ -588,10 +588,10 @@ dtuple_convert_big_rec( dfield = dtuple_get_nth_field(entry, longest_i); vector->fields[n_fields].field_no = longest_i; - ut_a(dfield->len > DICT_MAX_COL_PREFIX_LEN); + ut_a(dfield->len > DICT_MAX_INDEX_COL_LEN); vector->fields[n_fields].len = dfield->len - - DICT_MAX_COL_PREFIX_LEN; + - DICT_MAX_INDEX_COL_LEN; vector->fields[n_fields].data = mem_heap_alloc(heap, vector->fields[n_fields].len); diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 5eee57c250b..9f2ae36c1c6 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -1625,7 +1625,7 @@ dict_index_add_col( variable-length fields, so that the extern flag can be embedded in the length word. */ - if (field->fixed_len > DICT_MAX_COL_PREFIX_LEN) { + if (field->fixed_len > DICT_MAX_INDEX_COL_LEN) { field->fixed_len = 0; } diff --git a/innobase/include/dict0mem.h b/innobase/include/dict0mem.h index ff6c4ec9b28..7eec86d0bcb 100644 --- a/innobase/include/dict0mem.h +++ b/innobase/include/dict0mem.h @@ -152,12 +152,12 @@ struct dict_col_struct{ in some of the functions below */ }; -/* DICT_MAX_COL_PREFIX_LEN is measured in bytes. Starting from 4.1.6, we -set max col prefix len to < 3 * 256, so that one can create a column prefix -index on 255 characters of a TEXT field also in the UTF-8 charset. In that -charset, a character may take at most 3 bytes. */ +/* DICT_MAX_INDEX_COL_LEN is measured in bytes and is the max index column +length + 1. Starting from 4.1.6, we set it to < 3 * 256, so that one can +create a column prefix index on 255 characters of a TEXT field also in the +UTF-8 charset. In that charset, a character may take at most 3 bytes. */ -#define DICT_MAX_COL_PREFIX_LEN 768 +#define DICT_MAX_INDEX_COL_LEN 768 /* Data structure for a field in an index */ struct dict_field_struct{ @@ -169,12 +169,12 @@ struct dict_field_struct{ prefix in bytes in a MySQL index of type, e.g., INDEX (textcol(25)); must be smaller than - DICT_MAX_COL_PREFIX_LEN; NOTE that + DICT_MAX_INDEX_COL_LEN; NOTE that in the UTF-8 charset, MySQL sets this to 3 * the prefix len in UTF-8 chars */ ulint fixed_len; /* 0 or the fixed length of the column if smaller than - DICT_MAX_COL_PREFIX_LEN */ + DICT_MAX_INDEX_COL_LEN */ ulint fixed_offs; /* offset to the field, or ULINT_UNDEFINED if it is not fixed within the record (due to preceding diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h index a61705b90be..b5da4634d98 100644 --- a/innobase/include/row0mysql.h +++ b/innobase/include/row0mysql.h @@ -335,8 +335,14 @@ int row_create_index_for_mysql( /*=======================*/ /* out: error number or DB_SUCCESS */ - dict_index_t* index, /* in: index defintion */ - trx_t* trx); /* in: transaction handle */ + dict_index_t* index, /* in: index definition */ + trx_t* trx, /* in: transaction handle */ + const ulint* field_lengths); /* in: if not NULL, must contain + dict_index_get_n_fields(index) + actual field lengths for the + index columns, which are + then checked for not being too + large. */ /************************************************************************* Scans a table create SQL string and adds to the data dictionary the foreign key constraints declared in the string. This function diff --git a/innobase/rem/rem0rec.c b/innobase/rem/rem0rec.c index fbc33aea669..9480c978755 100644 --- a/innobase/rem/rem0rec.c +++ b/innobase/rem/rem0rec.c @@ -621,7 +621,7 @@ rec_set_nth_field_extern_bit_new( if (field->fixed_len) { /* fixed-length fields cannot be external (Fixed-length fields longer than - DICT_MAX_COL_PREFIX_LEN will be treated as + DICT_MAX_INDEX_COL_LEN will be treated as variable-length ones in dict_index_add_col().) */ ut_ad(i != ith); continue; diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 26aae117d1d..82f7daf2ed8 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -1973,13 +1973,20 @@ row_create_index_for_mysql( /*=======================*/ /* out: error number or DB_SUCCESS */ dict_index_t* index, /* in: index definition */ - trx_t* trx) /* in: transaction handle */ + trx_t* trx, /* in: transaction handle */ + const ulint* field_lengths) /* in: if not NULL, must contain + dict_index_get_n_fields(index) + actual field lengths for the + index columns, which are + then checked for not being too + large. */ { ind_node_t* node; mem_heap_t* heap; que_thr_t* thr; ulint err; ulint i, j; + ulint len; #ifdef UNIV_SYNC_DEBUG ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX)); @@ -2018,10 +2025,16 @@ row_create_index_for_mysql( } } - /* Check also that prefix_len < DICT_MAX_COL_PREFIX_LEN */ + /* Check also that prefix_len and actual length + < DICT_MAX_INDEX_COL_LEN */ - if (dict_index_get_nth_field(index, i)->prefix_len - >= DICT_MAX_COL_PREFIX_LEN) { + len = dict_index_get_nth_field(index, i)->prefix_len; + + if (field_lengths) { + len = ut_max(len, field_lengths[i]); + } + + if (len >= DICT_MAX_INDEX_COL_LEN) { err = DB_TOO_BIG_RECORD; goto error_handling; diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index ffc4ab08ab4..8d44a2a12ab 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -2559,3 +2559,37 @@ FOREIGN KEY (b) REFERENCES test.t1(id) ) ENGINE=InnoDB; Got one of the listed errors DROP TABLE t1; +create table t1 (col1 varchar(2000), index (col1(767))) +character set = latin1 engine = innodb; +create table t2 (col1 char(255), index (col1)) +character set = latin1 engine = innodb; +create table t3 (col1 binary(255), index (col1)) +character set = latin1 engine = innodb; +create table t4 (col1 varchar(767), index (col1)) +character set = latin1 engine = innodb; +create table t5 (col1 varchar(767) primary key) +character set = latin1 engine = innodb; +create table t6 (col1 varbinary(767) primary key) +character set = latin1 engine = innodb; +create table t7 (col1 text, index(col1(767))) +character set = latin1 engine = innodb; +create table t8 (col1 blob, index(col1(767))) +character set = latin1 engine = innodb; +create table t9 (col1 varchar(512), col2 varchar(512), index(col1, col2)) +character set = latin1 engine = innodb; +drop table t1, t2, t3, t4, t5, t6, t7, t8, t9; +create table t1 (col1 varchar(768), index (col1)) +character set = latin1 engine = innodb; +ERROR HY000: Can't create table './test/t1.frm' (errno: 139) +create table t2 (col1 varchar(768) primary key) +character set = latin1 engine = innodb; +ERROR HY000: Can't create table './test/t2.frm' (errno: 139) +create table t3 (col1 varbinary(768) primary key) +character set = latin1 engine = innodb; +ERROR HY000: Can't create table './test/t3.frm' (errno: 139) +create table t4 (col1 text, index(col1(768))) +character set = latin1 engine = innodb; +ERROR HY000: Can't create table './test/t4.frm' (errno: 139) +create table t5 (col1 blob, index(col1(768))) +character set = latin1 engine = innodb; +ERROR HY000: Can't create table './test/t5.frm' (errno: 139) diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 94f33738c8c..d8c9830a214 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1482,3 +1482,49 @@ CREATE TEMPORARY TABLE t2 FOREIGN KEY (b) REFERENCES test.t1(id) ) ENGINE=InnoDB; DROP TABLE t1; + +# +# Test that index column max sizes are checked (bug #13315) +# + +# prefix index +create table t1 (col1 varchar(2000), index (col1(767))) + character set = latin1 engine = innodb; + +# normal indexes +create table t2 (col1 char(255), index (col1)) + character set = latin1 engine = innodb; +create table t3 (col1 binary(255), index (col1)) + character set = latin1 engine = innodb; +create table t4 (col1 varchar(767), index (col1)) + character set = latin1 engine = innodb; +create table t5 (col1 varchar(767) primary key) + character set = latin1 engine = innodb; +create table t6 (col1 varbinary(767) primary key) + character set = latin1 engine = innodb; +create table t7 (col1 text, index(col1(767))) + character set = latin1 engine = innodb; +create table t8 (col1 blob, index(col1(767))) + character set = latin1 engine = innodb; + +# multi-column indexes are allowed to be longer +create table t9 (col1 varchar(512), col2 varchar(512), index(col1, col2)) + character set = latin1 engine = innodb; + +drop table t1, t2, t3, t4, t5, t6, t7, t8, t9; + +--error 1005 +create table t1 (col1 varchar(768), index (col1)) + character set = latin1 engine = innodb; +--error 1005 +create table t2 (col1 varchar(768) primary key) + character set = latin1 engine = innodb; +--error 1005 +create table t3 (col1 varbinary(768) primary key) + character set = latin1 engine = innodb; +--error 1005 +create table t4 (col1 text, index(col1(768))) + character set = latin1 engine = innodb; +--error 1005 +create table t5 (col1 blob, index(col1(768))) + character set = latin1 engine = innodb; diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 9e10873ad63..007194e09b3 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -4492,7 +4492,8 @@ create_index( ulint is_unsigned; ulint i; ulint j; - + ulint* field_lengths; + DBUG_ENTER("create_index"); key = form->key_info + key_num; @@ -4514,6 +4515,10 @@ create_index( index = dict_mem_index_create((char*) table_name, key->name, 0, ind_type, n_fields); + + field_lengths = (ulint*) my_malloc(sizeof(ulint) * n_fields, + MYF(MY_FAE)); + for (i = 0; i < n_fields; i++) { key_part = key->key_part + i; @@ -4568,6 +4573,8 @@ create_index( prefix_len = 0; } + field_lengths[i] = key_part->length; + /* We assume all fields should be sorted in ascending order, hence the '0': */ @@ -4576,10 +4583,12 @@ create_index( 0, prefix_len); } - error = row_create_index_for_mysql(index, trx); + error = row_create_index_for_mysql(index, trx, field_lengths); error = convert_error_code_to_mysql(error, NULL); + my_free((gptr) field_lengths, MYF(0)); + DBUG_RETURN(error); } @@ -4602,7 +4611,7 @@ create_clustered_index_when_no_primary( index = dict_mem_index_create((char*) table_name, (char*) "GEN_CLUST_INDEX", 0, DICT_CLUSTERED, 0); - error = row_create_index_for_mysql(index, trx); + error = row_create_index_for_mysql(index, trx, NULL); error = convert_error_code_to_mysql(error, NULL); From 32de973588d71d4cb7a6decf7a83c0554de2a9a1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Sep 2005 13:43:20 +0400 Subject: [PATCH 098/225] Fix for BUG#13419: In "ref" optimizer, take into account that item=Item_func_in(x,y) is not equivalent to "x=y" when item->negated == TRUE. mysql-test/r/func_in.result: Testcase for BUG#13419 mysql-test/t/func_in.test: Testcase for BUG#13419 sql/sql_select.cc: Fix for BUG#13419: * Take into account that item=Item_func_in(x,y) is not equivalent to "x=y" when item->negated == TRUE. * Removed comment that is no longer true. --- mysql-test/r/func_in.result | 9 +++++++++ mysql-test/t/func_in.test | 7 +++++++ sql/sql_select.cc | 4 ++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index 516d0a28a21..3cf2afc83d1 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -193,3 +193,12 @@ select * from t1 where a in (NULL, 'aa'); a aa drop table t1; +create table t1 (id int, key(id)); +insert into t1 values (1),(2),(3); +select count(*) from t1 where id not in (1); +count(*) +2 +select count(*) from t1 where id not in (1,2); +count(*) +1 +drop table t1; diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test index aec2de7a467..2ffe5a2d5f7 100644 --- a/mysql-test/t/func_in.test +++ b/mysql-test/t/func_in.test @@ -102,4 +102,11 @@ insert into t1 values ('aa'), ('bb'); select * from t1 where a in (NULL, 'aa'); drop table t1; +# BUG#13419 +create table t1 (id int, key(id)); +insert into t1 values (1),(2),(3); +select count(*) from t1 where id not in (1); +select count(*) from t1 where id not in (1,2); +drop table t1; + # End of 4.1 tests diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 59b82b53b32..0d9cab6a36b 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2140,7 +2140,6 @@ merge_key_fields(KEY_FIELD *start,KEY_FIELD *new_fields,KEY_FIELD *end, field Field used in comparision eq_func True if we used =, <=> or IS NULL value Value used for comparison with field - Is NULL for BETWEEN and IN usable_tables Tables which can be used for key optimization NOTES @@ -2325,7 +2324,8 @@ add_key_fields(KEY_FIELD **key_fields,uint *and_level, add_key_field(key_fields,*and_level,cond_func, ((Item_field*)(cond_func->key_item()->real_item()))->field, cond_func->argument_count() == 2 && - cond_func->functype() == Item_func::IN_FUNC, + cond_func->functype() == Item_func::IN_FUNC && + !((Item_func_in*)cond_func)->negated, cond_func->arguments()+1, cond_func->argument_count()-1, usable_tables); break; From 8acd0fa42239755f026faec2e9a9fd585e1d684a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Sep 2005 14:31:31 +0300 Subject: [PATCH 099/225] InnoDB: Minor fixes. innobase/include/trx0trx.h: Fix invalid comment. sql/ha_innodb.cc: Change some memory allocations to fail-on-error. Cast argument of my_free to gptr, not char*. --- innobase/include/trx0trx.h | 2 +- sql/ha_innodb.cc | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h index 5dbf003594f..80f602bad5e 100644 --- a/innobase/include/trx0trx.h +++ b/innobase/include/trx0trx.h @@ -205,7 +205,7 @@ trx_recover_for_mysql( XID* xid_list, /* in/out: prepared transactions */ ulint len); /* in: number of slots in xid_list */ /*********************************************************************** -This function is used to commit one X/Open XA distributed transaction +This function is used to find one X/Open XA distributed transaction which is in the prepared state */ trx_t * trx_get_trx_by_xid( diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 007194e09b3..0b840231d13 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -1252,7 +1252,7 @@ innobase_init(void) copy of it: */ internal_innobase_data_file_path = my_strdup(innobase_data_file_path, - MYF(MY_WME)); + MYF(MY_FAE)); ret = (bool) srv_parse_data_file_paths_and_sizes( internal_innobase_data_file_path, @@ -2386,7 +2386,7 @@ ha_innobase::open( "how you can resolve the problem.\n", norm_name); free_share(share); - my_free((char*) upd_buff, MYF(0)); + my_free((gptr) upd_buff, MYF(0)); my_errno = ENOENT; DBUG_RETURN(HA_ERR_NO_SUCH_TABLE); @@ -2404,7 +2404,7 @@ ha_innobase::open( "how you can resolve the problem.\n", norm_name); free_share(share); - my_free((char*) upd_buff, MYF(0)); + my_free((gptr) upd_buff, MYF(0)); my_errno = ENOENT; dict_table_decrement_handle_count(ib_table); @@ -2498,7 +2498,7 @@ ha_innobase::close(void) row_prebuilt_free((row_prebuilt_t*) innobase_prebuilt); - my_free((char*) upd_buff, MYF(0)); + my_free((gptr) upd_buff, MYF(0)); free_share(share); /* Tell InnoDB server that there might be work for @@ -5147,7 +5147,7 @@ ha_innobase::records_in_range( mysql_byte* key_val_buff2 = (mysql_byte*) my_malloc( table->s->reclength + table->s->max_key_length + 100, - MYF(MY_WME)); + MYF(MY_FAE)); ulint buff2_len = table->s->reclength + table->s->max_key_length + 100; dtuple_t* range_start; @@ -5206,7 +5206,7 @@ ha_innobase::records_in_range( dtuple_free_for_mysql(heap1); dtuple_free_for_mysql(heap2); - my_free((char*) key_val_buff2, MYF(0)); + my_free((gptr) key_val_buff2, MYF(0)); prebuilt->trx->op_info = (char*)""; From b9ace625400f3b5c13c23236d13f93a2f886b326 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Sep 2005 14:07:31 +0200 Subject: [PATCH 100/225] Bug #7037 Test "mysql_protocols" fails on Solaris 8 + 9 /x86 mysys/my_init.c: Updated after review --- mysys/my_init.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mysys/my_init.c b/mysys/my_init.c index c50c00c1e5c..3e5130ec670 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -127,9 +127,14 @@ my_bool my_init(void) void my_end(int infoflag) { - DBUG_ENTER("my_end"); + /* + this code is suboptimal to workaround a bug in + Sun CC: Sun C++ 5.6 2004/06/02 for x86, and should not be + optimized until this compiler is not in use anymore + */ FILE *info_file= DBUG_FILE; - bool print_info= (info_file != stderr); + my_bool print_info= (info_file != stderr); + DBUG_ENTER("my_end"); if (!info_file) { info_file= stderr; From 72a8049b0dda6e06d893f3be64a2aced4c94eed4 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Sep 2005 14:37:22 +0200 Subject: [PATCH 101/225] Merge from 4.1 to 5.0 mysql-test/r/loaddata.result: Add drop tablea after test case mysql-test/r/type_decimal.result: Update warnings mysql-test/r/union.result: Miss in merge mysql-test/t/loaddata.test: Add drop table after test case sql/opt_sum.cc: Add missing } sql/sql_load.cc: Manual merge --- mysql-test/r/loaddata.result | 1 + mysql-test/r/type_decimal.result | 4 +++- mysql-test/r/union.result | 15 --------------- mysql-test/t/loaddata.test | 1 + sql/opt_sum.cc | 1 + sql/sql_load.cc | 7 +++++-- 6 files changed, 11 insertions(+), 18 deletions(-) diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index e2cd89a58dc..f9d47e3533c 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -76,6 +76,7 @@ select * from t1; id 0 SET @@SQL_MODE=@OLD_SQL_MODE; +drop table t1; create table t1 (a int default 100, b int, c varchar(60)); load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b); select * from t1; diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index 45334886823..56a2bceeccf 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -674,9 +674,11 @@ a drop table t1; create table t1(a decimal(10,5), b decimal(10,1)); insert into t1 values(123.12345, 123.12345); +Warnings: +Note 1265 Data truncated for column 'b' at row 1 update t1 set b=a; Warnings: -Warning 1265 Data truncated for column 'b' at row 1 +Note 1265 Data truncated for column 'b' at row 1 select * from t1; a b 123.12345 123.1 diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index eb129e32983..042dfb5ad8d 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -780,21 +780,6 @@ t1 CREATE TABLE `t1` ( `b` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1,t2; -create table t1 (d decimal(10,1)); -create table t2 (d decimal(10,9)); -insert into t1 values ("100000000.0"); -insert into t2 values ("1.23456780"); -create table t3 select * from t2 union select * from t1; -select * from t3; -d -1.234567800 -100000000.000000000 -show create table t3; -Table Create Table -t3 CREATE TABLE `t3` ( - `d` decimal(18,9) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -drop table t1,t2,t3; create table t1 select 1 union select -1; select * from t1; 1 diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index 54309e45c7e..cd3a8f0fd92 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -57,6 +57,7 @@ enable_query_log; select * from t1; --exec rm $MYSQL_TEST_DIR/var/tmp/t1 SET @@SQL_MODE=@OLD_SQL_MODE; +drop table t1; # End of 4.1 tests diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index d598b8e6402..2f54cce0275 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -167,6 +167,7 @@ int opt_sum_query(TABLE_LIST *tables, List &all_fields,COND *conds) { ((Item_sum_count*) item)->make_const(count); recalc_const_item= 1; + } } else const_result= 0; diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 269c19b36d0..30398375360 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -677,8 +677,6 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, pos=read_info.row_start; length=(uint) (read_info.row_end-pos); - if (field == table->next_number_field) - table->auto_increment_field_not_null= TRUE; if (!read_info.enclosed && (enclosed_length && length == 4 && !memcmp(pos,"NULL",4)) || (length == 1 && read_info.found_null)) @@ -688,6 +686,8 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, Field *field= ((Item_field *)item)->field; field->reset(); field->set_null(); + if (field == table->next_number_field) + table->auto_increment_field_not_null= TRUE; if (!field->maybe_null()) { if (field->type() == FIELD_TYPE_TIMESTAMP) @@ -705,9 +705,12 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, if (item->type() == Item::FIELD_ITEM) { + Field *field= ((Item_field *)item)->field; field->set_notnull(); read_info.row_end[0]=0; // Safe to change end marker + if (field == table->next_number_field) + table->auto_increment_field_not_null= TRUE; field->store((char*) pos, length, read_info.read_charset); } else From dfabe1ed3413364f824afce55d1dfc7845ce1581 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Sep 2005 16:59:19 +0400 Subject: [PATCH 102/225] Fixed race conditions in rpl_multi_update and rpl_multi_delete tests which caused spurious test failures. mysql-test/t/rpl_multi_delete.test: Fixed race condition in test that caused spurious test failure. To have predictable result from statements which are run on slave we need to sync master and slave explicitly. mysql-test/t/rpl_multi_update.test: Fixed race condition in test that caused spurious test failure. To have predictable result from statements which are run on slave we need to sync master and slave explicitly. --- mysql-test/t/rpl_multi_delete.test | 2 +- mysql-test/t/rpl_multi_update.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/t/rpl_multi_delete.test b/mysql-test/t/rpl_multi_delete.test index 0538d0d7bae..4a8c0ab6912 100644 --- a/mysql-test/t/rpl_multi_delete.test +++ b/mysql-test/t/rpl_multi_delete.test @@ -24,7 +24,7 @@ connection master; delete from t1; delete from t2; -connection slave; +sync_slave_with_master; # force a difference to see if master's multi-DELETE will correct it insert into t1 values(1); insert into t2 values(1); diff --git a/mysql-test/t/rpl_multi_update.test b/mysql-test/t/rpl_multi_update.test index f400e722556..f6a960434ad 100644 --- a/mysql-test/t/rpl_multi_update.test +++ b/mysql-test/t/rpl_multi_update.test @@ -33,7 +33,7 @@ delete from t2; insert into t1 values(1,1); insert into t2 values(1,1); -connection slave; +sync_slave_with_master; # force a difference to see if master's multi-UPDATE will correct it update t1 set a=2; From e4b0b0d00cfb7e668f1890bbb050a476e45a1d5d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Sep 2005 16:22:27 +0300 Subject: [PATCH 103/225] Fix bug #3443, better foreign key error messsages. innobase/dict/dict0dict.c: Add 'add_newline' parameter to dict_print_info_on_foreign_key_in_create_format. innobase/include/dict0dict.h: Add 'add_newline' parameter to dict_print_info_on_foreign_key_in_create_format. innobase/include/os0file.h: Add os_file_read_string. innobase/include/trx0trx.h: Add trx_set_detailed_error and trx_set_detailed_error_from_file functions and a detailed_error field to trx_struct. innobase/include/ut0mem.h: Add ut_strlcpy. innobase/os/os0file.c: Add os_file_read_string. innobase/row/row0ins.c: Add row_ins_set_detailed function and call it when needed. Adapt to changes in dict_print_info_on_foreign_key_in_create_format. innobase/trx/trx0trx.c: Add trx_set_detailed_error and trx_set_detailed_error_from_file. Clear trx->detailed_error in trx_create. innobase/ut/ut0mem.c: Add ut_strlcpy. mysql-test/r/innodb.result: Add new tests, adapt existing ones whose output was changed. mysql-test/t/innodb.test: Add new tests, adapt existing ones whose output was changed. sql/ha_innodb.cc: Add get_error_message. Clear trx->detailed_error in start_stmt and external_lock. sql/ha_innodb.h: Add get_error_message. sql/handler.cc: Add special case code in print_error for HA_ERR_ROW_IS_REFERENCED and HA_ERR_NO_REFERENCED_ROW. Change SETMSG to point to new error messages. sql/share/errmsg.txt: Add ER_ROW_IS_REFERENCED_2 and ER_NO_REFERENCED_ROW_2. --- innobase/dict/dict0dict.c | 22 +++++++++++++------ innobase/include/dict0dict.h | 7 +++--- innobase/include/os0file.h | 11 ++++++++++ innobase/include/trx0trx.h | 19 ++++++++++++++++ innobase/include/ut0mem.h | 12 +++++++++++ innobase/os/os0file.c | 23 ++++++++++++++++++++ innobase/row/row0ins.c | 40 ++++++++++++++++++++++++++++++---- innobase/trx/trx0trx.c | 27 +++++++++++++++++++++++ innobase/ut/ut0mem.c | 25 +++++++++++++++++++++ mysql-test/r/innodb.result | 29 ++++++++++++++++++++++--- mysql-test/t/innodb.test | 42 +++++++++++++++++++++++++++++++++--- sql/ha_innodb.cc | 16 ++++++++++++++ sql/ha_innodb.h | 2 ++ sql/handler.cc | 20 +++++++++++------ sql/share/errmsg.txt | 4 ++++ 15 files changed, 274 insertions(+), 25 deletions(-) diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 5eee57c250b..54df582d39c 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -2189,7 +2189,7 @@ dict_foreign_error_report( dict_foreign_error_report_low(file, fk->foreign_table_name); fputs(msg, file); fputs(" Constraint:\n", file); - dict_print_info_on_foreign_key_in_create_format(file, NULL, fk); + dict_print_info_on_foreign_key_in_create_format(file, NULL, fk, TRUE); if (fk->foreign_index) { fputs("\nThe index in the foreign key in table is ", file); ut_print_name(file, NULL, fk->foreign_index->name); @@ -4330,9 +4330,10 @@ CREATE TABLE. */ void dict_print_info_on_foreign_key_in_create_format( /*============================================*/ - FILE* file, /* in: file where to print */ - trx_t* trx, /* in: transaction */ - dict_foreign_t* foreign)/* in: foreign key constraint */ + FILE* file, /* in: file where to print */ + trx_t* trx, /* in: transaction */ + dict_foreign_t* foreign, /* in: foreign key constraint */ + ibool add_newline) /* in: whether to add a newline */ { const char* stripped_id; ulint i; @@ -4345,7 +4346,16 @@ dict_print_info_on_foreign_key_in_create_format( stripped_id = foreign->id; } - fputs(",\n CONSTRAINT ", file); + putc(',', file); + + if (add_newline) { + /* SHOW CREATE TABLE wants constraints each printed nicely + on its own line, while error messages want no newlines + inserted. */ + fputs("\n ", file); + } + + fputs(" CONSTRAINT ", file); ut_print_name(file, trx, stripped_id); fputs(" FOREIGN KEY (", file); @@ -4447,7 +4457,7 @@ dict_print_info_on_foreign_keys( while (foreign != NULL) { if (create_table_format) { dict_print_info_on_foreign_key_in_create_format( - file, trx, foreign); + file, trx, foreign, TRUE); } else { ulint i; fputs("; (", file); diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h index a1232acdca7..5215d51cabe 100644 --- a/innobase/include/dict0dict.h +++ b/innobase/include/dict0dict.h @@ -375,9 +375,10 @@ CREATE TABLE. */ void dict_print_info_on_foreign_key_in_create_format( /*============================================*/ - FILE* file, /* in: file where to print */ - trx_t* trx, /* in: transaction */ - dict_foreign_t* foreign);/* in: foreign key constraint */ + FILE* file, /* in: file where to print */ + trx_t* trx, /* in: transaction */ + dict_foreign_t* foreign, /* in: foreign key constraint */ + ibool add_newline); /* in: whether to add a newline */ /************************************************************************ Displays the names of the index and the table. */ void diff --git a/innobase/include/os0file.h b/innobase/include/os0file.h index adbc4afafd2..224fd59a76b 100644 --- a/innobase/include/os0file.h +++ b/innobase/include/os0file.h @@ -432,6 +432,17 @@ os_file_read( offset */ ulint n); /* in: number of bytes to read */ /*********************************************************************** +Rewind file to its start, read at most size - 1 bytes from it to str, and +NUL-terminate str. All errors are silently ignored. This function is +mostly meant to be used with temporary files. */ + +void +os_file_read_string( +/*================*/ + FILE* file, /* in: file to read from */ + char* str, /* in: buffer where to read */ + ulint size); /* in: size of buffer */ +/*********************************************************************** Requests a synchronous positioned read operation. This function does not do any error handling. In case of error it returns FALSE. */ diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h index 5dbf003594f..b2081147351 100644 --- a/innobase/include/trx0trx.h +++ b/innobase/include/trx0trx.h @@ -56,6 +56,22 @@ void trx_search_latch_release_if_reserved( /*=================================*/ trx_t* trx); /* in: transaction */ +/********************************************************************** +Set detailed error message for the transaction. */ +void +trx_set_detailed_error( +/*===================*/ + trx_t* trx, /* in: transaction struct */ + char* msg); /* in: detailed error message */ +/***************************************************************** +Set detailed error message for the transaction from a file. Note that the +file is rewinded before reading from it. */ + +void +trx_set_detailed_error_from_file( +/*=============================*/ + trx_t* trx, /* in: transaction struct */ + FILE* file); /* in: file to read message from */ /******************************************************************** Retrieves the error_info field from a trx. */ @@ -649,6 +665,9 @@ struct trx_struct{ trx_undo_arr_t* undo_no_arr; /* array of undo numbers of undo log records which are currently processed by a rollback operation */ + /*------------------------------*/ + char detailed_error[256]; /* detailed error message for last + error, or empty. */ }; #define TRX_MAX_N_THREADS 32 /* maximum number of concurrent diff --git a/innobase/include/ut0mem.h b/innobase/include/ut0mem.h index 74357f6bf13..8f109a64b55 100644 --- a/innobase/include/ut0mem.h +++ b/innobase/include/ut0mem.h @@ -118,6 +118,18 @@ UNIV_INLINE int ut_strcmp(const void* str1, const void* str2); +/************************************************************************** +Copies up to size - 1 characters from the NUL-terminated string src to +dst, NUL-terminating the result. Returns strlen(src), so truncation +occurred if the return value >= size. */ +ulint +ut_strlcpy( +/*=======*/ + /* out: strlen(src) */ + char* dst, /* in: destination buffer */ + const char* src, /* in: source buffer */ + ulint size); /* in: size of destination buffer */ + /************************************************************************** Compute strlen(ut_strcpyq(str, q)). */ UNIV_INLINE diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 9c87b59f018..20a3303d12d 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -2248,6 +2248,29 @@ error_handling: return(FALSE); } +/*********************************************************************** +Rewind file to its start, read at most size - 1 bytes from it to str, and +NUL-terminate str. All errors are silently ignored. This function is +mostly meant to be used with temporary files. */ + +void +os_file_read_string( +/*================*/ + FILE* file, /* in: file to read from */ + char* str, /* in: buffer where to read */ + ulint size) /* in: size of buffer */ +{ + size_t flen; + + if (size == 0) { + return; + } + + rewind(file); + flen = fread(str, 1, size - 1, file); + str[flen] = '\0'; +} + /*********************************************************************** Requests a synchronous write operation. */ diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c index 75d8117a73e..60d7a640f9a 100644 --- a/innobase/row/row0ins.c +++ b/innobase/row/row0ins.c @@ -578,6 +578,30 @@ row_ins_cascade_calc_update_vec( return(n_fields_updated); } +/************************************************************************* +Set detailed error message associated with foreign key errors for +the given transaction. */ +static +void +row_ins_set_detailed( +/*=================*/ + trx_t* trx, /* in: transaction */ + dict_foreign_t* foreign) /* in: foreign key constraint */ +{ + + FILE* tf = os_file_create_tmpfile(); + + ut_a(tf); + + ut_print_name(tf, trx, foreign->foreign_table_name); + dict_print_info_on_foreign_key_in_create_format(tf, trx, + foreign, FALSE); + + trx_set_detailed_error_from_file(trx, tf); + + fclose(tf); +} + /************************************************************************* Reports a foreign key error associated with an update or a delete of a parent table index entry. */ @@ -598,6 +622,8 @@ row_ins_foreign_report_err( FILE* ef = dict_foreign_err_file; trx_t* trx = thr_get_trx(thr); + row_ins_set_detailed(trx, foreign); + mutex_enter(&dict_foreign_err_mutex); rewind(ef); ut_print_timestamp(ef); @@ -607,7 +633,8 @@ row_ins_foreign_report_err( fputs("Foreign key constraint fails for table ", ef); ut_print_name(ef, trx, foreign->foreign_table_name); fputs(":\n", ef); - dict_print_info_on_foreign_key_in_create_format(ef, trx, foreign); + dict_print_info_on_foreign_key_in_create_format(ef, trx, foreign, + TRUE); putc('\n', ef); fputs(errstr, ef); fputs(" in parent table, in index ", ef); @@ -648,7 +675,9 @@ row_ins_foreign_report_add_err( child table */ { FILE* ef = dict_foreign_err_file; - + + row_ins_set_detailed(trx, foreign); + mutex_enter(&dict_foreign_err_mutex); rewind(ef); ut_print_timestamp(ef); @@ -657,7 +686,8 @@ row_ins_foreign_report_add_err( fputs("Foreign key constraint fails for table ", ef); ut_print_name(ef, trx, foreign->foreign_table_name); fputs(":\n", ef); - dict_print_info_on_foreign_key_in_create_format(ef, trx, foreign); + dict_print_info_on_foreign_key_in_create_format(ef, trx, foreign, + TRUE); fputs("\nTrying to add in child table, in index ", ef); ut_print_name(ef, trx, foreign->foreign_index->name); if (entry) { @@ -1223,6 +1253,8 @@ run_again: if (check_table == NULL || check_table->ibd_file_missing) { if (check_ref) { + row_ins_set_detailed(trx, foreign); + FILE* ef = dict_foreign_err_file; mutex_enter(&dict_foreign_err_mutex); rewind(ef); @@ -1233,7 +1265,7 @@ run_again: ut_print_name(ef, trx, foreign->foreign_table_name); fputs(":\n", ef); dict_print_info_on_foreign_key_in_create_format(ef, - trx, foreign); + trx, foreign, TRUE); fputs("\nTrying to add to index ", ef); ut_print_name(ef, trx, foreign->foreign_index->name); fputs(" tuple:\n", ef); diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c index 078befb81d2..10b95179a73 100644 --- a/innobase/trx/trx0trx.c +++ b/innobase/trx/trx0trx.c @@ -52,6 +52,32 @@ trx_start_if_not_started_noninline( trx_start_if_not_started(trx); } +/***************************************************************** +Set detailed error message for the transaction. */ + +void +trx_set_detailed_error( +/*===================*/ + trx_t* trx, /* in: transaction struct */ + char* msg) /* in: detailed error message */ +{ + ut_strlcpy(trx->detailed_error, msg, sizeof(trx->detailed_error)); +} + +/***************************************************************** +Set detailed error message for the transaction from a file. Note that the +file is rewinded before reading from it. */ + +void +trx_set_detailed_error_from_file( +/*=============================*/ + trx_t* trx, /* in: transaction struct */ + FILE* file) /* in: file to read message from */ +{ + os_file_read_string(file, trx->detailed_error, + sizeof(trx->detailed_error)); +} + /******************************************************************** Retrieves the error_info field from a trx. */ @@ -130,6 +156,7 @@ trx_create( trx->undo_no_arr = NULL; trx->error_state = DB_SUCCESS; + trx->detailed_error[0] = '\0'; trx->sess = sess; trx->que_state = TRX_QUE_RUNNING; diff --git a/innobase/ut/ut0mem.c b/innobase/ut/ut0mem.c index 3e8fd79a739..c1e3ebbf35c 100644 --- a/innobase/ut/ut0mem.c +++ b/innobase/ut/ut0mem.c @@ -342,6 +342,31 @@ ut_free_all_mem(void) } } +/************************************************************************** +Copies up to size - 1 characters from the NUL-terminated string src to +dst, NUL-terminating the result. Returns strlen(src), so truncation +occurred if the return value >= size. */ + +ulint +ut_strlcpy( +/*=======*/ + /* out: strlen(src) */ + char* dst, /* in: destination buffer */ + const char* src, /* in: source buffer */ + ulint size) /* in: size of destination buffer */ +{ + ulint src_size = strlen(src); + + if (size != 0) { + ulint n = ut_min(src_size, size - 1); + + memcpy(dst, src, n); + dst[n] = '\0'; + } + + return src_size; +} + /************************************************************************** Make a quoted copy of a NUL-terminated string. Leading and trailing quotes will not be included; only embedded quotes will be escaped. diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index ffc4ab08ab4..d528e7f43d9 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1378,9 +1378,9 @@ insert into `t2`values ( 1 ) ; create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) engine = innodb; insert into `t3`values ( 1 ) ; delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; -ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test/t2`, CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)) update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; -ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test/t2`, CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)) update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; ERROR 42S22: Unknown column 't1.id' in 'where clause' drop table t3,t2,t1; @@ -1392,7 +1392,7 @@ foreign key(pid) references t1(id) on delete cascade) engine=innodb; insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6), (8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14); delete from t1 where id=0; -ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test/t1`, CONSTRAINT `t1_ibfk_1` FOREIGN KEY (`pid`) REFERENCES `t1` (`id`) ON DELETE CASCADE) delete from t1 where id=15; delete from t1 where id=0; drop table t1; @@ -2559,3 +2559,26 @@ FOREIGN KEY (b) REFERENCES test.t1(id) ) ENGINE=InnoDB; Got one of the listed errors DROP TABLE t1; +CREATE TABLE t1 +( +id INT PRIMARY KEY +) ENGINE=InnoDB; +CREATE TABLE t2 +( +v INT, +CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES(2); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test/t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`)) +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1); +DELETE FROM t1 WHERE id = 1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test/t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`)) +DROP TABLE t1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +SET FOREIGN_KEY_CHECKS=0; +DROP TABLE t1; +SET FOREIGN_KEY_CHECKS=1; +INSERT INTO t2 VALUES(3); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test/t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`)) +DROP TABLE t2; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 94f33738c8c..d0ebcb9aee8 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -978,9 +978,9 @@ create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) insert into `t2`values ( 1 ) ; create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) engine = innodb; insert into `t3`values ( 1 ) ; ---error 1217 +--error 1451 delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; ---error 1217 +--error 1451 update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; --error 1054 update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; @@ -996,7 +996,7 @@ create table t1( foreign key(pid) references t1(id) on delete cascade) engine=innodb; insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6), (8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14); --- error 1217 +-- error 1451 delete from t1 where id=0; delete from t1 where id=15; delete from t1 where id=0; @@ -1482,3 +1482,39 @@ CREATE TEMPORARY TABLE t2 FOREIGN KEY (b) REFERENCES test.t1(id) ) ENGINE=InnoDB; DROP TABLE t1; + +# +# Test improved foreign key error messages (bug #3443) +# + +CREATE TABLE t1 +( + id INT PRIMARY KEY +) ENGINE=InnoDB; + +CREATE TABLE t2 +( + v INT, + CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id) +) ENGINE=InnoDB; + +--error 1452 +INSERT INTO t2 VALUES(2); + +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1); + +--error 1451 +DELETE FROM t1 WHERE id = 1; + +--error 1217 +DROP TABLE t1; + +SET FOREIGN_KEY_CHECKS=0; +DROP TABLE t1; +SET FOREIGN_KEY_CHECKS=1; + +--error 1452 +INSERT INTO t2 VALUES(3); + +DROP TABLE t2; diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 9e10873ad63..d66996f8029 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -6065,6 +6065,8 @@ ha_innobase::start_stmt( } } + trx->detailed_error[0] = '\0'; + /* Set the MySQL flag to mark that there is an active transaction */ if (trx->active_trans == 0) { @@ -6138,6 +6140,8 @@ ha_innobase::external_lock( if (lock_type != F_UNLCK) { /* MySQL is setting a new table lock */ + trx->detailed_error[0] = '\0'; + /* Set the MySQL flag to mark that there is an active transaction */ if (trx->active_trans == 0) { @@ -6941,6 +6945,18 @@ ha_innobase::reset_auto_increment(ulonglong value) DBUG_RETURN(0); } +/* See comment in handler.cc */ +bool +ha_innobase::get_error_message(int error, String *buf) +{ + trx_t* trx = check_trx_exists(current_thd); + + buf->copy(trx->detailed_error, strlen(trx->detailed_error), + system_charset_info); + + return FALSE; +} + /*********************************************************************** Compares two 'refs'. A 'ref' is the (internal) primary key value of the row. If there is no explicitly declared non-null unique key or a primary key, then diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index 1c02ac20bb4..d3c7af432a0 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -174,6 +174,8 @@ class ha_innobase: public handler void init_table_handle_for_HANDLER(); ulonglong get_auto_increment(); int reset_auto_increment(ulonglong value); + + virtual bool get_error_message(int error, String *buf); uint8 table_cache_type() { return HA_CACHE_TBL_ASKTRANSACT; } /* diff --git a/sql/handler.cc b/sql/handler.cc index 612fd0e0ca5..e0698b37e5f 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -344,8 +344,8 @@ static int ha_init_errors(void) SETMSG(HA_ERR_READ_ONLY_TRANSACTION, ER(ER_READ_ONLY_TRANSACTION)); SETMSG(HA_ERR_LOCK_DEADLOCK, ER(ER_LOCK_DEADLOCK)); SETMSG(HA_ERR_CANNOT_ADD_FOREIGN, ER(ER_CANNOT_ADD_FOREIGN)); - SETMSG(HA_ERR_NO_REFERENCED_ROW, ER(ER_NO_REFERENCED_ROW)); - SETMSG(HA_ERR_ROW_IS_REFERENCED, ER(ER_ROW_IS_REFERENCED)); + SETMSG(HA_ERR_NO_REFERENCED_ROW, ER(ER_NO_REFERENCED_ROW_2)); + SETMSG(HA_ERR_ROW_IS_REFERENCED, ER(ER_ROW_IS_REFERENCED_2)); SETMSG(HA_ERR_NO_SAVEPOINT, "No savepoint with that name"); SETMSG(HA_ERR_NON_UNIQUE_BLOCK_SIZE, "Non unique key block size"); SETMSG(HA_ERR_NO_SUCH_TABLE, "No such table: '%.64s'"); @@ -1798,11 +1798,19 @@ void handler::print_error(int error, myf errflag) textno=ER_CANNOT_ADD_FOREIGN; break; case HA_ERR_ROW_IS_REFERENCED: - textno=ER_ROW_IS_REFERENCED; - break; + { + String str; + get_error_message(error, &str); + my_error(ER_ROW_IS_REFERENCED_2, MYF(0), str.c_ptr_safe()); + DBUG_VOID_RETURN; + } case HA_ERR_NO_REFERENCED_ROW: - textno=ER_NO_REFERENCED_ROW; - break; + { + String str; + get_error_message(error, &str); + my_error(ER_NO_REFERENCED_ROW_2, MYF(0), str.c_ptr_safe()); + DBUG_VOID_RETURN; + } case HA_ERR_TABLE_DEF_CHANGED: textno=ER_TABLE_DEF_CHANGED; break; diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 09589c98dce..c9b717211ce 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5415,3 +5415,7 @@ ER_NO_SUCH_USER eng "There is not %-.64s@%-.64s registered" ER_FORBID_SCHEMA_CHANGE eng "Changing schema from '%-.64s' to '%-.64s' is not allowed." +ER_ROW_IS_REFERENCED_2 23000 + eng "Cannot delete or update a parent row: a foreign key constraint fails (%.192s)" +ER_NO_REFERENCED_ROW_2 23000 + eng "Cannot add or update a child row: a foreign key constraint fails (%.192s)" From ecffc1b83c45c3a804c0d7abc586c448365043cc Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Sep 2005 16:47:08 +0300 Subject: [PATCH 104/225] Several fixes revelaled by Intel compiler. cmd-line-utils/readline/complete.c: Added a cast. dbug/my_main.c: Added an include to avoid implicit declaration of my_thread_global_init() include/my_global.h: undef cannot be used on this predefined name. Since it is a custom fix for gcc 2.8.0, let's make it only effective in that case. include/my_sys.h: Added a new type, TYPE_NOT_SET. myisam/ft_boolean_search.c: Added casts. myisam/mi_key.c: Added cast. myisam/mi_open.c: Added cast. Changed function types. myisam/mi_test1.c: Added cast. myisam/myisamchk.c: Added cast. myisam/myisamdef.h: Changed function type. myisam/myisampack.c: Added casts. myisam/sp_key.c: Added cast. mysys/mf_iocache.c: Fixed invalid use of 0 to info->type. According to comment it should not have been set, but in earlier code by setting it to 0 would have been same as setting it to READ_CACHE. This probably was not desired, potential bug. server-tools/instance-manager/instance_options.cc: Fixed a typo. server-tools/instance-manager/protocol.cc: Changed enum to int. Changed char to uchar. Added casts. sql/mysql_priv.h: Bit overflow. sql/sql_base.cc: Removed unused label. The code below label was unused too, because there is a return just before. sql/sql_parse.cc: Removed unneccessary extra argument. --- cmd-line-utils/readline/complete.c | 4 +++- dbug/my_main.c | 1 + include/my_global.h | 2 +- include/my_sys.h | 2 +- myisam/ft_boolean_search.c | 3 ++- myisam/mi_key.c | 2 +- myisam/mi_open.c | 7 ++++--- myisam/mi_test1.c | 5 +++-- myisam/myisamchk.c | 2 +- myisam/myisamdef.h | 4 ++-- myisam/myisampack.c | 18 ++++++++++-------- myisam/sp_key.c | 2 +- mysys/mf_iocache.c | 4 ++-- .../instance-manager/instance_options.cc | 2 +- server-tools/instance-manager/protocol.cc | 14 +++++++------- sql/mysql_priv.h | 2 +- sql/sql_base.cc | 3 --- sql/sql_parse.cc | 3 +-- 18 files changed, 42 insertions(+), 38 deletions(-) diff --git a/cmd-line-utils/readline/complete.c b/cmd-line-utils/readline/complete.c index 2196c66a54c..5879100e0a6 100644 --- a/cmd-line-utils/readline/complete.c +++ b/cmd-line-utils/readline/complete.c @@ -25,6 +25,7 @@ #include #include + #if defined (HAVE_SYS_FILE_H) # include #endif @@ -1149,7 +1150,8 @@ compute_lcd_of_matches (match_list, matches, text) rl_completion_found_quote && rl_filename_quoting_desired) { - dtext = (*rl_filename_dequoting_function) (text, rl_completion_quote_character); + dtext = (*rl_filename_dequoting_function) + ((char*) text, rl_completion_quote_character); text = dtext; } diff --git a/dbug/my_main.c b/dbug/my_main.c index ed1c9329235..31c15aa67aa 100644 --- a/dbug/my_main.c +++ b/dbug/my_main.c @@ -8,6 +8,7 @@ #endif #include /* This includes dbug.h */ +#include int main (argc, argv) int argc; diff --git a/include/my_global.h b/include/my_global.h index 48dd165dba1..b32a8fe6baa 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -238,7 +238,7 @@ C_MODE_END /* Fix a bug in gcc 2.8.0 on IRIX 6.2 */ -#if SIZEOF_LONG == 4 && defined(__LONG_MAX__) +#if SIZEOF_LONG == 4 && defined(__LONG_MAX__) && (__GNUC__ == 2 && __GNUC_MINOR__ == 8) #undef __LONG_MAX__ /* Is a longlong value in gcc 2.8.0 ??? */ #define __LONG_MAX__ 2147483647 #endif diff --git a/include/my_sys.h b/include/my_sys.h index e21af78fcaa..ad42c99a86e 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -280,7 +280,7 @@ enum loglevel { enum cache_type { - READ_CACHE,WRITE_CACHE, + TYPE_NOT_SET, READ_CACHE, WRITE_CACHE, SEQ_READ_APPEND /* sequential read or append */, READ_FIFO, READ_NET,WRITE_NET}; diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index c18984c7584..19f0ef77136 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -473,7 +473,8 @@ static int _ftb_check_phrase(const byte *s0, const byte *e0, for (;;) { n_word= (FT_WORD *)phrase_element->data; - if (my_strnncoll(cs, h_word.pos, h_word.len, n_word->pos, n_word->len)) + if (my_strnncoll(cs, (const uchar *) h_word.pos, h_word.len, + (const uchar *) n_word->pos, n_word->len)) break; if (! (phrase_element= phrase_element->next)) DBUG_RETURN(1); diff --git a/myisam/mi_key.c b/myisam/mi_key.c index ae50900a190..4cabfc91197 100644 --- a/myisam/mi_key.c +++ b/myisam/mi_key.c @@ -358,7 +358,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr, byte *blob_ptr; DBUG_ENTER("_mi_put_key_in_record"); - blob_ptr= info->lastkey2; /* Place to put blob parts */ + blob_ptr= (byte*) info->lastkey2; /* Place to put blob parts */ key=(byte*) info->lastkey; /* KEy that was read */ key_end=key+info->lastkey_length; for (keyseg=info->s->keyinfo[keynr].seg ; keyseg->type ;keyseg++) diff --git a/myisam/mi_open.c b/myisam/mi_open.c index 82663e0c318..ffc418894e3 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -199,7 +199,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) DBUG_PRINT("warning",("saved_base_info_length: %d base_info_length: %d", len,MI_BASE_INFO_SIZE)) } - disk_pos=my_n_base_info_read((uchar*) disk_cache + base_pos, &share->base); + disk_pos= (char*) + my_n_base_info_read((uchar*) disk_cache + base_pos, &share->base); share->state.state_length=base_pos; if (!(open_flags & HA_OPEN_FOR_REPAIR) && @@ -863,7 +864,7 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite) } -char *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state) +uchar *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state) { uint i,keys,key_parts,key_blocks; memcpy_fixed(&state->header,ptr, sizeof(state->header)); @@ -974,7 +975,7 @@ uint mi_base_info_write(File file, MI_BASE_INFO *base) } -char *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base) +uchar *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base) { base->keystart = mi_sizekorr(ptr); ptr +=8; base->max_data_file_length = mi_sizekorr(ptr); ptr +=8; diff --git a/myisam/mi_test1.c b/myisam/mi_test1.c index 5727c699469..60225ccc7f3 100644 --- a/myisam/mi_test1.c +++ b/myisam/mi_test1.c @@ -237,7 +237,7 @@ static int run_test(const char *filename) pos=HA_OFFSET_ERROR; } if (found != row_count) - printf("Found %ld of %ld rows\n", found,row_count); + printf("Found %ld of %ld rows\n", (ulong) found, (ulong) row_count); } if (!silent) @@ -303,7 +303,8 @@ static int run_test(const char *filename) if ((error=mi_rrnd(file,read_record,i == 1 ? 0L : HA_OFFSET_ERROR)) == -1) { if (found != row_count-deleted) - printf("Found only %ld of %ld rows\n",found,row_count-deleted); + printf("Found only %ld of %ld rows\n", (ulong) found, + (ulong) (row_count - deleted)); break; } if (!error) diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index 10308408b1f..ff2ccfd15fd 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -705,7 +705,7 @@ get_one_option(int optid, fprintf(stderr, "Invalid value of stats_method: %s.\n", argument); exit(1); } - check_param.stats_method= method-1; + check_param.stats_method= (enum_mi_stats_method) (method-1); break; } #ifdef DEBUG /* Only useful if debugging */ diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h index 82f7fd7360e..3f4306b32aa 100644 --- a/myisam/myisamdef.h +++ b/myisam/myisamdef.h @@ -679,10 +679,10 @@ extern uint read_pack_length(uint version, const uchar *buf, ulong *length); extern uint calc_pack_length(uint version, ulong length); uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite); -char *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state); +uchar *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state); uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, my_bool pRead); uint mi_base_info_write(File file, MI_BASE_INFO *base); -char *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base); +uchar *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base); int mi_keyseg_write(File file, const HA_KEYSEG *keyseg); char *mi_keyseg_read(char *ptr, HA_KEYSEG *keyseg); uint mi_keydef_write(File file, MI_KEYDEF *keydef); diff --git a/myisam/myisampack.c b/myisam/myisampack.c index 3b091cd6ea2..225f7f1a830 100644 --- a/myisam/myisampack.c +++ b/myisam/myisampack.c @@ -2008,7 +2008,7 @@ static char *hexdigits(ulonglong value) static int write_header(PACK_MRG_INFO *mrg,uint head_length,uint trees, my_off_t tot_elements,my_off_t filelength) { - byte *buff=file_buffer.pos; + byte *buff= (byte*) file_buffer.pos; bzero(buff,HEAD_LENGTH); memcpy_fixed(buff,myisam_pack_file_magic,4); @@ -2024,7 +2024,7 @@ static int write_header(PACK_MRG_INFO *mrg,uint head_length,uint trees, if (test_only) return 0; VOID(my_seek(file_buffer.file,0L,MY_SEEK_SET,MYF(0))); - return my_write(file_buffer.file,file_buffer.pos,HEAD_LENGTH, + return my_write(file_buffer.file,(const byte *) file_buffer.pos,HEAD_LENGTH, MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL)) != 0; } @@ -2472,7 +2472,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts) { if (flush_buffer((ulong) max_calc_length + (ulong) max_pack_length)) break; - record_pos=file_buffer.pos; + record_pos= (byte*) file_buffer.pos; file_buffer.pos+=max_pack_length; for (start_pos=record, count= huff_counts; count < end_count ; count++) { @@ -2795,7 +2795,8 @@ static char *make_old_name(char *new_name, char *old_name) static void init_file_buffer(File file, pbool read_buffer) { file_buffer.file=file; - file_buffer.buffer=my_malloc(ALIGN_SIZE(RECORD_CACHE_SIZE),MYF(MY_WME)); + file_buffer.buffer= (uchar*) my_malloc(ALIGN_SIZE(RECORD_CACHE_SIZE), + MYF(MY_WME)); file_buffer.end=file_buffer.buffer+ALIGN_SIZE(RECORD_CACHE_SIZE)-8; file_buffer.pos_in_file=0; error_on_write=0; @@ -2837,7 +2838,8 @@ static int flush_buffer(ulong neaded_length) file_buffer.pos_in_file+=length; if (test_only) return 0; - if (error_on_write|| my_write(file_buffer.file,file_buffer.buffer, + if (error_on_write|| my_write(file_buffer.file, + (const byte*) file_buffer.buffer, length, MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL))) { @@ -2850,13 +2852,13 @@ static int flush_buffer(ulong neaded_length) { char *tmp; neaded_length+=256; /* some margin */ - tmp=my_realloc(file_buffer.buffer, neaded_length,MYF(MY_WME)); + tmp= my_realloc((char*) file_buffer.buffer, neaded_length,MYF(MY_WME)); if (!tmp) return 1; file_buffer.pos= ((uchar*) tmp + (ulong) (file_buffer.pos - file_buffer.buffer)); - file_buffer.buffer=tmp; - file_buffer.end=tmp+neaded_length-8; + file_buffer.buffer= (uchar*) tmp; + file_buffer.end= (uchar*) (tmp+neaded_length-8); } return 0; } diff --git a/myisam/sp_key.c b/myisam/sp_key.c index 1d43f89cba9..77cecdc0931 100644 --- a/myisam/sp_key.c +++ b/myisam/sp_key.c @@ -142,7 +142,7 @@ static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims, { if ((*wkb) > end - 8) return -1; - get_double(&ord, *wkb); + get_double(&ord, (const byte*) *wkb); (*wkb)+= 8; if (ord < *mbr) float8store((char*) mbr, ord); diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index b000af19aa0..63f5dc964da 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -165,7 +165,7 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize, (ulong) info, (int) type, (ulong) seek_offset)); info->file= file; - info->type= 0; /* Don't set it until mutex are created */ + info->type= TYPE_NOT_SET; /* Don't set it until mutex are created */ info->pos_in_file= seek_offset; info->pre_close = info->pre_read = info->post_read = 0; info->arg = 0; @@ -1246,7 +1246,7 @@ int end_io_cache(IO_CACHE *info) if (info->type == SEQ_READ_APPEND) { /* Destroy allocated mutex */ - info->type=0; + info->type= TYPE_NOT_SET; #ifdef THREAD pthread_mutex_destroy(&info->append_buffer_lock); #endif diff --git a/server-tools/instance-manager/instance_options.cc b/server-tools/instance-manager/instance_options.cc index 70950a91015..59bb3b61181 100644 --- a/server-tools/instance-manager/instance_options.cc +++ b/server-tools/instance-manager/instance_options.cc @@ -469,7 +469,7 @@ int Instance_options::add_option(const char* option) case SAVE_WHOLE: *(selected_options->value)= tmp; return 0; - defaut: + default: break; } } diff --git a/server-tools/instance-manager/protocol.cc b/server-tools/instance-manager/protocol.cc index cd1be805b6b..71c225e82c3 100644 --- a/server-tools/instance-manager/protocol.cc +++ b/server-tools/instance-manager/protocol.cc @@ -74,7 +74,7 @@ int net_send_error(struct st_net *net, uint sql_errno) MYSQL_ERRMSG_SIZE]; // message char *pos= buff; - enum { ERROR_PACKET_CODE= 255 }; + int ERROR_PACKET_CODE= 255; *pos++= ERROR_PACKET_CODE; int2store(pos, sql_errno); pos+= 2; @@ -95,7 +95,7 @@ int net_send_error_323(struct st_net *net, uint sql_errno) MYSQL_ERRMSG_SIZE]; // message char *pos= buff; - enum { ERROR_PACKET_CODE= 255 }; + int ERROR_PACKET_CODE= 255; *pos++= ERROR_PACKET_CODE; int2store(pos, sql_errno); pos+= 2; @@ -148,14 +148,14 @@ int store_to_protocol_packet(Buffer *buf, const char *string, uint *position) int send_eof(struct st_net *net) { - char buff[1 + /* eof packet code */ - 2 + /* warning count */ - 2]; /* server status */ + uchar buff[1 + /* eof packet code */ + 2 + /* warning count */ + 2]; /* server status */ buff[0]=254; int2store(buff+1, 0); int2store(buff+3, 0); - return my_net_write(net, buff, sizeof buff); + return my_net_write(net, (char*) buff, sizeof buff); } int send_fields(struct st_net *net, LIST *fields) @@ -195,7 +195,7 @@ int send_fields(struct st_net *net, LIST *fields) int2store(send_buff.buffer + position, 1); /* charsetnr */ int4store(send_buff.buffer + position + 2, field->length); /* field length */ - send_buff.buffer[position+6]= FIELD_TYPE_STRING; /* type */ + send_buff.buffer[position+6]= (uint) FIELD_TYPE_STRING; /* type */ int2store(send_buff.buffer + position + 7, 0); /* flags */ send_buff.buffer[position + 9]= (char) 0; /* decimals */ send_buff.buffer[position + 10]= 0; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index fc7bac89274..7e598543a38 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -284,7 +284,7 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset; /* Flag set if setup_tables already done */ #define OPTION_SETUP_TABLES_DONE (1L << 30) // intern /* If not set then the thread will ignore all warnings with level notes. */ -#define OPTION_SQL_NOTES (1L << 31) // THD, user +#define OPTION_SQL_NOTES (1UL << 31) // THD, user /* Force the used temporary table to be a MyISAM table (because we will use fulltext functions when reading from it. diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 16842c4969c..745d4070a05 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -4791,9 +4791,6 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves, } DBUG_RETURN(test(thd->net.report_error)); -err: - if (arena) - thd->restore_active_arena(arena, &backup); err_no_arena: DBUG_RETURN(1); } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index ff3d56266f6..b5c251df89e 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5644,8 +5644,7 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, and so on, the display width is ignored. */ char buf[32]; - my_snprintf(buf, sizeof(buf), - "TIMESTAMP(%s)", length, system_charset_info); + my_snprintf(buf, sizeof(buf), "TIMESTAMP(%s)", length); push_warning_printf(thd,MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DEPRECATED_SYNTAX, ER(ER_WARN_DEPRECATED_SYNTAX), From 9c0d809270a1d74ec33711d94cd65930eab11579 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Sep 2005 17:22:36 +0200 Subject: [PATCH 105/225] Bug#9112 - Merge table with composite index producing invalid results with some queries After merge fix --- mysql-test/t/merge.test | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 66ea1af1ed0..347a76c3991 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -312,7 +312,11 @@ create table t3 ( ) engine=myisam; insert into t2 values ( null, ''); +# We may have insufficient accuracy for 16 digits of '9'. +# Suppress a "truncate" warning due to accuracy problems. +--disable_warnings insert into t2 values ( 9999999999.999999, ''); +--enable_warnings insert into t3 select * from t2; select min(a), max(a) from t1; flush tables; From 4b314fc11d2b1edfa93502206e99b4332aa1b5d9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Sep 2005 21:28:47 +0400 Subject: [PATCH 106/225] Fix for yet another compilation failure on Windows which was introduced during work on WL#2787 "Add view definer/owner to the view definition (.frm) to check privileges on used tables and stored routines when using a VIEW." (aka bug #13402 "Windows VS 2003 Compiler error") sql/mysqld.cc: handle_connections_namedpipes(): THD::host member has moved to the Security_context class. New THD::security_ctx member points to active security context. --- sql/mysqld.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 677b68ca946..fc45a9d13fd 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4016,8 +4016,8 @@ extern "C" pthread_handler_decl(handle_connections_namedpipes,arg) delete thd; continue; } - /* host name is unknown */ - thd->host = my_strdup(my_localhost,MYF(0)); /* Host is unknown */ + /* Host is unknown */ + thd->security_ctx->host= my_strdup(my_localhost, MYF(0)); create_new_thread(thd); } From ab0d7e2ace7d8cb42835e8194da648ede1e03b14 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Sep 2005 21:28:56 +0300 Subject: [PATCH 107/225] Some minor fixes revealed as warnings by Intel compiler. client/mysqltest.c: Fixed a warning from using reference to a memory area, which is outside an object. This is just a minor clean-up, not a bug fix. server-tools/instance-manager/buffer.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/buffer.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/command.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/command.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/guardian.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/guardian.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/instance.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/instance.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/instance_map.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/instance_map.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/instance_options.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/instance_options.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/listener.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/listener.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/mysql_connection.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/mysql_connection.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/options.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/options.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/parse_output.cc: Removed unused goto. server-tools/instance-manager/thread_registry.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/thread_registry.h: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/user_map.cc: Fixed pragma warning for those compilers that do not support it. server-tools/instance-manager/user_map.h: Fixed pragma warning for those compilers that do not support it. sql/field.cc: Fixed a warning about overflow. sql/item.h: Fixed implicit function declaration warning. sql/item_sum.cc: Fixed implicit function declaration warning. --- client/mysqltest.c | 2 +- server-tools/instance-manager/buffer.cc | 2 +- server-tools/instance-manager/buffer.h | 2 +- server-tools/instance-manager/command.cc | 2 +- server-tools/instance-manager/command.h | 2 +- server-tools/instance-manager/guardian.cc | 2 +- server-tools/instance-manager/guardian.h | 2 +- server-tools/instance-manager/instance.cc | 2 +- server-tools/instance-manager/instance.h | 2 +- server-tools/instance-manager/instance_map.cc | 2 +- server-tools/instance-manager/instance_map.h | 2 +- server-tools/instance-manager/instance_options.cc | 2 +- server-tools/instance-manager/instance_options.h | 2 +- server-tools/instance-manager/listener.cc | 2 +- server-tools/instance-manager/listener.h | 2 +- server-tools/instance-manager/mysql_connection.cc | 2 +- server-tools/instance-manager/mysql_connection.h | 2 +- server-tools/instance-manager/options.cc | 2 +- server-tools/instance-manager/options.h | 2 +- server-tools/instance-manager/parse_output.cc | 1 - server-tools/instance-manager/thread_registry.cc | 2 +- server-tools/instance-manager/thread_registry.h | 2 +- server-tools/instance-manager/user_map.cc | 2 +- server-tools/instance-manager/user_map.h | 2 +- sql/field.cc | 2 +- sql/item.h | 3 +++ sql/item_sum.cc | 1 + 27 files changed, 28 insertions(+), 25 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index fdc1dec6dc1..f95204fddef 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -549,7 +549,7 @@ static void close_cons() static void close_files() { DBUG_ENTER("close_files"); - for (; cur_file != (file_stack-1) ; cur_file--) + for (; cur_file >= file_stack; cur_file--) { DBUG_PRINT("info", ("file_name: %s", cur_file->file_name)); if (cur_file->file && cur_file->file != stdin) diff --git a/server-tools/instance-manager/buffer.cc b/server-tools/instance-manager/buffer.cc index dd6e6e95704..8039ab24481 100644 --- a/server-tools/instance-manager/buffer.cc +++ b/server-tools/instance-manager/buffer.cc @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION) #pragma implementation #endif diff --git a/server-tools/instance-manager/buffer.h b/server-tools/instance-manager/buffer.h index 0c4d1eda102..afc71320ecb 100644 --- a/server-tools/instance-manager/buffer.h +++ b/server-tools/instance-manager/buffer.h @@ -19,7 +19,7 @@ #include #include -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE) #pragma interface #endif diff --git a/server-tools/instance-manager/command.cc b/server-tools/instance-manager/command.cc index 73dd49ef8b8..f76366d5661 100644 --- a/server-tools/instance-manager/command.cc +++ b/server-tools/instance-manager/command.cc @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION) #pragma implementation #endif diff --git a/server-tools/instance-manager/command.h b/server-tools/instance-manager/command.h index 8ae4e33b92f..82ded800e65 100644 --- a/server-tools/instance-manager/command.h +++ b/server-tools/instance-manager/command.h @@ -16,7 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE) #pragma interface #endif diff --git a/server-tools/instance-manager/guardian.cc b/server-tools/instance-manager/guardian.cc index 17f4204185a..a4c0cef41b3 100644 --- a/server-tools/instance-manager/guardian.cc +++ b/server-tools/instance-manager/guardian.cc @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION) #pragma implementation #endif diff --git a/server-tools/instance-manager/guardian.h b/server-tools/instance-manager/guardian.h index 758c4a3f3bc..16180e72dc9 100644 --- a/server-tools/instance-manager/guardian.h +++ b/server-tools/instance-manager/guardian.h @@ -22,7 +22,7 @@ #include #include -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE) #pragma interface #endif diff --git a/server-tools/instance-manager/instance.cc b/server-tools/instance-manager/instance.cc index 5e1c3d2ea9f..0c3c1aee5b4 100644 --- a/server-tools/instance-manager/instance.cc +++ b/server-tools/instance-manager/instance.cc @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION) #pragma implementation #endif diff --git a/server-tools/instance-manager/instance.h b/server-tools/instance-manager/instance.h index 003cbca8cef..adb66991685 100644 --- a/server-tools/instance-manager/instance.h +++ b/server-tools/instance-manager/instance.h @@ -19,7 +19,7 @@ #include #include "instance_options.h" -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE) #pragma interface #endif diff --git a/server-tools/instance-manager/instance_map.cc b/server-tools/instance-manager/instance_map.cc index b3a207ae79f..611eda457f2 100644 --- a/server-tools/instance-manager/instance_map.cc +++ b/server-tools/instance-manager/instance_map.cc @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION) #pragma implementation #endif diff --git a/server-tools/instance-manager/instance_map.h b/server-tools/instance-manager/instance_map.h index 47037e0d433..51971db4c2f 100644 --- a/server-tools/instance-manager/instance_map.h +++ b/server-tools/instance-manager/instance_map.h @@ -24,7 +24,7 @@ #include #include -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE) #pragma interface #endif diff --git a/server-tools/instance-manager/instance_options.cc b/server-tools/instance-manager/instance_options.cc index 59bb3b61181..25609f489af 100644 --- a/server-tools/instance-manager/instance_options.cc +++ b/server-tools/instance-manager/instance_options.cc @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION) #pragma implementation #endif diff --git a/server-tools/instance-manager/instance_options.h b/server-tools/instance-manager/instance_options.h index dc62d277a43..dae1c2695d1 100644 --- a/server-tools/instance-manager/instance_options.h +++ b/server-tools/instance-manager/instance_options.h @@ -21,7 +21,7 @@ #include "parse.h" #include "portability.h" -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE) #pragma interface #endif diff --git a/server-tools/instance-manager/listener.cc b/server-tools/instance-manager/listener.cc index 374946d3b73..a1c1a743c24 100644 --- a/server-tools/instance-manager/listener.cc +++ b/server-tools/instance-manager/listener.cc @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION) #pragma implementation #endif diff --git a/server-tools/instance-manager/listener.h b/server-tools/instance-manager/listener.h index 67a090c3aa2..3f5a80f1f53 100644 --- a/server-tools/instance-manager/listener.h +++ b/server-tools/instance-manager/listener.h @@ -16,7 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE) #pragma interface #endif diff --git a/server-tools/instance-manager/mysql_connection.cc b/server-tools/instance-manager/mysql_connection.cc index dfa12f6f6e2..4a32e95450e 100644 --- a/server-tools/instance-manager/mysql_connection.cc +++ b/server-tools/instance-manager/mysql_connection.cc @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION) #pragma interface #endif diff --git a/server-tools/instance-manager/mysql_connection.h b/server-tools/instance-manager/mysql_connection.h index e0109ce234f..2ff55d81e57 100644 --- a/server-tools/instance-manager/mysql_connection.h +++ b/server-tools/instance-manager/mysql_connection.h @@ -16,7 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE) #pragma interface #endif diff --git a/server-tools/instance-manager/options.cc b/server-tools/instance-manager/options.cc index 74ccade3a2c..b16fcabae01 100644 --- a/server-tools/instance-manager/options.cc +++ b/server-tools/instance-manager/options.cc @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION) #pragma implementation #endif diff --git a/server-tools/instance-manager/options.h b/server-tools/instance-manager/options.h index a5cd049decf..3a60de2bb39 100644 --- a/server-tools/instance-manager/options.h +++ b/server-tools/instance-manager/options.h @@ -16,7 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE) #pragma interface #endif diff --git a/server-tools/instance-manager/parse_output.cc b/server-tools/instance-manager/parse_output.cc index 4ec9a71bfd2..b5af3cb83a7 100644 --- a/server-tools/instance-manager/parse_output.cc +++ b/server-tools/instance-manager/parse_output.cc @@ -107,7 +107,6 @@ int parse_output_and_get_value(const char *command, const char *word, } } -pclose: /* we are not interested in the termination status */ pclose(output); diff --git a/server-tools/instance-manager/thread_registry.cc b/server-tools/instance-manager/thread_registry.cc index a7384c0fa13..fe665f410e5 100644 --- a/server-tools/instance-manager/thread_registry.cc +++ b/server-tools/instance-manager/thread_registry.cc @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION) #pragma implementation #endif diff --git a/server-tools/instance-manager/thread_registry.h b/server-tools/instance-manager/thread_registry.h index 28899810f23..a1075e719d6 100644 --- a/server-tools/instance-manager/thread_registry.h +++ b/server-tools/instance-manager/thread_registry.h @@ -50,7 +50,7 @@ in manner, similar to ``quit'' signals. */ -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE) #pragma interface #endif diff --git a/server-tools/instance-manager/user_map.cc b/server-tools/instance-manager/user_map.cc index 93c4a2ade25..d901d1ca5ec 100644 --- a/server-tools/instance-manager/user_map.cc +++ b/server-tools/instance-manager/user_map.cc @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_IMPLEMENTATION) #pragma interface #endif diff --git a/server-tools/instance-manager/user_map.h b/server-tools/instance-manager/user_map.h index 4c86edd93d9..a57174a37c3 100644 --- a/server-tools/instance-manager/user_map.h +++ b/server-tools/instance-manager/user_map.h @@ -16,7 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __GNUC__ +#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE) #pragma interface #endif diff --git a/sql/field.cc b/sql/field.cc index e8731cb0ea5..eeff2ec9881 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -3438,7 +3438,7 @@ int Field_long::store(longlong nr, bool unsigned_val) else { if (nr < 0 && unsigned_val) - nr= INT_MAX32+1; // Generate overflow + nr= ((longlong) INT_MAX32) + 1; // Generate overflow if (nr < (longlong) INT_MIN32) { res=(int32) INT_MIN32; diff --git a/sql/item.h b/sql/item.h index 381ba98e193..dfe36d6d2ec 100644 --- a/sql/item.h +++ b/sql/item.h @@ -164,6 +164,7 @@ struct Hybrid_type_traits virtual my_decimal *val_decimal(Hybrid_type *val, my_decimal *buf) const; virtual String *val_str(Hybrid_type *val, String *buf, uint8 decimals) const; static const Hybrid_type_traits *instance(); + Hybrid_type_traits() {}; }; @@ -185,6 +186,7 @@ struct Hybrid_type_traits_decimal: public Hybrid_type_traits { return &val->dec_buf[val->used_dec_buf_no]; } virtual String *val_str(Hybrid_type *val, String *buf, uint8 decimals) const; static const Hybrid_type_traits_decimal *instance(); + Hybrid_type_traits_decimal() {}; }; @@ -215,6 +217,7 @@ struct Hybrid_type_traits_integer: public Hybrid_type_traits virtual String *val_str(Hybrid_type *val, String *buf, uint8 decimals) const { buf->set(val->integer, &my_charset_bin); return buf;} static const Hybrid_type_traits_integer *instance(); + Hybrid_type_traits_integer() {}; }; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 880ab4c8cb1..1bbfef40f4f 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -545,6 +545,7 @@ struct Hybrid_type_traits_fast_decimal: public val->traits->div(val, u); } static const Hybrid_type_traits_fast_decimal *instance(); + Hybrid_type_traits_fast_decimal() {}; }; static const Hybrid_type_traits_fast_decimal fast_decimal_traits_instance; From 611dc88c160ed111cb5575fe2fbd66223caf4a4b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Sep 2005 21:36:07 +0300 Subject: [PATCH 108/225] row0ins.c: Fix a compilation error: Visual C++ does not seem to allow variable declaration in the middle of a program block innobase/row/row0ins.c: Fix a compilation error: Visual C++ does not seem to allow variable declaration in the middle of a program block --- innobase/row/row0ins.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c index 60d7a640f9a..db871a53c42 100644 --- a/innobase/row/row0ins.c +++ b/innobase/row/row0ins.c @@ -1253,9 +1253,10 @@ run_again: if (check_table == NULL || check_table->ibd_file_missing) { if (check_ref) { + FILE* ef = dict_foreign_err_file; + row_ins_set_detailed(trx, foreign); - FILE* ef = dict_foreign_err_file; mutex_enter(&dict_foreign_err_mutex); rewind(ef); ut_print_timestamp(ef); From 1c064d285cc18dc4a71db3a9906ef5c7aba6386b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Sep 2005 14:14:34 -0500 Subject: [PATCH 109/225] mysqld.cc: Fix out-of-order status variable. sql/mysqld.cc: Fix out-of-order status variable. --- sql/mysqld.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 764b89812f5..605d7d0dae6 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5499,10 +5499,10 @@ struct show_var_st status_vars[]= { {"Com_show_fields", (char*) (com_stat+(uint) SQLCOM_SHOW_FIELDS),SHOW_LONG}, {"Com_show_grants", (char*) (com_stat+(uint) SQLCOM_SHOW_GRANTS),SHOW_LONG}, {"Com_show_innodb_status", (char*) (com_stat+(uint) SQLCOM_SHOW_INNODB_STATUS),SHOW_LONG}, - {"Com_show_ndb_status", (char*) (com_stat+(uint) SQLCOM_SHOW_NDBCLUSTER_STATUS),SHOW_LONG}, {"Com_show_keys", (char*) (com_stat+(uint) SQLCOM_SHOW_KEYS),SHOW_LONG}, {"Com_show_logs", (char*) (com_stat+(uint) SQLCOM_SHOW_LOGS),SHOW_LONG}, {"Com_show_master_status", (char*) (com_stat+(uint) SQLCOM_SHOW_MASTER_STAT),SHOW_LONG}, + {"Com_show_ndb_status", (char*) (com_stat+(uint) SQLCOM_SHOW_NDBCLUSTER_STATUS),SHOW_LONG}, {"Com_show_new_master", (char*) (com_stat+(uint) SQLCOM_SHOW_NEW_MASTER),SHOW_LONG}, {"Com_show_open_tables", (char*) (com_stat+(uint) SQLCOM_SHOW_OPEN_TABLES),SHOW_LONG}, {"Com_show_privileges", (char*) (com_stat+(uint) SQLCOM_SHOW_PRIVILEGES),SHOW_LONG}, From c5b8e9bbb844747f1a571cb64d660d2bb6b937d9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Sep 2005 15:59:32 -0500 Subject: [PATCH 110/225] mysqld.cc: Fix out-of-order status variable. sql/mysqld.cc: Fix out-of-order status variable. --- sql/mysqld.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index fc45a9d13fd..d1e4d392e26 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5827,10 +5827,10 @@ struct show_var_st status_vars[]= { {"Com_show_fields", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_FIELDS]), SHOW_LONG_STATUS}, {"Com_show_grants", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_GRANTS]), SHOW_LONG_STATUS}, {"Com_show_innodb_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_INNODB_STATUS]), SHOW_LONG_STATUS}, - {"Com_show_ndb_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_NDBCLUSTER_STATUS]), SHOW_LONG_STATUS}, {"Com_show_keys", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_KEYS]), SHOW_LONG_STATUS}, {"Com_show_logs", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_LOGS]), SHOW_LONG_STATUS}, {"Com_show_master_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_MASTER_STAT]), SHOW_LONG_STATUS}, + {"Com_show_ndb_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_NDBCLUSTER_STATUS]), SHOW_LONG_STATUS}, {"Com_show_new_master", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_NEW_MASTER]), SHOW_LONG_STATUS}, {"Com_show_open_tables", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_OPEN_TABLES]), SHOW_LONG_STATUS}, {"Com_show_privileges", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_PRIVILEGES]), SHOW_LONG_STATUS}, From 2a4f5aacd7a6dbfbc1bf5a10a6dafb9877c44f32 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 24 Sep 2005 01:39:50 +0400 Subject: [PATCH 111/225] BUG#12232: Addressing docs team feedback: s/inequal/unequal/ --- myisam/mi_check.c | 2 +- myisam/myisamchk.c | 6 +++--- mysql-test/r/myisam.result | 4 ++-- sql/ha_myisam.cc | 2 +- sql/mysqld.cc | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 0c85b5234a1..7397ee4e204 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -3994,7 +3994,7 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, ... The 'unique' array is collected in one sequential scan through the entire index. This is done in two places: in chk_index() and in sort_key_write(). - Statistics collection may consider NULLs as either equal or inequal (see + Statistics collection may consider NULLs as either equal or unequal (see SEARCH_NULL_ARE_NOT_EQUAL, MI_STATS_METHOD_*). Output is an array: diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index 2ffc491fc91..2dd05cf7e67 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -67,7 +67,7 @@ static const char *field_pack[]= "no zeros", "blob", "constant", "table-lockup", "always zero","varchar","unique-hash","?","?"}; -static const char *myisam_stats_method_str="nulls_inequal"; +static const char *myisam_stats_method_str="nulls_unequal"; static void get_options(int *argc,char * * *argv); static void print_version(void); @@ -339,7 +339,7 @@ static struct my_option my_long_options[] = REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"stats_method", OPT_STATS_METHOD, "Specifies how index statistics collection code should threat NULLs. " - "Possible values of name are \"nulls_inequal\" (default behavior for 4.1/5.0), and \"nulls_equal\" (emulate 4.0 behavior).", + "Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), and \"nulls_equal\" (emulate 4.0 behavior).", (gptr*) &myisam_stats_method_str, (gptr*) &myisam_stats_method_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} @@ -471,7 +471,7 @@ static void usage(void) #include -const char *myisam_stats_method_names[] = {"nulls_inequal", "nulls_equal", +const char *myisam_stats_method_names[] = {"nulls_unequal", "nulls_equal", NullS}; TYPELIB myisam_stats_method_typelib= { array_elements(myisam_stats_method_names) - 1, "", diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index b3144a6903b..0a6f3ddc28b 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -611,7 +611,7 @@ test.t2 984116287 drop table t1, t2; show variables like 'myisam_stats_method'; Variable_name Value -myisam_stats_method nulls_inequal +myisam_stats_method nulls_unequal create table t1 (a int, key(a)); insert into t1 values (0),(1),(2),(3),(4); insert into t1 select NULL from t1; @@ -652,7 +652,7 @@ t1 1 a 1 a A 5 NULL NULL YES BTREE set myisam_stats_method=DEFAULT; show variables like 'myisam_stats_method'; Variable_name Value -myisam_stats_method nulls_inequal +myisam_stats_method nulls_unequal insert into t1 values (11); delete from t1 where a=11; analyze table t1; diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 615cecb7a19..87529cc8713 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -39,7 +39,7 @@ const char *myisam_recover_names[] = TYPELIB myisam_recover_typelib= {array_elements(myisam_recover_names)-1,"", myisam_recover_names, NULL}; -const char *myisam_stats_method_names[] = {"nulls_inequal", "nulls_equal", +const char *myisam_stats_method_names[] = {"nulls_unequal", "nulls_equal", NullS}; TYPELIB myisam_stats_method_typelib= { array_elements(myisam_stats_method_names) - 1, "", diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 605d7d0dae6..1b931b25647 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -369,7 +369,7 @@ char *mysqld_unix_port, *opt_mysql_tmpdir; char *my_bind_addr_str; const char **errmesg; /* Error messages */ const char *myisam_recover_options_str="OFF"; -const char *myisam_stats_method_str="nulls_inequal"; +const char *myisam_stats_method_str="nulls_unequal"; const char *sql_mode_str="OFF"; /* name of reference on left espression in rewritten IN subquery */ const char *in_left_expr_name= ""; @@ -5212,7 +5212,7 @@ The minimum value for this variable is 4096.", GET_ULONG, REQUIRED_ARG, 8192*1024, 4, ~0L, 0, 1, 0}, {"myisam_stats_method", OPT_MYISAM_STATS_METHOD, "Specifies how MyISAM index statistics collection code should threat NULLs. " - "Possible values of name are \"nulls_inequal\" (default behavior for 4.1/5.0), and \"nulls_equal\" (emulate 4.0 behavior).", + "Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), and \"nulls_equal\" (emulate 4.0 behavior).", (gptr*) &myisam_stats_method_str, (gptr*) &myisam_stats_method_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"net_buffer_length", OPT_NET_BUFFER_LENGTH, @@ -5767,7 +5767,7 @@ static void mysql_init_variables(void) query_id= thread_id= 1L; strmov(server_version, MYSQL_SERVER_VERSION); myisam_recover_options_str= sql_mode_str= "OFF"; - myisam_stats_method_str= "nulls_inequal"; + myisam_stats_method_str= "nulls_unequal"; my_bind_addr = htonl(INADDR_ANY); threads.empty(); thread_cache.empty(); @@ -5818,7 +5818,7 @@ static void mysql_init_variables(void) global_system_variables.old_passwords= 0; /* - Default behavior for 4.1 and 5.0 is to treat NULL values as inequal + Default behavior for 4.1 and 5.0 is to treat NULL values as unequal when collecting index statistics for MyISAM tables. */ global_system_variables.myisam_stats_method= MI_STATS_METHOD_NULLS_NOT_EQUAL; From 3614cff71cc79b197863a968d385cb2cce1680fd Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 24 Sep 2005 02:42:38 +0200 Subject: [PATCH 112/225] Makefile.am: Revert to shell test script for test targets mysqltest.c: Windows pclose() returns error code in low byte mysql_config.sh: Remove -Xa -xstrconst from --cflags for Sun C++ scripts/mysql_config.sh: Remove -Xa -xstrconst from --cflags for Sun C++ client/mysqltest.c: Windows pclose() returns error code in low byte Makefile.am: Revert to shell test script for test targets --- Makefile.am | 15 +++++++++++++-- client/mysqltest.c | 6 +++++- scripts/mysql_config.sh | 13 ++++++++----- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/Makefile.am b/Makefile.am index ae0d56ba9fd..9025251ff2a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -106,12 +106,12 @@ MYSQL_TEST_NDB_PORT = 9350 test: cd mysql-test ; \ - ./mysql-test-run.pl \ + ./mysql-test-run \ --manager-port=$(MYSQL_TEST_MANAGER_PORT) \ --master_port=$(MYSQL_TEST_MASTER_PORT) \ --slave_port=$(MYSQL_TEST_SLAVE_PORT) \ --ndbcluster_port=$(MYSQL_TEST_NDB_PORT) && \ - ./mysql-test-run.pl --ps-protocol \ + ./mysql-test-run --ps-protocol \ --manager-port=$(MYSQL_TEST_MANAGER_PORT) \ --master_port=$(MYSQL_TEST_MASTER_PORT) \ --slave_port=$(MYSQL_TEST_SLAVE_PORT) \ @@ -121,3 +121,14 @@ test-force: cd mysql-test; \ ./mysql-test-run --force ;\ ./mysql-test-run --ps-protocol --force + +# We are testing a new Perl version of the test script +test-pl: + cd mysql-test; \ + ./mysql-test-run.pl && \ + ./mysql-test-run.pl --ps-protocol + +test-force-pl: + cd mysql-test; \ + ./mysql-test-run.pl --force ; \ + ./mysql-test-run.pl --ps-protocol --force diff --git a/client/mysqltest.c b/client/mysqltest.c index 1b8a0658cc7..a4fec7eb28c 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -64,7 +64,11 @@ #include #endif #ifndef WEXITSTATUS -# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +# ifdef __WIN__ +# define WEXITSTATUS(stat_val) (stat_val) +# else +# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +# endif #endif #define MAX_QUERY 131072 #define MAX_VAR_NAME 256 diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 16e50c044ca..15b45391ef8 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -105,9 +105,12 @@ embedded_libs="$ldflags -L$pkglibdir -lmysqld @LIBS@ @WRAPLIBS@ @innodb_system_l embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` # Remove some options that a client doesn't have to care about +# FIXME until we have a --cxxflags, we need to remove -Xa +# and -xstrconst to make --cflags usable for Sun Forte C++ for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \ DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \ - DEXTRA_DEBUG DHAVE_purify 'O[0-9]' 'W[-A-Za-z]*' + DEXTRA_DEBUG DHAVE_purify 'O[0-9]' 'W[-A-Za-z]*' \ + Xa xstrconst do # The first option we might strip will always have a space before it because # we set -I$pkgincludedir as the first option @@ -120,13 +123,13 @@ usage () { Usage: $0 [OPTIONS] Options: --cflags [$cflags] - --include [$include] + --include [$include] --libs [$libs] --libs_r [$libs_r] --socket [$socket] --port [$port] --version [$version] - --libmysqld-libs [$embedded_libs] + --libmysqld-libs [$embedded_libs] EOF exit 1 } @@ -136,13 +139,13 @@ if test $# -le 0; then usage; fi while test $# -gt 0; do case $1 in --cflags) echo "$cflags" ;; - --include) echo "$include" ;; + --include) echo "$include" ;; --libs) echo "$libs" ;; --libs_r) echo "$libs_r" ;; --socket) echo "$socket" ;; --port) echo "$port" ;; --version) echo "$version" ;; - --embedded-libs | --embedded | --libmysqld-libs) echo "$embedded_libs" ;; + --embedded-libs | --embedded | --libmysqld-libs) echo "$embedded_libs" ;; *) usage ;; esac From f437ec9aee07473fbd0d1674c206fe42e482b41f Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 24 Sep 2005 04:11:51 +0200 Subject: [PATCH 113/225] mysqlbinlog.test: Windows have no 'cat' command, use < mysql.test: Windows can't handle single quotes in --exec line mysql-test/t/mysql.test: Windows can't handle single quotes in --exec line mysql-test/t/mysqlbinlog.test: Windows have no 'cat' command, use < --- mysql-test/t/mysql.test | 10 +++++----- mysql-test/t/mysqlbinlog.test | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test index c1d9813ea39..0b031ea1be8 100644 --- a/mysql-test/t/mysql.test +++ b/mysql-test/t/mysql.test @@ -19,16 +19,16 @@ insert into t1 values(1); --disable_query_log # Test delimiter : supplied on the command line select "Test delimiter : from command line" as " "; ---exec $MYSQL test --delimiter=':' -e 'select * from t1:' +--exec $MYSQL test --delimiter=":" -e "select * from t1:" # Test delimiter :; supplied on the command line select "Test delimiter :; from command line" as " "; ---exec $MYSQL test --delimiter=':;' -e 'select * from t1:;' +--exec $MYSQL test --delimiter=":;" -e "select * from t1:;" # Test 'go' command (vertical output) \G select "Test 'go' command(vertical output) \G" as " "; ---exec $MYSQL test -e 'select * from t1\G' +--exec $MYSQL test -e "select * from t1\G" # Test 'go' command \g select "Test 'go' command \g" as " "; ---exec $MYSQL test -e 'select * from t1\g' +--exec $MYSQL test -e "select * from t1\g" --enable_query_log drop table t1; @@ -37,7 +37,7 @@ drop table t1; # create table t1(a int); lock tables t1 write; ---exec $MYSQL -e 'use test; select database();' +--exec $MYSQL -e "use test; select database();" unlock tables; drop table t1; diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index e5bd8c554cb..61d7d9994ba 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -102,10 +102,10 @@ select "--- --position --" as ""; select "--- reading stdin --" as ""; --enable_query_log --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec cat $MYSQL_TEST_DIR/std_data/trunc_binlog.000001 | $MYSQL_BINLOG --short-form - +--exec $MYSQL_BINLOG --short-form - < $MYSQL_TEST_DIR/std_data/trunc_binlog.000001 --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec cat $MYSQL_TEST_DIR/std_data/trunc_binlog.000001 | $MYSQL_BINLOG --short-form --position=79 - +--exec $MYSQL_BINLOG --short-form --position=79 - < $MYSQL_TEST_DIR/std_data/trunc_binlog.000001 # clean up drop table t1, t2; From 5aecf16a2f9d27ffb281642d410309e2b02c58b8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 25 Sep 2005 11:35:32 +0200 Subject: [PATCH 114/225] disabled.def: Disable unstable test cases new file mysql-test/t/disabled.def: Disable unstable test cases --- mysql-test/t/disabled.def | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 mysql-test/t/disabled.def diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def new file mode 100644 index 00000000000..ddb79205357 --- /dev/null +++ b/mysql-test/t/disabled.def @@ -0,0 +1,16 @@ +############################################################################## +# +# List the test cases that are to be disabled temporarely. +# +# Separate the test case name and the comment with ':'. +# +# : Comment test +# +# Don't use any TAB characters for whitespace. +# +############################################################################## + +rpl_relayrotate : Unstable test case, bug#12429 +rpl_until : Unstable test case, bug#12429 +rpl_deadlock : Unstable test case, bug#12429 +kill : Unstable test case, bug#9712 From cbad9e2c69e4f5b0ed22d1179d4ff24aa1380eca Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 25 Sep 2005 15:44:05 +0200 Subject: [PATCH 115/225] test case fixed to pass w/o innodb --- mysql-test/r/default.result | 32 ------------------------------- mysql-test/r/group_min_max.result | 20 +++++++------------ mysql-test/t/default.test | 1 - mysql-test/t/group_min_max.test | 23 +++++++++------------- mysql-test/t/view.test | 2 ++ 5 files changed, 18 insertions(+), 60 deletions(-) diff --git a/mysql-test/r/default.result b/mysql-test/r/default.result index 7db20c2b096..aef49af6c62 100644 --- a/mysql-test/r/default.result +++ b/mysql-test/r/default.result @@ -29,38 +29,6 @@ z varchar(20) binary NOT NULL DEFAULT ' ', a1 varchar(30) binary NOT NULL DEFAULT ' ', b1 tinyblob NULL) ENGINE=InnoDB DEFAULT CHARACTER SET = latin1 COLLATE latin1_bin; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(30) collate latin1_bin NOT NULL default ' ', - `b` varchar(1) collate latin1_bin NOT NULL default ' ', - `c` varchar(4) collate latin1_bin NOT NULL default '0000', - `d` tinyblob, - `e` tinyblob, - `f` tinyblob, - `g` tinyblob, - `h` tinyblob, - `i` tinyblob, - `j` tinyblob, - `k` tinyblob, - `l` tinyblob, - `m` tinyblob, - `n` tinyblob, - `o` tinyblob, - `p` tinyblob, - `q` varchar(30) collate latin1_bin NOT NULL default ' ', - `r` varchar(30) collate latin1_bin NOT NULL default ' ', - `s` tinyblob, - `t` varchar(4) collate latin1_bin NOT NULL default ' ', - `u` varchar(1) collate latin1_bin NOT NULL default ' ', - `v` varchar(30) collate latin1_bin NOT NULL default ' ', - `w` varchar(30) collate latin1_bin NOT NULL default ' ', - `x` tinyblob, - `y` varchar(5) collate latin1_bin NOT NULL default ' ', - `z` varchar(20) collate latin1_bin NOT NULL default ' ', - `a1` varchar(30) collate latin1_bin NOT NULL default ' ', - `b1` tinyblob -) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin INSERT into t1 (b) values ('1'); SHOW WARNINGS; Level Code Message diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result index e26f32e49e5..038d0c75f74 100644 --- a/mysql-test/r/group_min_max.result +++ b/mysql-test/r/group_min_max.result @@ -1972,29 +1972,23 @@ a b c d -create table bug12672 ( +create table t4 ( pk_col int auto_increment primary key, a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' ' ) engine=innodb; -insert into bug12672 (a1, a2, b, c, d, dummy) select * from t1; -create index idx12672_0 on bug12672 (a1); -create index idx12672_1 on bug12672 (a1,a2,b,c); -create index idx12672_2 on bug12672 (a1,a2,b); +insert into t4 (a1, a2, b, c, d, dummy) select * from t1; +create index idx12672_0 on t4 (a1); +create index idx12672_1 on t4 (a1,a2,b,c); +create index idx12672_2 on t4 (a1,a2,b); analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status Table is already up to date -explain select distinct a1 from bug12672 where pk_col not in (1,2,3,4); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE bug12672 range PRIMARY PRIMARY 4 NULL # Using where; Using temporary -select distinct a1 from bug12672 where pk_col not in (1,2,3,4); +select distinct a1 from t4 where pk_col not in (1,2,3,4); a1 a b c d -drop table bug12672; -drop table t1; -drop table t2; -drop table t3; +drop table t1,t2,t3,t4; create table t1 ( a varchar(30), b varchar(30), primary key(a), key(b) ) engine=innodb; diff --git a/mysql-test/t/default.test b/mysql-test/t/default.test index 42620a27b66..b5522394d2d 100644 --- a/mysql-test/t/default.test +++ b/mysql-test/t/default.test @@ -40,7 +40,6 @@ CREATE TABLE t1 (a varchar(30) binary NOT NULL DEFAULT ' ', ENGINE=InnoDB DEFAULT CHARACTER SET = latin1 COLLATE latin1_bin; --enable_warnings -SHOW CREATE TABLE t1; INSERT into t1 (b) values ('1'); SHOW WARNINGS; SELECT * from t1; diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test index da3fdec80d2..3d751f4a571 100644 --- a/mysql-test/t/group_min_max.test +++ b/mysql-test/t/group_min_max.test @@ -655,26 +655,21 @@ select distinct a1 from t1 where a2 = 'b'; # Bug #12672: primary key implcitly included in every innodb index # -create table bug12672 ( +--disable_warnings +create table t4 ( pk_col int auto_increment primary key, a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' ' ) engine=innodb; +--enable_warnings +insert into t4 (a1, a2, b, c, d, dummy) select * from t1; -insert into bug12672 (a1, a2, b, c, d, dummy) select * from t1; - -create index idx12672_0 on bug12672 (a1); -create index idx12672_1 on bug12672 (a1,a2,b,c); -create index idx12672_2 on bug12672 (a1,a2,b); +create index idx12672_0 on t4 (a1); +create index idx12672_1 on t4 (a1,a2,b,c); +create index idx12672_2 on t4 (a1,a2,b); analyze table t1; ---replace_column 9 # -explain select distinct a1 from bug12672 where pk_col not in (1,2,3,4); -select distinct a1 from bug12672 where pk_col not in (1,2,3,4); +select distinct a1 from t4 where pk_col not in (1,2,3,4); -drop table bug12672; - -drop table t1; -drop table t2; -drop table t3; +drop table t1,t2,t3,t4; # # Bug #6142: a problem with the empty innodb table diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 72bec0c4873..f47418b8e0a 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -2043,6 +2043,7 @@ drop view v1; drop table t1; # BUG#12941 # +--disable_warnings create table t1 ( r_object_id char(16) NOT NULL, group_name varchar(32) NOT NULL @@ -2053,6 +2054,7 @@ create table t2 ( i_position int(11) NOT NULL, users_names varchar(32) default NULL ) Engine = InnoDB; +--enable_warnings create view v1 as select r_object_id, group_name from t1; create view v2 as select r_object_id, i_position, users_names from t2; From 466b46a66af37310b7d050448ab08913cb09671e Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 25 Sep 2005 21:22:23 +0300 Subject: [PATCH 116/225] Fixed error found during review of new pushed code client/mysql.cc: Don't use c_ptr() for cgets() and ensure buffer is not overwritten mysql-test/r/cast.result: More test for CAST(0x.... as signed) sql/opt_sum.cc: Fix bugs found during review - Changed code to be able to remove one if - Ensure that count == 0 only if is_exact_count == TRUE sql/sql_delete.cc: Ensure 'allow_sum_func' is reset before call to setup_conds sql/sql_lex.cc: allow_sum_func doesn't have to be reset for each query (It's to be reset in setup_fields() or before call to setup_conds() sql/sql_load.cc: Move set of auto_increment_field_not_null so that it's not set if field value is NULL sql/sql_prepare.cc: allow_sum_func doesn't have to be reset for each query (It's to be reset in setup_fields() or before call to setup_conds() sql/sql_update.cc: Ensure 'allow_sum_func' is reset before call to setup_conds --- client/mysql.cc | 4 ++-- mysql-test/r/cast.result | 12 ++++++++++++ sql/opt_sum.cc | 14 +++++++------- sql/sql_delete.cc | 5 +++-- sql/sql_lex.cc | 1 - sql/sql_load.cc | 10 +++++----- sql/sql_prepare.cc | 1 - sql/sql_update.cc | 1 + 8 files changed, 30 insertions(+), 18 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index be1541faaf5..e73d627d67a 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -993,13 +993,13 @@ static int read_lines(bool execute_commands) unsigned long clen; do { - line= my_cgets(tmpbuf.c_ptr(), tmpbuf.alloced_length(), &clen); + line= my_cgets(tmpbuf.ptr(), tmpbuf.alloced_length()-1, &clen); buffer.append(line, clen); /* if we got buffer fully filled than there is a chance that something else is still in console input buffer */ - } while (tmpbuf.alloced_length() <= clen + 1); + } while (tmpbuf.alloced_length() <= clen); line= buffer.c_ptr(); #else /* OS2 */ buffer.length(0); diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 7cd0934f7a3..1b681941a1d 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -54,6 +54,18 @@ CONVERT(DATE "2004-01-22 21:45:33",BINARY(4)) select CAST(DATE "2004-01-22 21:45:33" AS BINARY(4)); CAST(DATE "2004-01-22 21:45:33" AS BINARY(4)) 2004 +select CAST(0xb3 as signed); +CAST(0xb3 as signed) +179 +select CAST(0x8fffffffffffffff as signed); +CAST(0x8fffffffffffffff as signed) +-8070450532247928833 +select CAST(0xffffffffffffffff as unsigned); +CAST(0xffffffffffffffff as unsigned) +18446744073709551615 +select CAST(0xfffffffffffffffe as signed); +CAST(0xfffffffffffffffe as signed) +-2 select cast('18446744073709551616' as unsigned); cast('18446744073709551616' as unsigned) 18446744073709551615 diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index 3ac72e5a6f9..cfb5b3695a3 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -108,7 +108,7 @@ int opt_sum_query(TABLE_LIST *tables, List &all_fields,COND *conds) WHERE t2.field IS NULL; */ if (tl->table->map & where_tables) - const_result= 0; + return 0; } else used_tables|= tl->table->map; @@ -119,7 +119,10 @@ int opt_sum_query(TABLE_LIST *tables, List &all_fields,COND *conds) may be used as the real count. */ if (tl->table->file->table_flags() & HA_NOT_EXACT_COUNT) + { is_exact_count= FALSE; + count= 1; // ensure count != 0 + } else { tl->table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK); @@ -127,9 +130,6 @@ int opt_sum_query(TABLE_LIST *tables, List &all_fields,COND *conds) } } - if (!const_result) - return 0; - /* Iterate through all items in the SELECT clause and replace COUNT(), MIN() and MAX() with constants (if possible). @@ -150,8 +150,8 @@ int opt_sum_query(TABLE_LIST *tables, List &all_fields,COND *conds) if (!conds && !((Item_sum_count*) item)->args[0]->maybe_null && !outer_tables && is_exact_count) { - ((Item_sum_count*) item)->make_const(count); - recalc_const_item= 1; + ((Item_sum_count*) item)->make_const(count); + recalc_const_item= 1; } else const_result= 0; @@ -234,7 +234,7 @@ int opt_sum_query(TABLE_LIST *tables, List &all_fields,COND *conds) } if (!count) { - /* If count != 1, then we know that is_exact_count == TRUE. */ + /* If count == 0, then we know that is_exact_count == TRUE. */ ((Item_sum_min*) item_sum)->clear(); /* Set to NULL. */ } else diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 7248adf6993..1dd52a2ba74 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -27,8 +27,8 @@ #include "ha_innodb.h" #include "sql_select.h" -int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, SQL_LIST *order, - ha_rows limit, ulong options) +int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, + SQL_LIST *order, ha_rows limit, ulong options) { int error; TABLE *table; @@ -266,6 +266,7 @@ int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds) select_lex.table_list.first); DBUG_ENTER("mysql_prepare_delete"); + thd->allow_sum_func= 0; if (setup_conds(thd, delete_table_list, conds) || setup_ftfuncs(&thd->lex->select_lex)) DBUG_RETURN(-1); diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 07017451bad..8636b6542fc 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -160,7 +160,6 @@ void lex_start(THD *thd, uchar *buf,uint length) lex->duplicates= DUP_ERROR; lex->ignore= 0; lex->proc_list.first= 0; - thd->allow_sum_func= 0; } void lex_end(LEX *lex) diff --git a/sql/sql_load.cc b/sql/sql_load.cc index f590038f899..4d09da70ef7 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -429,8 +429,6 @@ read_fixed_length(THD *thd,COPY_INFO &info,TABLE *table,List &fields, while ((sql_field= (Item_field*) it++)) { Field *field= sql_field->field; - if (field == table->next_number_field) - table->auto_increment_field_not_null= TRUE; if (pos == read_info.row_end) { thd->cuted_fields++; /* Not enough fields */ @@ -443,11 +441,13 @@ read_fixed_length(THD *thd,COPY_INFO &info,TABLE *table,List &fields, { uint length; byte save_chr; + if (field == table->next_number_field) + table->auto_increment_field_not_null= TRUE; if ((length=(uint) (read_info.row_end-pos)) > field->field_length) length=field->field_length; save_chr=pos[length]; pos[length]='\0'; // Safeguard aganst malloc - field->store((char*) pos,length,read_info.read_charset); + field->store((char*) pos,length,read_info.read_charset); pos[length]=save_chr; if ((pos+=length) > read_info.row_end) pos= read_info.row_end; /* Fills rest with space */ @@ -522,8 +522,6 @@ read_sep_field(THD *thd,COPY_INFO &info,TABLE *table, length=(uint) (read_info.row_end-pos); Field *field=sql_field->field; - if (field == table->next_number_field) - table->auto_increment_field_not_null= TRUE; if (!read_info.enclosed && (enclosed_length && length == 4 && !memcmp(pos,"NULL",4)) || (length == 1 && read_info.found_null)) @@ -540,6 +538,8 @@ read_sep_field(THD *thd,COPY_INFO &info,TABLE *table, } continue; } + if (field == table->next_number_field) + table->auto_increment_field_not_null= TRUE; field->set_notnull(); read_info.row_end[0]=0; // Safe to change end marker field->store((char*) read_info.row_start,length,read_info.read_charset); diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index c8f417c9b9b..8a50d0bd50e 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1738,7 +1738,6 @@ static void reset_stmt_for_execute(Prepared_statement *stmt) lex->current_select= &lex->select_lex; if (lex->result) lex->result->cleanup(); - thd->allow_sum_func= 0; } diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 6c12381b4bd..2857bce09ed 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -426,6 +426,7 @@ int mysql_prepare_update(THD *thd, TABLE_LIST *table_list, bzero((char*) &tables,sizeof(tables)); // For ORDER BY tables.table= table; tables.alias= table_list->alias; + thd->allow_sum_func= 0; if (setup_tables(update_table_list) || setup_conds(thd, update_table_list, conds) || From 31b01d13efca6a766470319cfe973b24d8f7ffd8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Sep 2005 10:26:38 +0200 Subject: [PATCH 117/225] added make target for printSchemaFile --- ndb/src/kernel/blocks/dbdict/Makefile.am | 12 ++++++++++-- ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp | 11 +---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/ndb/src/kernel/blocks/dbdict/Makefile.am b/ndb/src/kernel/blocks/dbdict/Makefile.am index 9a0d68f8148..3c1cf6735d9 100644 --- a/ndb/src/kernel/blocks/dbdict/Makefile.am +++ b/ndb/src/kernel/blocks/dbdict/Makefile.am @@ -1,12 +1,20 @@ -#SUBDIRS = printSchemafile - noinst_LIBRARIES = libdbdict.a +EXTRA_PROGRAMS = printSchemaFile libdbdict_a_SOURCES = Dbdict.cpp +printSchemaFile_SOURCES = printSchemaFile.cpp + include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_kernel.mk.am +LDADD += \ + $(top_builddir)/ndb/src/common/util/libgeneral.la \ + $(top_builddir)/ndb/src/common/portlib/libportlib.la \ + $(top_builddir)/dbug/libdbug.a \ + $(top_builddir)/mysys/libmysys.a \ + $(top_builddir)/strings/libmystrings.a + # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp b/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp index 3e944485e1c..a8b84298ebe 100644 --- a/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp +++ b/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp @@ -1,11 +1,3 @@ -#if 0 -make -f Makefile -f - printSchemaFile <<'_eof_' -printSchemaFile: printSchemaFile.cpp - $(CXXCOMPILE) -o $@ $@.cpp -L../../../common/util/.libs -lgeneral -_eof_ -exit $? -#endif - /* Copyright (C) 2003 MySQL AB This program is free software; you can redistribute it and/or modify @@ -58,8 +50,7 @@ print(const char * filename, const SchemaFile * file){ SchemaFile::TableEntry te = file->TableEntries[i]; if(te.m_tableState != SchemaFile::INIT){ ndbout << "Table " << i << ": State = " << te.m_tableState - << " version = " << table_version_major(te.m_tableVersion) << - << "(" << table_version_minor(te.m_tableVersion) << ")" + << " version = " << te.m_tableVersion << " type = " << te.m_tableType << " noOfPages = " << te.m_noOfPages << " gcp: " << te.m_gcp << endl; From cbfe4f5995cd8b6f7b4c4f50f6e166e1cd7dedbc Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Sep 2005 14:17:30 +0500 Subject: [PATCH 118/225] Merging --- mysql-test/t/type_float.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index bb7bd37039b..2deec5ec63b 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -152,7 +152,7 @@ drop table t1; # bug #12694 (float(m,d) specifications) # ---error 1443 +--error 1453 create table t1 (s1 float(0,2)); ---error 1443 +--error 1453 create table t1 (s1 float(1,2)); From 3d23a2344f4c80437953c4f780d1582ed582f1b2 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Sep 2005 13:24:01 +0300 Subject: [PATCH 119/225] InnoDB: Handle temporary file creation failure more gracefully. innobase/row/row0ins.c: Don't assert on temp file creation failure. --- innobase/row/row0ins.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c index db871a53c42..5e833372299 100644 --- a/innobase/row/row0ins.c +++ b/innobase/row/row0ins.c @@ -591,15 +591,17 @@ row_ins_set_detailed( FILE* tf = os_file_create_tmpfile(); - ut_a(tf); - - ut_print_name(tf, trx, foreign->foreign_table_name); - dict_print_info_on_foreign_key_in_create_format(tf, trx, - foreign, FALSE); + if (tf) { + ut_print_name(tf, trx, foreign->foreign_table_name); + dict_print_info_on_foreign_key_in_create_format(tf, trx, + foreign, FALSE); - trx_set_detailed_error_from_file(trx, tf); + trx_set_detailed_error_from_file(trx, tf); - fclose(tf); + fclose(tf); + } else { + trx_set_detailed_error(trx, "temp file creation failed"); + } } /************************************************************************* From 2376631c59d9a3c248c754c6819a3c033dd0cb9a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Sep 2005 12:25:08 +0200 Subject: [PATCH 120/225] Bug #13476 yassl: openserv compile failure extra/yassl/taocrypt/include/hmac.hpp: Rename BSIZE to HMAC_BSIZE to avoid conflict with BSIZE on "openserv 3.2 5.0.7" --- extra/yassl/taocrypt/include/hmac.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extra/yassl/taocrypt/include/hmac.hpp b/extra/yassl/taocrypt/include/hmac.hpp index 543366afc3a..cf029812ce2 100644 --- a/extra/yassl/taocrypt/include/hmac.hpp +++ b/extra/yassl/taocrypt/include/hmac.hpp @@ -56,12 +56,12 @@ private: T mac_; // MSVC 6 HACK, gives compiler error if calculated in array - enum { BSIZE = T::BLOCK_SIZE / sizeof(word32), - DSIZE = T::DIGEST_SIZE / sizeof(word32) }; + enum { HMAC_BSIZE = T::BLOCK_SIZE / sizeof(word32), + HMAC_DSIZE = T::DIGEST_SIZE / sizeof(word32) }; - word32 ip_[BSIZE]; // align ipad_ on word32 - word32 op_[BSIZE]; // align opad_ on word32 - word32 innerH_[DSIZE]; // align innerHash_ on word32 + word32 ip_[HMAC_BSIZE]; // align ipad_ on word32 + word32 op_[HMAC_BSIZE]; // align opad_ on word32 + word32 innerH_[HMAC_DSIZE]; // align innerHash_ on word32 void KeyInnerHash(); From e7c905c4fdfdb2cb40c1d776f80805eb0711c312 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Sep 2005 16:49:18 +0200 Subject: [PATCH 121/225] Fixed gcc error on AMD64: cast from 'char*' to 'unsigned int' loses precision --- sql/ha_ndbcluster.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index cc60c807bc9..c478e565220 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -598,8 +598,8 @@ int ha_ndbcluster::set_ndb_value(NdbOperation *ndb_op, Field *field, blob_ptr= (char*)""; } - DBUG_PRINT("value", ("set blob ptr=%x len=%u", - (unsigned)blob_ptr, blob_len)); + DBUG_PRINT("value", ("set blob ptr=%p len=%u", + blob_ptr, blob_len)); DBUG_DUMP("value", (char*)blob_ptr, min(blob_len, 26)); if (set_blob_value) From 05c17f2abcd5d617bdffc9636dfc34e3a0b93c5a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Sep 2005 19:08:26 +0400 Subject: [PATCH 122/225] Fix bug #13424 locking view with query cache enabled crashes server For LOCK view is opened but not prepared thus leaving 'table' field set to NULL. invalidate_locked_for_write() wasn't checking that and call to invalidate_table(NULL) crashes server. To invalidate_locked_for_write() added check that ensures that table is completely opened. sql/sql_cache.cc: Fix bug #13424 locking view with query cache enabled crashes server Added check that table is completely opened. mysql-test/t/view_query_cache.test: Test case for bug#13424 locking view with query cache enabled crashes server mysql-test/r/view_query_cache.result: Test case for bug#13424 locking view with query cache enabled crashes server --- mysql-test/r/view_query_cache.result | 9 +++++++++ mysql-test/t/view_query_cache.test | 12 ++++++++++++ sql/sql_cache.cc | 3 ++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/view_query_cache.result b/mysql-test/r/view_query_cache.result index e6c2c0152f3..944e1db34c9 100644 --- a/mysql-test/r/view_query_cache.result +++ b/mysql-test/r/view_query_cache.result @@ -123,4 +123,13 @@ select * from v3; a b drop view v3; drop table t1, t2; +create table t1(f1 int); +insert into t1 values(1),(2),(3); +create view v1 as select * from t1; +set query_cache_wlock_invalidate=1; +lock tables v1 read /*!32311 local */; +unlock tables; +set query_cache_wlock_invalidate=default; +drop view v1; +drop table t1; set GLOBAL query_cache_size=default; diff --git a/mysql-test/t/view_query_cache.test b/mysql-test/t/view_query_cache.test index bca111a5ed1..81994407641 100644 --- a/mysql-test/t/view_query_cache.test +++ b/mysql-test/t/view_query_cache.test @@ -84,4 +84,16 @@ select * from v3; drop view v3; drop table t1, t2; +# +# Bug #13424 locking view with query cache enabled crashes server +# +create table t1(f1 int); +insert into t1 values(1),(2),(3); +create view v1 as select * from t1; +set query_cache_wlock_invalidate=1; +lock tables v1 read /*!32311 local */; +unlock tables; +set query_cache_wlock_invalidate=default; +drop view v1; +drop table t1; set GLOBAL query_cache_size=default; diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 04663c5b096..13aedf6eeb0 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1295,7 +1295,8 @@ void Query_cache::invalidate_locked_for_write(TABLE_LIST *tables_used) DUMP(this); for (; tables_used; tables_used= tables_used->next_local) { - if (tables_used->lock_type & (TL_WRITE_LOW_PRIORITY | TL_WRITE)) + if (tables_used->lock_type & (TL_WRITE_LOW_PRIORITY | TL_WRITE) && + tables_used->table) invalidate_table(tables_used->table); } } From aeca681be42e07777e9f856deba2ab5ae8f1e24e Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Sep 2005 19:24:31 +0400 Subject: [PATCH 123/225] Fix for bug #13367 --- innobase/buf/buf0flu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/innobase/buf/buf0flu.c b/innobase/buf/buf0flu.c index ffb16790b2d..bd14f14ea95 100644 --- a/innobase/buf/buf0flu.c +++ b/innobase/buf/buf0flu.c @@ -230,7 +230,7 @@ buf_flush_buffered_writes(void) ulint len2; ulint i; - if (trx_doublewrite == NULL) { + if (!srv_use_doublewrite_buf || trx_doublewrite == NULL) { os_aio_simulated_wake_handler_threads(); return; @@ -507,7 +507,7 @@ buf_flush_write_block_low( fil_io(OS_FILE_WRITE | OS_AIO_SIMULATED_WAKE_LATER, FALSE, block->space, block->offset, 0, UNIV_PAGE_SIZE, (void*)block->frame, (void*)block); - } else { + } else if (srv_use_doublewrite_buf) { buf_flush_post_to_doublewrite_buf(block); } } From ad8ff14165ed656aee697b49eac6c7e8cb5a5c00 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Sep 2005 18:22:00 +0200 Subject: [PATCH 124/225] Fixed BUG#6127: Stored procedure handlers within handlers don't work Replaced the dumb in-handler/not-in-handler check with a proper recursion check of handlers being executed. (Re-commit in a different tree, to make push possible.) mysql-test/r/sp.result: New test case for BUG#6127. mysql-test/t/sp.test: New test case for BUG#6127. sql/sp_head.cc: Replaced the setting of ctx->in_handler with a enter/exit handler methods. sql/sp_rcontext.cc: Replaced the boolean in_handler flag with a stack of handlers being exectuted, for proper recursion check. sql/sp_rcontext.h: Replaced the boolean in_handler flag with a stack of handlers being exectuted, for proper recursion check. (And added some comments in the sp_rcontext class.) --- mysql-test/r/sp.result | 30 ++++++++++++++++++++++++++++++ mysql-test/t/sp.test | 36 ++++++++++++++++++++++++++++++++++++ sql/sp_head.cc | 4 ++-- sql/sp_rcontext.cc | 13 +++++++++---- sql/sp_rcontext.h | 27 ++++++++++++++++++++------- 5 files changed, 97 insertions(+), 13 deletions(-) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 82dda16933f..f9e6eae7e57 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -3360,4 +3360,34 @@ call bug12979_2()| internal_var NULL drop procedure bug12979_2| +drop table if exists t3| +drop procedure if exists bug6127| +create table t3 (s1 int unique)| +set @sm=@@sql_mode| +set sql_mode='traditional'| +create procedure bug6127() +begin +declare continue handler for sqlstate '23000' + begin +declare continue handler for sqlstate '22003' + insert into t3 values (0); +insert into t3 values (1000000000000000); +end; +insert into t3 values (1); +insert into t3 values (1); +end| +call bug6127()| +select * from t3| +s1 +0 +1 +call bug6127()| +ERROR 23000: Duplicate entry '0' for key 1 +select * from t3| +s1 +0 +1 +set sql_mode=@sm| +drop table t3| +drop procedure bug6127| drop table t1,t2; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index afcbd98277a..65d4f89e2bb 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -4228,6 +4228,42 @@ call bug12979_2()| drop procedure bug12979_2| +# +# BUG#6127: Stored procedure handlers within handlers don't work +# +--disable_warnings +drop table if exists t3| +drop procedure if exists bug6127| +--enable_warnings +create table t3 (s1 int unique)| + +set @sm=@@sql_mode| +set sql_mode='traditional'| + +create procedure bug6127() +begin + declare continue handler for sqlstate '23000' + begin + declare continue handler for sqlstate '22003' + insert into t3 values (0); + + insert into t3 values (1000000000000000); + end; + + insert into t3 values (1); + insert into t3 values (1); +end| + +call bug6127()| +select * from t3| +--error ER_DUP_ENTRY +call bug6127()| +select * from t3| +set sql_mode=@sm| +drop table t3| +drop procedure bug6127| + + # # BUG#NNNN: New bug synopsis # diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 36a37924ea4..671acbc2a0c 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1015,7 +1015,7 @@ int sp_head::execute(THD *thd) ip= hip; ret= 0; ctx->clear_handler(); - ctx->in_handler= TRUE; + ctx->enter_handler(hip); thd->clear_error(); thd->killed= THD::NOT_KILLED; continue; @@ -2378,7 +2378,7 @@ sp_instr_hreturn::execute(THD *thd, uint *nextp) thd->spcont->restore_variables(m_frame); *nextp= thd->spcont->pop_hstack(); } - thd->spcont->in_handler= FALSE; + thd->spcont->exit_handler(); DBUG_RETURN(0); } diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc index fcb7719aeb1..252bd7e5cab 100644 --- a/sql/sp_rcontext.cc +++ b/sql/sp_rcontext.cc @@ -31,12 +31,12 @@ sp_rcontext::sp_rcontext(uint fsize, uint hmax, uint cmax) : m_count(0), m_fsize(fsize), m_result(NULL), m_hcount(0), m_hsp(0), - m_hfound(-1), m_ccount(0) + m_ihsp(0), m_hfound(-1), m_ccount(0) { - in_handler= FALSE; m_frame= (Item **)sql_alloc(fsize * sizeof(Item*)); m_handler= (sp_handler_t *)sql_alloc(hmax * sizeof(sp_handler_t)); m_hstack= (uint *)sql_alloc(hmax * sizeof(uint)); + m_in_handler= (uint *)sql_alloc(hmax * sizeof(uint)); m_cstack= (sp_cursor **)sql_alloc(cmax * sizeof(sp_cursor *)); m_saved.empty(); } @@ -68,8 +68,6 @@ bool sp_rcontext::find_handler(uint sql_errno, MYSQL_ERROR::enum_warning_level level) { - if (in_handler) - return 0; // Already executing a handler if (m_hfound >= 0) return 1; // Already got one @@ -79,6 +77,13 @@ sp_rcontext::find_handler(uint sql_errno, while (i--) { sp_cond_type_t *cond= m_handler[i].cond; + int j= m_ihsp; + + while (j--) + if (m_in_handler[j] == m_handler[i].handler) + break; + if (j >= 0) + continue; // Already executing this handler switch (cond->type) { diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h index 9c0fa88fe34..22fa4f6e865 100644 --- a/sql/sp_rcontext.h +++ b/sql/sp_rcontext.h @@ -58,7 +58,6 @@ class sp_rcontext : public Sql_alloc public: - bool in_handler; /* Arena used to (re) allocate items on . E.g. reallocate INOUT/OUT SP parameters when they don't fit into prealloced items. This @@ -169,6 +168,18 @@ class sp_rcontext : public Sql_alloc return m_hstack[--m_hsp]; } + inline void + enter_handler(int hid) + { + m_in_handler[m_ihsp++]= hid; + } + + inline void + exit_handler() + { + m_ihsp-= 1; + } + // Save variables starting at fp and up void save_variables(uint fp); @@ -203,12 +214,14 @@ private: Item *m_result; // For FUNCTIONs - sp_handler_t *m_handler; - uint m_hcount; - uint *m_hstack; - uint m_hsp; - int m_hfound; // Set by find_handler; -1 if not found - List m_saved; // Saved variables + sp_handler_t *m_handler; // Visible handlers + uint m_hcount; // Stack pointer for m_handler + uint *m_hstack; // Return stack for continue handlers + uint m_hsp; // Stack pointer for m_hstack + uint *m_in_handler; // Active handler, for recursion check + uint m_ihsp; // Stack pointer for m_in_handler + int m_hfound; // Set by find_handler; -1 if not found + List m_saved; // Saved variables during handler exec. sp_cursor **m_cstack; uint m_ccount; From 7a19e76c549384a0149ba15079ffe72209441414 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Sep 2005 18:51:27 -0700 Subject: [PATCH 125/225] BUG #13511 Fixed SETUP.sh to not overwrite prefix_configs, making 'make install' install in "/" BUILD/SETUP.sh: BUG #13511 test -n is for testing if a FILE is zero length! Plus, if the value is zero, we don't want to set it to that value, we want to leave it as it was already set. We _want_ to set it _if_ it is _not_ zero. Changed to "! -z", which is for testing strings. --- BUILD/SETUP.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 4c8a8839bdf..c86687bf03b 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -10,7 +10,7 @@ prefix_configs="--prefix=/usr/local/mysql" just_print= just_configure= full_debug= -if test -n $MYSQL_BUILD_PREFIX +if test ! -z $MYSQL_BUILD_PREFIX then prefix_configs="--prefix=$MYSQL_BUILD_PREFIX" fi From f6a552b1cb3e95251bb5d4b0d447482387382871 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Sep 2005 20:18:59 -0700 Subject: [PATCH 126/225] sql_base.cc, item.cc: Fixed bug #13411. Fixed name resolution for non-qualified reference to a view column in the HAVING clause. view.result, view.test: Added a test case for bug #13411. mysql-test/t/view.test: Added a test case for bug #13411. mysql-test/r/view.result: Added a test case for bug #13411. sql/item.cc: Fixed bug #13411. Fixed name resolution for non-qualified reference to a view column in the HAVING clause. sql/sql_base.cc: Fixed bug #13411. Fixed name resolution for non-qualified reference to a view column in the HAVING clause. --- mysql-test/r/view.result | 13 +++++++++++++ mysql-test/t/view.test | 15 +++++++++++++++ sql/item.cc | 6 +++--- sql/sql_base.cc | 2 +- 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 5ae99e029e7..74005e0aff0 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -2262,3 +2262,16 @@ WEEKDAY(date) 1 DROP TABLE t1; DROP VIEW v1, v2, v3; +CREATE TABLE t1 ( a int, b int ); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +CREATE VIEW v1 AS SELECT a,b FROM t1; +SELECT t1.a FROM t1 GROUP BY t1.a HAVING a > 1; +a +2 +3 +SELECT v1.a FROM v1 GROUP BY v1.a HAVING a > 1; +a +2 +3 +DROP VIEW v1; +DROP TABLE t1; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index f47418b8e0a..11a318549d4 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -2139,3 +2139,18 @@ SELECT * FROM v3; DROP TABLE t1; DROP VIEW v1, v2, v3; + +# +# Bug #13411: crash when using non-qualified view column in HAVING clause +# + +CREATE TABLE t1 ( a int, b int ); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +CREATE VIEW v1 AS SELECT a,b FROM t1; +SELECT t1.a FROM t1 GROUP BY t1.a HAVING a > 1; +SELECT v1.a FROM v1 GROUP BY v1.a HAVING a > 1; + +DROP VIEW v1; +DROP TABLE t1; + + diff --git a/sql/item.cc b/sql/item.cc index 45c12d3840f..012c389b939 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1687,7 +1687,7 @@ bool Item_field::eq(const Item *item, bool binary_cmp) const return 0; Item_field *item_field= (Item_field*) item; - if (item_field->field) + if (item_field->field && field) return item_field->field == field; /* We may come here when we are trying to find a function in a GROUP BY @@ -1701,10 +1701,10 @@ bool Item_field::eq(const Item *item, bool binary_cmp) const */ return (!my_strcasecmp(system_charset_info, item_field->name, field_name) && - (!item_field->table_name || + (!item_field->table_name || !table_name || (!my_strcasecmp(table_alias_charset, item_field->table_name, table_name) && - (!item_field->db_name || + (!item_field->db_name || !db_name || (item_field->db_name && !strcmp(item_field->db_name, db_name)))))); } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 16842c4969c..715d38925aa 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -3459,7 +3459,7 @@ find_item_in_list(Item *find, List &items, uint *counter, } } } - else if (!table_name && (item->eq(find,0) || + else if (!table_name && (find->eq(item,0) || find->name && item->name && !my_strcasecmp(system_charset_info, item->name,find->name))) From f0a9ad917a7d30563e0664020d8066cb30beb6bb Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Sep 2005 22:43:09 -0700 Subject: [PATCH 127/225] BUG #7815 Changes per serg to http://lists.mysql.com/internals/30281 Re-enabled --delayed-insert client/mysqldump.c: BUG #7815 Changes per serg on patch: http://lists.mysql.com/internals/30281 1. Re-enabled --delayed-insert - modified options, removed code that was in place until bug was fixed 2. Moved the call to get_table_structure to dump_table - Use added 'ignore_flag' variable to determine what exactly is being ignored - whole table or just delayed insert ability 3. Changed return type of ignore_table to char with byte value that determines what exactly is being ignored - the whole table, or delayed inserts 4. Added ignore_table flags IGNORE_DATA and IGNORE_INSERT_DELAYED 5. Added logic in get_table_structure to not append INSERT data text if the table's data isn't going to be dumped because the return value from ignore_table is IGNORE_DATA 6. Changed the name of numFields to numfields. Studly caps aren't consistent with the rest of the code! 7. Added inclusive list to check_if_ignore_table to set the flag to IGNORE_INSERT_DELAYED if the table type doesn't support delayed inserts. 8. More documentation mysql-test/r/mysqldump.result: BUG #7815 new results mysql-test/r/mysqldump-max.result: BUG #7815 New test results mysql-test/t/mysqldump-max.test: BUG #7815 New test for testing if insert delayed is applied to tables that support it in mysqldump, but only if all storage engines in test have been compiled in --- client/mysqldump.c | 297 ++++++++++++++++++------------ mysql-test/r/mysqldump-max.result | 266 ++++++++++++++++++++++++++ mysql-test/r/mysqldump.result | 4 +- mysql-test/t/mysqldump-max.test | 73 ++++++++ 4 files changed, 520 insertions(+), 120 deletions(-) create mode 100644 mysql-test/r/mysqldump-max.result create mode 100644 mysql-test/t/mysqldump-max.test diff --git a/client/mysqldump.c b/client/mysqldump.c index 322acbd26c0..5d1a6c175bf 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -70,6 +70,11 @@ /* Size of buffer for dump's select query */ #define QUERY_LENGTH 1536 +/* ignore table flags */ +#define IGNORE_NONE 0x00 /* no ignore */ +#define IGNORE_DATA 0x01 /* don't dump data for this table */ +#define IGNORE_INSERT_DELAYED 0x02 /* table doesn't support INSERT DELAYED */ + static char *add_load_option(char *ptr, const char *object, const char *statement); static ulong find_set(TYPELIB *lib, const char *x, uint length, @@ -209,9 +214,7 @@ static struct my_option my_long_options[] = {"default-character-set", OPT_DEFAULT_CHARSET, "Set the default character set.", (gptr*) &default_charset, (gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"delayed-insert", OPT_DELAYED, "Insert rows with INSERT DELAYED; " - "currently ignored because of http://bugs.mysql.com/bug.php?id=7815 " - "but will be re-enabled later", + {"delayed-insert", OPT_DELAYED, "Insert rows with INSERT DELAYED; ", (gptr*) &opt_delayed, (gptr*) &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"delete-master-logs", OPT_DELETE_MASTER_LOGS, @@ -411,7 +414,7 @@ static int init_dumping(char *); static int dump_databases(char **); static int dump_all_databases(); static char *quote_name(const char *name, char *buff, my_bool force); -static const char *check_if_ignore_table(const char *table_name); +char check_if_ignore_table(const char *table_name, char *table_type); static char *primary_key_fields(const char *table_name); static my_bool get_view_structure(char *table, char* db); static my_bool dump_all_views_in_db(char *database); @@ -720,25 +723,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), } break; } -#ifndef REMOVE_THIS_CODE_WHEN_FIX_BUG_7815 - case (int) OPT_DELAYED: - /* - Because of http://bugs.mysql.com/bug.php?id=7815, we disable - --delayed-insert; when the bug gets fixed by checking the storage engine - (using the table definition cache) before printing INSERT DELAYED, we - can correct the option's description and re-enable it again (scheduled - for later 5.0 or 5.1 versions). - It's ok to do the if() below as get_one_option is called after - opt_delayed is set. - */ - if (opt_delayed) - { - fprintf(stderr, "Warning: ignoring --delayed-insert (as explained " - "in the output of 'mysqldump --help').\n"); - opt_delayed= 0; - } - break; -#endif } return 0; } @@ -1280,19 +1264,27 @@ static uint dump_routines_for_db (char *db) } /* - getTableStructure -- retrievs database structure, prints out corresponding - CREATE statement and fills out insert_pat. + get_table_structure -- retrievs database structure, prints out corresponding + CREATE statement and fills out insert_pat if the table is the type we will + be dumping. + + ARGS + table - table name + db - db name + table_type - table type ie "InnoDB" + ignore_flag - what we must particularly ignore - see IGNORE_ defines above RETURN number of fields in table, 0 if error */ -static uint get_table_structure(char *table, char *db) +static uint get_table_structure(char *table, char *db, char *table_type, + char *ignore_flag) { MYSQL_RES *tableRes; MYSQL_ROW row; my_bool init=0; - uint numFields; + uint num_fields; char *result_table, *opt_quoted_table; const char *insert_option; char name_buff[NAME_LEN+3],table_buff[NAME_LEN*2+3]; @@ -1300,18 +1292,30 @@ static uint get_table_structure(char *table, char *db) char query_buff[512]; FILE *sql_file = md_result_file; int len; + DBUG_ENTER("get_table_structure"); DBUG_PRINT("enter", ("db: %s, table: %s", db, table)); - if (!insert_pat_inited) - { - insert_pat_inited= init_dynamic_string(&insert_pat, "", 1024, 1024); - } - else - dynstr_set(&insert_pat, ""); + *ignore_flag= check_if_ignore_table(table, table_type); - insert_option= ((opt_delayed && opt_ignore) ? " DELAYED IGNORE " : - opt_delayed ? " DELAYED " : + if (opt_delayed && (*ignore_flag & IGNORE_INSERT_DELAYED)) + if (verbose) + fprintf(stderr, + "-- Unable to use delayed inserts for table '%s' because it's of\ + type %s\n", table, table_type); + + if (!(*ignore_flag & IGNORE_DATA)) + { + if (!insert_pat_inited) + insert_pat_inited= init_dynamic_string(&insert_pat, "", 1024, 1024); + else + dynstr_set(&insert_pat, ""); + } + + insert_option= ((opt_delayed && opt_ignore && + !(*ignore_flag & IGNORE_INSERT_DELAYED)) ? + " DELAYED IGNORE " : + opt_delayed && !(*ignore_flag & IGNORE_INSERT_DELAYED) ? " DELAYED " : opt_ignore ? " IGNORE " : ""); if (verbose) @@ -1321,7 +1325,8 @@ static uint get_table_structure(char *table, char *db) "SET OPTION SQL_QUOTE_SHOW_CREATE=%d", (opt_quoted || opt_keywords)); if (!create_options) - strmov(query_buff+len, "/*!40102 ,SQL_MODE=concat(@@sql_mode, _utf8 ',NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS') */"); + strmov(query_buff+len, + "/*!40102 ,SQL_MODE=concat(@@sql_mode, _utf8 ',NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS') */"); result_table= quote_name(table, table_buff, 1); opt_quoted_table= quote_name(table, table_buff2, 0); @@ -1442,34 +1447,42 @@ static uint get_table_structure(char *table, char *db) DBUG_RETURN(0); } - dynstr_append_mem(&insert_pat, "INSERT ", 7); - dynstr_append(&insert_pat, insert_option); - dynstr_append_mem(&insert_pat, "INTO ", 5); - dynstr_append(&insert_pat, opt_quoted_table); - if (opt_complete_insert) + /* + if *ignore_flag & IGNORE_DATA is true, then we don't build up insert statements + for the table's data. Note: in subsequent lines of code, this test will + have to be performed each time we are appending to insert_pat. + */ + if (!(*ignore_flag & IGNORE_DATA)) { - dynstr_append_mem(&insert_pat, " (", 2); - } - else - { - dynstr_append_mem(&insert_pat, " VALUES ", 8); - if (!extended_insert) - dynstr_append_mem(&insert_pat, "(", 1); + dynstr_append_mem(&insert_pat, "INSERT ", 7); + dynstr_append(&insert_pat, insert_option); + dynstr_append_mem(&insert_pat, "INTO ", 5); + dynstr_append(&insert_pat, opt_quoted_table); + if (opt_complete_insert) + { + dynstr_append_mem(&insert_pat, " (", 2); + } + else + { + dynstr_append_mem(&insert_pat, " VALUES ", 8); + if (!extended_insert) + dynstr_append_mem(&insert_pat, "(", 1); + } } while ((row=mysql_fetch_row(tableRes))) { if (init) { - if (opt_complete_insert) + if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA)) dynstr_append_mem(&insert_pat, ", ", 2); } init=1; - if (opt_complete_insert) + if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA)) dynstr_append(&insert_pat, quote_name(row[SHOW_FIELDNAME], name_buff, 0)); } - numFields = (uint) mysql_num_rows(tableRes); + num_fields= (uint) mysql_num_rows(tableRes); mysql_free_result(tableRes); } else @@ -1515,19 +1528,20 @@ static uint get_table_structure(char *table, char *db) check_io(sql_file); } - dynstr_append_mem(&insert_pat, "INSERT ", 7); - dynstr_append(&insert_pat, insert_option); - dynstr_append_mem(&insert_pat, "INTO ", 5); - dynstr_append(&insert_pat, result_table); - if (opt_complete_insert) + if (!(*ignore_flag & IGNORE_DATA)) { - dynstr_append_mem(&insert_pat, " (", 2); - } - else - { - dynstr_append_mem(&insert_pat, " VALUES ", 8); - if (!extended_insert) - dynstr_append_mem(&insert_pat, "(", 1); + dynstr_append_mem(&insert_pat, "INSERT ", 7); + dynstr_append(&insert_pat, insert_option); + dynstr_append_mem(&insert_pat, "INTO ", 5); + dynstr_append(&insert_pat, result_table); + if (opt_complete_insert) + dynstr_append_mem(&insert_pat, " (", 2); + else + { + dynstr_append_mem(&insert_pat, " VALUES ", 8); + if (!extended_insert) + dynstr_append_mem(&insert_pat, "(", 1); + } } while ((row=mysql_fetch_row(tableRes))) @@ -1540,11 +1554,11 @@ static uint get_table_structure(char *table, char *db) fputs(",\n",sql_file); check_io(sql_file); } - if (opt_complete_insert) + if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA)) dynstr_append_mem(&insert_pat, ", ", 2); } init=1; - if (opt_complete_insert) + if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA)) dynstr_append(&insert_pat, quote_name(row[SHOW_FIELDNAME], name_buff, 0)); if (!tFlag) @@ -1575,7 +1589,7 @@ static uint get_table_structure(char *table, char *db) check_io(sql_file); } } - numFields = (uint) mysql_num_rows(tableRes); + num_fields = (uint) mysql_num_rows(tableRes); mysql_free_result(tableRes); if (!tFlag) { @@ -1627,7 +1641,7 @@ static uint get_table_structure(char *table, char *db) print_xml_row(sql_file, "key", tableRes, &row); continue; } - + if (atoi(row[3]) == 1) { if (keynr++) @@ -1684,9 +1698,7 @@ static uint get_table_structure(char *table, char *db) else { if (opt_xml) - { print_xml_row(sql_file, "options", tableRes, &row); - } else { fputs("/*!",sql_file); @@ -1707,7 +1719,7 @@ continue_xml: check_io(sql_file); } } - if (opt_complete_insert) + if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA)) { dynstr_append_mem(&insert_pat, ") VALUES ", 9); if (!extended_insert) @@ -1719,7 +1731,7 @@ continue_xml: write_footer(sql_file); my_fclose(sql_file, MYF(MY_WME)); } - DBUG_RETURN(numFields); + DBUG_RETURN(num_fields); } /* get_table_structure */ @@ -1844,20 +1856,40 @@ static char *alloc_query_str(ulong size) /* -** dump_table saves database contents as a series of INSERT statements. + + SYNOPSIS + dump_table() + + dump_table saves database contents as a series of INSERT statements. + + ARGS + table - table name + db - db name + + RETURNS + void */ -static void dump_table(uint numFields, char *table) +static void dump_table(char *table, char *db) { + char ignore_flag; char query_buf[QUERY_LENGTH], *end, buff[256],table_buff[NAME_LEN+3]; + char table_type[NAME_LEN]; char *result_table, table_buff2[NAME_LEN*2+3], *opt_quoted_table; char *query= query_buf; + int error= 0; + ulong rownr, row_break, total_length, init_length; + uint num_fields; MYSQL_RES *res; MYSQL_FIELD *field; MYSQL_ROW row; - ulong rownr, row_break, total_length, init_length; - const char *table_type; - int error= 0; + DBUG_ENTER("dump_table"); + + /* + Make sure you get the create table info before the following check for + --no-data flag below. Otherwise, the create table info won't be printed. + */ + num_fields= get_table_structure(table, db, (char *)&table_type, &ignore_flag); /* Check --no-data flag */ if (dFlag) @@ -1866,31 +1898,35 @@ static void dump_table(uint numFields, char *table) fprintf(stderr, "-- Skipping dump data for table '%s', --no-data was used\n", table); - return; + DBUG_VOID_RETURN; } - /* Check that there are any fields in the table */ - if (numFields == 0) - { - if (verbose) - fprintf(stderr, - "-- Skipping dump data for table '%s', it has no fields\n", - table); - return; - } - - result_table= quote_name(table,table_buff, 1); - opt_quoted_table= quote_name(table, table_buff2, 0); - - /* Check table type */ - if ((table_type= check_if_ignore_table(table))) + DBUG_PRINT("info", ("ignore_flag %x num_fields %d", ignore_flag, num_fields)); + /* + If the table type is a merge table or any type that has to be + _completely_ ignored and no data dumped + */ + if (ignore_flag & IGNORE_DATA) { if (verbose) fprintf(stderr, "-- Skipping data for table '%s' because it's of type %s\n", table, table_type); - return; + DBUG_VOID_RETURN; } + /* Check that there are any fields in the table */ + if (num_fields == 0) + { + if (verbose) + fprintf(stderr, + "-- Skipping dump data for table '%s', it has no fields\n", + table); + DBUG_VOID_RETURN; + } + + result_table= quote_name(table,table_buff, 1); + opt_quoted_table= quote_name(table, table_buff2, 0); + if (verbose) fprintf(stderr, "-- Sending SELECT query...\n"); @@ -1934,7 +1970,7 @@ static void dump_table(uint numFields, char *table) if (mysql_real_query(sock, query, (uint) (end - query))) { DB_error(sock, "when executing 'SELECT INTO OUTFILE'"); - return; + DBUG_VOID_RETURN; } } else @@ -1989,7 +2025,7 @@ static void dump_table(uint numFields, char *table) DB_error(sock, "when retrieving data from server"); if (verbose) fprintf(stderr, "-- Retrieving rows...\n"); - if (mysql_num_fields(res) != numFields) + if (mysql_num_fields(res) != num_fields) { fprintf(stderr,"%s: Error in field count for table: %s ! Aborting.\n", my_progname, result_table); @@ -2052,7 +2088,7 @@ static void dump_table(uint numFields, char *table) error= EX_CONSCHECK; goto err; } - + /* 63 is my_charset_bin. If charsetnr is not 63, we have not a BLOB but a TEXT column. @@ -2287,14 +2323,14 @@ static void dump_table(uint numFields, char *table) mysql_free_result(res); if (query != query_buf) my_free(query, MYF(MY_ALLOW_ZERO_PTR)); - } - return; + } + DBUG_VOID_RETURN; err: if (query != query_buf) my_free(query, MYF(MY_ALLOW_ZERO_PTR)); safe_exit(error); - return; + DBUG_VOID_RETURN; } /* dump_table */ @@ -2495,8 +2531,7 @@ static int dump_all_tables_in_db(char *database) char *end= strmov(afterdot, table); if (include_table(hash_key, end - hash_key)) { - numrows = get_table_structure(table, database); - dump_table(numrows,table); + dump_table(table,database); my_free(order_by, MYF(MY_ALLOW_ZERO_PTR)); order_by= 0; if (opt_dump_triggers && ! opt_xml && @@ -2630,7 +2665,7 @@ static int get_actual_table_name(const char *old_table_name, static int dump_selected_tables(char *db, char **table_names, int tables) { - uint numrows, i; + uint i; char table_buff[NAME_LEN*+3]; char new_table_name[NAME_LEN]; DYNAMIC_STRING lock_tables_query; @@ -2699,8 +2734,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables) { table_name= hash_element(&dump_tables, i); DBUG_PRINT("info",("Dumping table %s", table_name)); - numrows= get_table_structure(table_name, db); - dump_table(numrows, table_name); + dump_table(table_name,db); if (opt_dump_triggers && mysql_get_server_version(sock) >= 50009) dump_triggers_for_table(table_name, db); @@ -2899,28 +2933,37 @@ static void print_value(FILE *file, MYSQL_RES *result, MYSQL_ROW row, /* - Check if we the table is one of the table types that should be ignored: - MRG_ISAM, MRG_MYISAM SYNOPSIS + + Check if we the table is one of the table types that should be ignored: + MRG_ISAM, MRG_MYISAM, if opt_delayed, if that table supports delayed inserts. + If the table should be altogether ignored, it returns a TRUE, FALSE if it + should not be ignored. If the user has selected to use INSERT DELAYED, it + sets the value of the bool pointer supports_delayed_inserts to 0 if not + supported, 1 if it is supported. + + ARGS + check_if_ignore_table() table_name Table name to check + table_type Type of table GLOBAL VARIABLES sock MySQL socket verbose Write warning messages RETURN - 0 Table should be backuped - # Type of table (that should be skipped) + char (bit value) See IGNORE_ values at top */ -static const char *check_if_ignore_table(const char *table_name) +char check_if_ignore_table(const char *table_name, char *table_type) { + bool result= IGNORE_NONE; char buff[FN_REFLEN+80], show_name_buff[FN_REFLEN]; MYSQL_RES *res; MYSQL_ROW row; - const char *result= 0; + DBUG_ENTER("check_if_ignore_table"); /* Check memory for quote_for_like() */ DBUG_ASSERT(2*sizeof(table_name) < sizeof(show_name_buff)); @@ -2934,7 +2977,7 @@ static const char *check_if_ignore_table(const char *table_name) fprintf(stderr, "-- Warning: Couldn't get status information for table %s (%s)\n", table_name,mysql_error(sock)); - return 0; /* assume table is ok */ + DBUG_RETURN(IGNORE_NONE); /* assume table is ok */ } } if (!(row= mysql_fetch_row(res))) @@ -2943,18 +2986,38 @@ static const char *check_if_ignore_table(const char *table_name) "Error: Couldn't read status information for table %s (%s)\n", table_name, mysql_error(sock)); mysql_free_result(res); - return 0; /* assume table is ok */ + DBUG_RETURN(IGNORE_NONE); /* assume table is ok */ } if (!(row[1])) - result= "VIEW"; + strcpy(table_type,"VIEW"); else { - if (strcmp(row[1], (result= "MRG_MyISAM")) && - strcmp(row[1], (result= "MRG_ISAM"))) - result= 0; + /* + If the table type matches any of these, we do support delayed inserts. + Note: we do not want to skip dumping this table if if is not one of + these types, but we do want to use delayed inserts in the dump if + the table type is _NOT_ one of these types + */ + sprintf(table_type, "%s",row[1]); + if (opt_delayed) + { + if (strcmp(table_type,"MyISAM") && + strcmp(table_type,"ISAM") && + strcmp(table_type,"ARCHIVE") && + strcmp(table_type,"HEAP") && + strcmp(table_type,"MEMORY")) + result= IGNORE_INSERT_DELAYED; + } + + /* + If these two types, we do want to skip dumping the table + */ + if (!dFlag && + (!strcmp(table_type,"MRG_MyISAM") || !strcmp(table_type,"MRG_ISAM"))) + result= IGNORE_DATA; } mysql_free_result(res); - return result; + DBUG_RETURN(result); } /* diff --git a/mysql-test/r/mysqldump-max.result b/mysql-test/r/mysqldump-max.result new file mode 100644 index 00000000000..699552bd514 --- /dev/null +++ b/mysql-test/r/mysqldump-max.result @@ -0,0 +1,266 @@ +drop table if exists t1; +Warnings: +Note 1051 Unknown table 't1' +drop table if exists t2; +Warnings: +Note 1051 Unknown table 't2' +drop table if exists t3; +Warnings: +Note 1051 Unknown table 't3' +drop table if exists t4; +Warnings: +Note 1051 Unknown table 't4' +drop table if exists t5; +Warnings: +Note 1051 Unknown table 't5' +drop table if exists t6; +Warnings: +Note 1051 Unknown table 't6' +create table t1 (id int(8), name varchar(32)); +create table t2 (id int(8), name varchar(32)) ENGINE="MyISAM"; +create table t3 (id int(8), name varchar(32)) ENGINE="MEMORY"; +create table t4 (id int(8), name varchar(32)) ENGINE="HEAP"; +create table t5 (id int(8), name varchar(32)) ENGINE="ARCHIVE"; +create table t6 (id int(8), name varchar(32)) ENGINE="InnoDB"; +insert into t1 values (1, 'first value'); +insert into t1 values (2, 'first value'); +insert into t1 values (3, 'first value'); +insert into t1 values (4, 'first value'); +insert into t1 values (5, 'first value'); +insert into t2 values (1, 'first value'); +insert into t2 values (2, 'first value'); +insert into t2 values (3, 'first value'); +insert into t2 values (4, 'first value'); +insert into t2 values (5, 'first value'); +insert into t3 values (1, 'first value'); +insert into t3 values (2, 'first value'); +insert into t3 values (3, 'first value'); +insert into t3 values (4, 'first value'); +insert into t3 values (5, 'first value'); +insert into t4 values (1, 'first value'); +insert into t4 values (2, 'first value'); +insert into t4 values (3, 'first value'); +insert into t4 values (4, 'first value'); +insert into t4 values (5, 'first value'); +insert into t5 values (1, 'first value'); +insert into t5 values (2, 'first value'); +insert into t5 values (3, 'first value'); +insert into t5 values (4, 'first value'); +insert into t5 values (5, 'first value'); +insert into t6 values (1, 'first value'); +insert into t6 values (2, 'first value'); +insert into t6 values (3, 'first value'); +insert into t6 values (4, 'first value'); +insert into t6 values (5, 'first value'); +select * from t1; +id name +1 first value +2 first value +3 first value +4 first value +5 first value +select * from t2; +id name +1 first value +2 first value +3 first value +4 first value +5 first value +select * from t3; +id name +1 first value +2 first value +3 first value +4 first value +5 first value +select * from t4; +id name +1 first value +2 first value +3 first value +4 first value +5 first value +select * from t5; +id name +1 first value +2 first value +3 first value +4 first value +5 first value +select * from t6; +id name +1 first value +2 first value +3 first value +4 first value +5 first value + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `test`; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `id` int(8) default NULL, + `name` varchar(32) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +INSERT DELAYED IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; +DROP TABLE IF EXISTS `t2`; +CREATE TABLE `t2` ( + `id` int(8) default NULL, + `name` varchar(32) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t2` DISABLE KEYS */; +INSERT DELAYED IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +/*!40000 ALTER TABLE `t2` ENABLE KEYS */; +DROP TABLE IF EXISTS `t3`; +CREATE TABLE `t3` ( + `id` int(8) default NULL, + `name` varchar(32) default NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t3` DISABLE KEYS */; +INSERT DELAYED IGNORE INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +/*!40000 ALTER TABLE `t3` ENABLE KEYS */; +DROP TABLE IF EXISTS `t4`; +CREATE TABLE `t4` ( + `id` int(8) default NULL, + `name` varchar(32) default NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t4` DISABLE KEYS */; +INSERT DELAYED IGNORE INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +/*!40000 ALTER TABLE `t4` ENABLE KEYS */; +DROP TABLE IF EXISTS `t5`; +CREATE TABLE `t5` ( + `id` int(8) default NULL, + `name` varchar(32) default NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t5` DISABLE KEYS */; +INSERT DELAYED IGNORE INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +/*!40000 ALTER TABLE `t5` ENABLE KEYS */; +DROP TABLE IF EXISTS `t6`; +CREATE TABLE `t6` ( + `id` int(8) default NULL, + `name` varchar(32) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t6` DISABLE KEYS */; +INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +/*!40000 ALTER TABLE `t6` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `test`; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `id` int(8) default NULL, + `name` varchar(32) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +INSERT DELAYED INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; +DROP TABLE IF EXISTS `t2`; +CREATE TABLE `t2` ( + `id` int(8) default NULL, + `name` varchar(32) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t2` DISABLE KEYS */; +INSERT DELAYED INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +/*!40000 ALTER TABLE `t2` ENABLE KEYS */; +DROP TABLE IF EXISTS `t3`; +CREATE TABLE `t3` ( + `id` int(8) default NULL, + `name` varchar(32) default NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t3` DISABLE KEYS */; +INSERT DELAYED INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +/*!40000 ALTER TABLE `t3` ENABLE KEYS */; +DROP TABLE IF EXISTS `t4`; +CREATE TABLE `t4` ( + `id` int(8) default NULL, + `name` varchar(32) default NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t4` DISABLE KEYS */; +INSERT DELAYED INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +/*!40000 ALTER TABLE `t4` ENABLE KEYS */; +DROP TABLE IF EXISTS `t5`; +CREATE TABLE `t5` ( + `id` int(8) default NULL, + `name` varchar(32) default NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t5` DISABLE KEYS */; +INSERT DELAYED INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +/*!40000 ALTER TABLE `t5` ENABLE KEYS */; +DROP TABLE IF EXISTS `t6`; +CREATE TABLE `t6` ( + `id` int(8) default NULL, + `name` varchar(32) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t6` DISABLE KEYS */; +INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); +/*!40000 ALTER TABLE `t6` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +drop table t1; +drop table t2; +drop table t3; +drop table t4; +drop table t5; +drop table t6; diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 48e6ded689e..5b75ebaab04 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -614,9 +614,7 @@ CREATE TABLE `t1` ( /*!40000 ALTER TABLE `t1` DISABLE KEYS */; -LOCK TABLES `t1` WRITE; -INSERT IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6); -UNLOCK TABLES; +INSERT DELAYED IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; diff --git a/mysql-test/t/mysqldump-max.test b/mysql-test/t/mysqldump-max.test new file mode 100644 index 00000000000..fbea84808b4 --- /dev/null +++ b/mysql-test/t/mysqldump-max.test @@ -0,0 +1,73 @@ +# Embedded server doesn't support external clients +--source include/not_embedded.inc +--source include/have_innodb.inc +--source include/have_archive.inc + +--disable-warnings +drop table if exists t1; +drop table if exists t2; +drop table if exists t3; +drop table if exists t4; +drop table if exists t5; +drop table if exists t6; +--enable-warnings + +create table t1 (id int(8), name varchar(32)); +create table t2 (id int(8), name varchar(32)) ENGINE="MyISAM"; +create table t3 (id int(8), name varchar(32)) ENGINE="MEMORY"; +create table t4 (id int(8), name varchar(32)) ENGINE="HEAP"; +create table t5 (id int(8), name varchar(32)) ENGINE="ARCHIVE"; +create table t6 (id int(8), name varchar(32)) ENGINE="InnoDB"; + +insert into t1 values (1, 'first value'); +insert into t1 values (2, 'first value'); +insert into t1 values (3, 'first value'); +insert into t1 values (4, 'first value'); +insert into t1 values (5, 'first value'); + +insert into t2 values (1, 'first value'); +insert into t2 values (2, 'first value'); +insert into t2 values (3, 'first value'); +insert into t2 values (4, 'first value'); +insert into t2 values (5, 'first value'); + +insert into t3 values (1, 'first value'); +insert into t3 values (2, 'first value'); +insert into t3 values (3, 'first value'); +insert into t3 values (4, 'first value'); +insert into t3 values (5, 'first value'); + +insert into t4 values (1, 'first value'); +insert into t4 values (2, 'first value'); +insert into t4 values (3, 'first value'); +insert into t4 values (4, 'first value'); +insert into t4 values (5, 'first value'); + +insert into t5 values (1, 'first value'); +insert into t5 values (2, 'first value'); +insert into t5 values (3, 'first value'); +insert into t5 values (4, 'first value'); +insert into t5 values (5, 'first value'); + +insert into t6 values (1, 'first value'); +insert into t6 values (2, 'first value'); +insert into t6 values (3, 'first value'); +insert into t6 values (4, 'first value'); +insert into t6 values (5, 'first value'); + +select * from t1; +select * from t2; +select * from t3; +select * from t4; +select * from t5; +select * from t6; + +--exec $MYSQL_DUMP --skip-comments --delayed-insert --insert-ignore --databases test +--exec $MYSQL_DUMP --skip-comments --delayed-insert --databases test + +drop table t1; +drop table t2; +drop table t3; +drop table t4; +drop table t5; +drop table t6; From 706731cf8d36936b3897168316c819e7b354e321 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Sep 2005 08:28:56 +0200 Subject: [PATCH 128/225] portability.h: Define SHUT_RDWR for OpenServer 5 server-tools/instance-manager/portability.h: Define SHUT_RDWR for OpenServer 5 --- server-tools/instance-manager/portability.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server-tools/instance-manager/portability.h b/server-tools/instance-manager/portability.h index c2b4e8b7467..9fc0fe58c0a 100644 --- a/server-tools/instance-manager/portability.h +++ b/server-tools/instance-manager/portability.h @@ -1,6 +1,10 @@ #ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_PORTABILITY_H #define INCLUDES_MYSQL_INSTANCE_MANAGER_PORTABILITY_H +#if defined(__SCO_DS) && !defined(SHUT_RDWR) +#define SHUT_RDWR 2 +#endif + #ifdef __WIN__ #define vsnprintf _vsnprintf From d7e4e1a56173df249ec4c27a332c127752771628 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Sep 2005 23:29:02 -0700 Subject: [PATCH 129/225] item.cc: Fixed bug #13410. Fixed name resolution for qualified reference to a view column in the HAVING clause. view.result, view.test: Added a test case for bug #13410. mysql-test/t/view.test: Added a test case for bug #13410. mysql-test/r/view.result: Added a test case for bug #13410. sql/item.cc: Fixed bug #13410. Fixed name resolution for qualified reference to a view column in the HAVING clause. --- mysql-test/r/view.result | 13 +++++++++++++ mysql-test/t/view.test | 11 +++++++++++ sql/item.cc | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 74005e0aff0..9742c029706 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -2275,3 +2275,16 @@ a 3 DROP VIEW v1; DROP TABLE t1; +CREATE TABLE t1 ( a int, b int ); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +CREATE VIEW v1 AS SELECT a,b FROM t1; +SELECT t1.a FROM t1 GROUP BY t1.a HAVING t1.a > 1; +a +2 +3 +SELECT v1.a FROM v1 GROUP BY v1.a HAVING v1.a > 1; +a +2 +3 +DROP VIEW v1; +DROP TABLE t1; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 11a318549d4..8d3593162c7 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -2153,4 +2153,15 @@ SELECT v1.a FROM v1 GROUP BY v1.a HAVING a > 1; DROP VIEW v1; DROP TABLE t1; +# +# Bug #13410: failed name resolution for qualified view column in HAVING +# +CREATE TABLE t1 ( a int, b int ); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +CREATE VIEW v1 AS SELECT a,b FROM t1; +SELECT t1.a FROM t1 GROUP BY t1.a HAVING t1.a > 1; +SELECT v1.a FROM v1 GROUP BY v1.a HAVING v1.a > 1; + +DROP VIEW v1; +DROP TABLE t1; diff --git a/sql/item.cc b/sql/item.cc index 012c389b939..92a7330374a 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2983,7 +2983,7 @@ static Item** find_field_in_group_list(Item *find_item, ORDER *group_list) for (ORDER *cur_group= group_list ; cur_group ; cur_group= cur_group->next) { - if ((*(cur_group->item))->type() == Item::FIELD_ITEM) + if ((*(cur_group->item))->real_item()->type() == Item::FIELD_ITEM) { cur_field= (Item_field*) *cur_group->item; cur_match_degree= 0; From bb292ca1399869d6e65900d385627d03988ab7b2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Sep 2005 09:42:41 +0300 Subject: [PATCH 130/225] InnoDB: Fix compile warning. innobase/include/trx0trx.h: Change trx_set_detailed_error's second argument to const char*. innobase/trx/trx0trx.c: Change trx_set_detailed_error's second argument to const char*. --- innobase/include/trx0trx.h | 4 ++-- innobase/trx/trx0trx.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h index 964491f747b..0dc82893ad1 100644 --- a/innobase/include/trx0trx.h +++ b/innobase/include/trx0trx.h @@ -61,8 +61,8 @@ Set detailed error message for the transaction. */ void trx_set_detailed_error( /*===================*/ - trx_t* trx, /* in: transaction struct */ - char* msg); /* in: detailed error message */ + trx_t* trx, /* in: transaction struct */ + const char* msg); /* in: detailed error message */ /***************************************************************** Set detailed error message for the transaction from a file. Note that the file is rewinded before reading from it. */ diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c index 10b95179a73..090057f5d46 100644 --- a/innobase/trx/trx0trx.c +++ b/innobase/trx/trx0trx.c @@ -58,8 +58,8 @@ Set detailed error message for the transaction. */ void trx_set_detailed_error( /*===================*/ - trx_t* trx, /* in: transaction struct */ - char* msg) /* in: detailed error message */ + trx_t* trx, /* in: transaction struct */ + const char* msg) /* in: detailed error message */ { ut_strlcpy(trx->detailed_error, msg, sizeof(trx->detailed_error)); } From 912317f3e794970571162894cefa11f855bf2d60 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Sep 2005 13:37:20 +0400 Subject: [PATCH 131/225] Fix for bug #13367, post-review changes --- innobase/buf/buf0flu.c | 4 ++-- innobase/srv/srv0start.c | 2 +- innobase/trx/trx0sys.c | 19 ------------------- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/innobase/buf/buf0flu.c b/innobase/buf/buf0flu.c index bd14f14ea95..e39d1ae0a71 100644 --- a/innobase/buf/buf0flu.c +++ b/innobase/buf/buf0flu.c @@ -503,11 +503,11 @@ buf_flush_write_block_low( #endif buf_flush_init_for_writing(block->frame, block->newest_modification, block->space, block->offset); - if (!trx_doublewrite) { + if (!srv_use_doublewrite_buf || !trx_doublewrite) { fil_io(OS_FILE_WRITE | OS_AIO_SIMULATED_WAKE_LATER, FALSE, block->space, block->offset, 0, UNIV_PAGE_SIZE, (void*)block->frame, (void*)block); - } else if (srv_use_doublewrite_buf) { + } else { buf_flush_post_to_doublewrite_buf(block); } } diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c index 325b0a109cf..e5151ebf631 100644 --- a/innobase/srv/srv0start.c +++ b/innobase/srv/srv0start.c @@ -1540,7 +1540,7 @@ NetWare. */ #endif sync_order_checks_on = TRUE; - if (srv_use_doublewrite_buf && trx_doublewrite == NULL) { + if (trx_doublewrite == NULL) { /* Create the doublewrite buffer to a new tablespace */ trx_sys_create_doublewrite_buf(); diff --git a/innobase/trx/trx0sys.c b/innobase/trx/trx0sys.c index bf48c30e942..23f1dc40d00 100644 --- a/innobase/trx/trx0sys.c +++ b/innobase/trx/trx0sys.c @@ -125,22 +125,6 @@ trx_doublewrite_init( * sizeof(void*)); } -/******************************************************************** -Frees the doublewrite buffer. */ -static -void -trx_doublewrite_free(void) -/*======================*/ -{ - mutex_free(&(trx_doublewrite->mutex)); - - mem_free(trx_doublewrite->buf_block_arr); - ut_free(trx_doublewrite->write_buf_unaligned); - - mem_free(trx_doublewrite); - trx_doublewrite = NULL; -} - /******************************************************************** Marks the trx sys header when we have successfully upgraded to the >= 4.1.x multiple tablespace format. */ @@ -529,9 +513,6 @@ trx_sys_doublewrite_init_or_restore_pages( fil_flush_file_spaces(FIL_TABLESPACE); - if (!srv_use_doublewrite_buf) - trx_doublewrite_free(); - leave_func: ut_free(unaligned_read_buf); } From 4252b11a2d7a95bcacbcf905df3ed0a7641b80c3 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Sep 2005 12:10:22 +0200 Subject: [PATCH 132/225] mysql.user.password doesn't need utf8 --- scripts/mysql_create_system_tables.sh | 2 +- scripts/mysql_fix_privilege_tables.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 383f8b80dc8..babf3a1c83f 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -123,7 +123,7 @@ then c_u="$c_u CREATE TABLE user (" c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL," c_u="$c_u User char(16) binary DEFAULT '' NOT NULL," - c_u="$c_u Password char(41) binary DEFAULT '' NOT NULL," + c_u="$c_u Password binary(41) DEFAULT '' NOT NULL," c_u="$c_u Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_u="$c_u Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_u="$c_u Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 45f3b8533b5..7dba854e313 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -156,9 +156,9 @@ alter table columns_priv comment='Column privileges'; ALTER TABLE user MODIFY Host char(60) NOT NULL default '', MODIFY User char(16) NOT NULL default '', - MODIFY Password char(41) NOT NULL default '', ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ALTER TABLE user + MODIFY Password binary(41) NOT NULL default '', MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, From 629697e59406aa32e7e43371e767269ff98e6161 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Sep 2005 15:26:16 +0200 Subject: [PATCH 133/225] Bug#9112 - Merge table with composite index producing invalid results with some queries Reduced the precision of the test numbers. Not all platforms could reproduce the exact numbers. mysql-test/r/merge.result: Bug#9112 - Merge table with composite index producing invalid results with some queries The new test result --- mysql-test/r/merge.result | 12 ++++++------ mysql-test/t/merge.test | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 6cfde286351..d00423ea4bf 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -620,28 +620,28 @@ create table t3 engine=merge union=(t1, t2) select * from t2; INSERT TABLE 't2' isn't allowed in FROM table list drop table t1, t2; create table t1 ( -a double(16,6), +a double(14,4), b varchar(10), index (a,b) ) engine=merge union=(t2,t3); create table t2 ( -a double(16,6), +a double(14,4), b varchar(10), index (a,b) ) engine=myisam; create table t3 ( -a double(16,6), +a double(14,4), b varchar(10), index (a,b) ) engine=myisam; insert into t2 values ( null, ''); -insert into t2 values ( 9999999999.999999, ''); +insert into t2 values ( 9999999999.9999, ''); insert into t3 select * from t2; select min(a), max(a) from t1; min(a) max(a) -9999999999.999998 9999999999.999998 +9999999999.9999 9999999999.9999 flush tables; select min(a), max(a) from t1; min(a) max(a) -9999999999.999998 9999999999.999998 +9999999999.9999 9999999999.9999 drop table t1, t2, t3; diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 4c1d10b47e3..429013af56f 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -273,25 +273,25 @@ drop table t1, t2; # non-debug build. But there is no guarantee that this will be always so. # create table t1 ( - a double(16,6), + a double(14,4), b varchar(10), index (a,b) ) engine=merge union=(t2,t3); create table t2 ( - a double(16,6), + a double(14,4), b varchar(10), index (a,b) ) engine=myisam; create table t3 ( - a double(16,6), + a double(14,4), b varchar(10), index (a,b) ) engine=myisam; insert into t2 values ( null, ''); -insert into t2 values ( 9999999999.999999, ''); +insert into t2 values ( 9999999999.9999, ''); insert into t3 select * from t2; select min(a), max(a) from t1; flush tables; From 32474e2984a9cfc224bfe0bc57f39fb1b2924774 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Sep 2005 16:34:49 +0200 Subject: [PATCH 134/225] Bug #13163 yassl: aix52 crash with ssl turned on - It seems like malloc(0) returns a null pointer on aix52 extra/yassl/mySTL/vector.hpp: Don't allow malloc(0), if n is 0 use 1 --- extra/yassl/mySTL/vector.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extra/yassl/mySTL/vector.hpp b/extra/yassl/mySTL/vector.hpp index e7f63c37c7c..9eab91cfda8 100644 --- a/extra/yassl/mySTL/vector.hpp +++ b/extra/yassl/mySTL/vector.hpp @@ -45,7 +45,8 @@ struct vector_base { vector_base() : start_(0), finish_(0), end_of_storage_(0) {} vector_base(size_t n) { - start_ = static_cast(malloc(n * sizeof(T))); + // Don't allow malloc(0), if n is 0 use 1 + start_ = static_cast(malloc((n ? n : 1) * sizeof(T))); if (!start_) abort(); finish_ = start_; end_of_storage_ = start_ + n; From b09b762f860cf08f491e9e0732aec3c8d1db46ff Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Sep 2005 16:55:23 +0200 Subject: [PATCH 135/225] Fix for BUG#13527 "mysql-test-run.pl truncates var/log/*.err several times during one testsuit run" mysql-test/mysql-test-run.pl: .err files of the mysqld servers should be appended to, not reset every time we restart the mysqlds during the testsuite. --- mysql-test/mysql-test-run.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 2dda1b2a6e1..47c0e8f4e41 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2137,7 +2137,8 @@ sub mysqld_start ($$$$) { { if ( $pid= mtr_spawn($exe, $args, "", $master->[$idx]->{'path_myerr'}, - $master->[$idx]->{'path_myerr'}, "") ) + $master->[$idx]->{'path_myerr'}, "", + { append_log_file => 1 }) ) { return sleep_until_file_created($master->[$idx]->{'path_mypid'}, $master->[$idx]->{'start_timeout'}, $pid); @@ -2148,7 +2149,8 @@ sub mysqld_start ($$$$) { { if ( $pid= mtr_spawn($exe, $args, "", $slave->[$idx]->{'path_myerr'}, - $slave->[$idx]->{'path_myerr'}, "") ) + $slave->[$idx]->{'path_myerr'}, "", + { append_log_file => 1 }) ) { return sleep_until_file_created($slave->[$idx]->{'path_mypid'}, $master->[$idx]->{'start_timeout'}, $pid); From cd7942d4df34babf3cb309b229937b5601a6c2f5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Sep 2005 17:03:43 +0200 Subject: [PATCH 136/225] Bug #12526 yassl: Crashes in "integer.cpp" - Improve detection of when to disable inlining for integer.cpp config/ac-macros/yassl.m4: Use variable $host_cpu the check for sparc. Print a message when inlining is disabled --- config/ac-macros/yassl.m4 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config/ac-macros/yassl.m4 b/config/ac-macros/yassl.m4 index 7af39db48be..972e4530dab 100644 --- a/config/ac-macros/yassl.m4 +++ b/config/ac-macros/yassl.m4 @@ -23,13 +23,14 @@ AC_DEFUN([MYSQL_CHECK_YASSL], [ # System specific checks yassl_integer_extra_cxxflags="" - case $SYSTEM_TYPE--$CXX_VERSION in - sparc*solaris*--*Sun*C++*5.6*) + case $host_cpu--$CXX_VERSION in + sparc*--*Sun*C++*5.6*) # Disable inlining when compiling taocrypt/src/integer.cpp yassl_integer_extra_cxxflags="+d" + AC_MSG_NOTICE([disabling inlining for yassl/taocrypt/src/integer.cpp]) ;; esac - AC_SUBST([yassl_integer_extra_cxxflags]) + AC_SUBST([yassl_integer_extra_cxxflags]) else yassl_dir="" From 06eabeeea83ebfeacd491acb1283a35522fad578 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Sep 2005 17:07:28 +0200 Subject: [PATCH 137/225] Fixed BUG#12589: Assert when creating temp. table from decimal stored procedure variable Second version, after review. Keep the unsigned_flag in Item_decimal updated. Note that this also changed the result of several old test results - creating tables from decimal templates now gives unsigned columns and different sizes. (Several tests had Length > Max_length before.) mysql-test/r/case.result: Updated result (after fixing BUG#12589). mysql-test/r/metadata.result: Updated result (after fixing BUG#12589). mysql-test/r/ps_2myisam.result: Updated result (after fixing BUG#12589). mysql-test/r/ps_3innodb.result: Updated result (after fixing BUG#12589). mysql-test/r/ps_4heap.result: Updated result (after fixing BUG#12589). mysql-test/r/ps_5merge.result: Updated result (after fixing BUG#12589). mysql-test/r/ps_6bdb.result: Updated result (after fixing BUG#12589). mysql-test/r/ps_7ndb.result: Updated result (after fixing BUG#12589). mysql-test/r/sp.result: New test case for BUG#12589. mysql-test/r/type_newdecimal.result: Updated result (after fixing BUG#12589). mysql-test/t/sp.test: New test case for BUG#12589. sql/item.cc: Keep the unsigned_flag updated in Item_splocal and Item_decimal. --- mysql-test/r/case.result | 8 ++--- mysql-test/r/metadata.result | 2 +- mysql-test/r/ps_2myisam.result | 4 +-- mysql-test/r/ps_3innodb.result | 4 +-- mysql-test/r/ps_4heap.result | 4 +-- mysql-test/r/ps_5merge.result | 8 ++--- mysql-test/r/ps_6bdb.result | 4 +-- mysql-test/r/ps_7ndb.result | 4 +-- mysql-test/r/sp.result | 45 +++++++++++++++++++++++++ mysql-test/r/type_newdecimal.result | 14 ++++---- mysql-test/t/sp.test | 51 +++++++++++++++++++++++++++++ sql/item.cc | 11 +++++-- 12 files changed, 131 insertions(+), 28 deletions(-) diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result index b02f85132aa..ea80695ad7b 100644 --- a/mysql-test/r/case.result +++ b/mysql-test/r/case.result @@ -103,8 +103,8 @@ t1 CREATE TABLE `t1` ( `c2` varchar(1) character set latin1 collate latin1_danish_ci NOT NULL default '', `c3` varbinary(1) NOT NULL default '', `c4` varbinary(1) NOT NULL default '', - `c5` varbinary(4) NOT NULL default '', - `c6` varbinary(4) NOT NULL default '', + `c5` varbinary(3) NOT NULL default '', + `c6` varbinary(3) NOT NULL default '', `c7` decimal(2,1) NOT NULL default '0.0', `c8` decimal(2,1) NOT NULL default '0.0', `c9` decimal(2,1) default NULL, @@ -152,11 +152,11 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `COALESCE(1)` int(1) NOT NULL default '0', - `COALESCE(1.0)` decimal(2,1) NOT NULL default '0.0', + `COALESCE(1.0)` decimal(2,1) unsigned NOT NULL default '0.0', `COALESCE('a')` varchar(1) NOT NULL default '', `COALESCE(1,1.0)` decimal(2,1) NOT NULL default '0.0', `COALESCE(1,'1')` varbinary(1) NOT NULL default '', - `COALESCE(1.1,'1')` varbinary(4) NOT NULL default '', + `COALESCE(1.1,'1')` varbinary(3) NOT NULL default '', `COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) character set latin1 collate latin1_bin NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result index 50b0b6ae294..0a170e16188 100644 --- a/mysql-test/r/metadata.result +++ b/mysql-test/r/metadata.result @@ -2,7 +2,7 @@ drop table if exists t1,t2; select 1, 1.0, -1, "hello", NULL; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def 1 8 1 1 N 32897 0 63 -def 1.0 246 4 3 N 129 1 63 +def 1.0 246 3 3 N 161 1 63 def -1 8 2 2 N 32897 0 63 def hello 253 5 5 N 1 31 8 def NULL 6 0 0 Y 32896 0 63 diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 16ead200933..c839c8a65b9 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1775,7 +1775,7 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` decimal(2,1) NOT NULL default '0.0', + `const02` decimal(2,1) unsigned NOT NULL default '0.0', `param02` decimal(65,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, @@ -1805,7 +1805,7 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 246 4 3 N 1 1 63 +def test t5 t5 const02 const02 246 3 3 N 33 1 63 def test t5 t5 param02 param02 246 67 32 Y 0 30 63 def test t5 t5 const03 const03 5 17 1 N 32769 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 9ab5a79f755..81d6180e41f 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1758,7 +1758,7 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` decimal(2,1) NOT NULL default '0.0', + `const02` decimal(2,1) unsigned NOT NULL default '0.0', `param02` decimal(65,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, @@ -1788,7 +1788,7 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 246 4 3 N 1 1 63 +def test t5 t5 const02 const02 246 3 3 N 33 1 63 def test t5 t5 param02 param02 246 67 32 Y 0 30 63 def test t5 t5 const03 const03 5 17 1 N 32769 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 8336a5bf99b..931e6b7c86c 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1759,7 +1759,7 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` decimal(2,1) NOT NULL default '0.0', + `const02` decimal(2,1) unsigned NOT NULL default '0.0', `param02` decimal(65,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, @@ -1789,7 +1789,7 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 246 4 3 N 1 1 63 +def test t5 t5 const02 const02 246 3 3 N 33 1 63 def test t5 t5 param02 param02 246 67 32 Y 0 30 63 def test t5 t5 const03 const03 5 17 1 N 32769 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index f341247a417..3b9244c251f 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1695,7 +1695,7 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` decimal(2,1) NOT NULL default '0.0', + `const02` decimal(2,1) unsigned NOT NULL default '0.0', `param02` decimal(65,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, @@ -1725,7 +1725,7 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 246 4 3 N 1 1 63 +def test t5 t5 const02 const02 246 3 3 N 33 1 63 def test t5 t5 param02 param02 246 67 32 Y 0 30 63 def test t5 t5 const03 const03 5 17 1 N 32769 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 @@ -4707,7 +4707,7 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` decimal(2,1) NOT NULL default '0.0', + `const02` decimal(2,1) unsigned NOT NULL default '0.0', `param02` decimal(65,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, @@ -4737,7 +4737,7 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 246 4 3 N 1 1 63 +def test t5 t5 const02 const02 246 3 3 N 33 1 63 def test t5 t5 param02 param02 246 67 32 Y 0 30 63 def test t5 t5 const03 const03 5 17 1 N 32769 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index fe4536827e6..643e12f7e2d 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -1758,7 +1758,7 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` decimal(2,1) NOT NULL default '0.0', + `const02` decimal(2,1) unsigned NOT NULL default '0.0', `param02` decimal(65,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, @@ -1788,7 +1788,7 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 246 4 3 N 1 1 63 +def test t5 t5 const02 const02 246 3 3 N 33 1 63 def test t5 t5 param02 param02 246 67 32 Y 0 30 63 def test t5 t5 const03 const03 5 17 1 N 32769 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index c4cb92bdc02..9fbe67f581b 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -1758,7 +1758,7 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` decimal(2,1) NOT NULL default '0.0', + `const02` decimal(2,1) unsigned NOT NULL default '0.0', `param02` decimal(65,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, @@ -1788,7 +1788,7 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 246 4 3 N 1 1 63 +def test t5 t5 const02 const02 246 3 3 N 33 1 63 def test t5 t5 param02 param02 246 67 32 Y 0 30 63 def test t5 t5 const03 const03 5 17 1 N 32769 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index f9e6eae7e57..1b8cde6d3db 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -3390,4 +3390,49 @@ s1 set sql_mode=@sm| drop table t3| drop procedure bug6127| +drop procedure if exists bug12589_1| +drop procedure if exists bug12589_2| +drop procedure if exists bug12589_3| +create procedure bug12589_1() +begin +declare spv1 decimal(3,3); +set spv1= 123.456; +set spv1 = 'test'; +create temporary table tm1 as select spv1; +show create table tm1; +drop temporary table tm1; +end| +create procedure bug12589_2() +begin +declare spv1 decimal(6,3); +set spv1= 123.456; +create temporary table tm1 as select spv1; +show create table tm1; +drop temporary table tm1; +end| +create procedure bug12589_3() +begin +declare spv1 decimal(6,3); +set spv1= -123.456; +create temporary table tm1 as select spv1; +show create table tm1; +drop temporary table tm1; +end| +call bug12589_1()| +Table Create Table +tm1 CREATE TEMPORARY TABLE `tm1` ( + `spv1` decimal(1,0) unsigned default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'test' +call bug12589_2()| +Table Create Table +tm1 CREATE TEMPORARY TABLE `tm1` ( + `spv1` decimal(6,3) unsigned default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +call bug12589_3()| +Table Create Table +tm1 CREATE TEMPORARY TABLE `tm1` ( + `spv1` decimal(6,3) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1,t2; diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index d821339a229..17ebab1c6e7 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -68,10 +68,10 @@ NULL 1.1 NULL NULL NULL 1 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `nullif(1.1, 1.1)` decimal(2,1) default NULL, - `nullif(1.1, 1.2)` decimal(2,1) default NULL, - `nullif(1.1, 0.11e1)` decimal(2,1) default NULL, - `nullif(1.0, 1)` decimal(2,1) default NULL, + `nullif(1.1, 1.1)` decimal(2,1) unsigned default NULL, + `nullif(1.1, 1.2)` decimal(2,1) unsigned default NULL, + `nullif(1.1, 0.11e1)` decimal(2,1) unsigned default NULL, + `nullif(1.0, 1)` decimal(2,1) unsigned default NULL, `nullif(1, 1.0)` int(1) default NULL, `nullif(1, 1.1)` int(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -174,9 +174,9 @@ create table t1 select round(15.4,-1), truncate(-5678.123451,-3), abs(-1.1), -(- show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `round(15.4,-1)` decimal(3,0) NOT NULL default '0', + `round(15.4,-1)` decimal(3,0) unsigned NOT NULL default '0', `truncate(-5678.123451,-3)` decimal(4,0) NOT NULL default '0', - `abs(-1.1)` decimal(3,1) NOT NULL default '0.0', + `abs(-1.1)` decimal(2,1) NOT NULL default '0.0', `-(-1.1)` decimal(2,1) NOT NULL default '0.0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; @@ -781,7 +781,7 @@ create table t1 as select 0.5; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `0.5` decimal(2,1) NOT NULL default '0.0' + `0.5` decimal(2,1) unsigned NOT NULL default '0.0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select round(1.5),round(2.5); diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 65d4f89e2bb..e16e7456056 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -4264,6 +4264,57 @@ drop table t3| drop procedure bug6127| +# +# BUG#12589: Assert when creating temp. table from decimal stored procedure +# variable +# +--disable_warnings +drop procedure if exists bug12589_1| +drop procedure if exists bug12589_2| +drop procedure if exists bug12589_3| +--enable_warnings +create procedure bug12589_1() +begin + declare spv1 decimal(3,3); + set spv1= 123.456; + + set spv1 = 'test'; + create temporary table tm1 as select spv1; + show create table tm1; + drop temporary table tm1; +end| + +create procedure bug12589_2() +begin + declare spv1 decimal(6,3); + set spv1= 123.456; + + create temporary table tm1 as select spv1; + show create table tm1; + drop temporary table tm1; +end| + +create procedure bug12589_3() +begin + declare spv1 decimal(6,3); + set spv1= -123.456; + + create temporary table tm1 as select spv1; + show create table tm1; + drop temporary table tm1; +end| + +# Note: The type of the field will match the value, not the declared +# type of the variable. (This is a type checking issue which +# might be changed later.) + +# Warning expected from "set spv1 = 'test'", the value is set to decimal "0". +call bug12589_1()| +# No warnings here +call bug12589_2()| +call bug12589_3()| + + # # BUG#NNNN: New bug synopsis # diff --git a/sql/item.cc b/sql/item.cc index 45c12d3840f..9b2406f16ff 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -904,6 +904,7 @@ bool Item_splocal::fix_fields(THD *, Item **) DBUG_ASSERT(it->fixed); max_length= it->max_length; decimals= it->decimals; + unsigned_flag= it->unsigned_flag; fixed= 1; return FALSE; } @@ -1804,6 +1805,7 @@ Item_decimal::Item_decimal(const char *str_arg, uint length, name= (char*) str_arg; decimals= (uint8) decimal_value.frac; fixed= 1; + unsigned_flag= !decimal_value.sign(); max_length= my_decimal_precision_to_length(decimal_value.intg + decimals, decimals, unsigned_flag); } @@ -1813,6 +1815,7 @@ Item_decimal::Item_decimal(longlong val, bool unsig) int2my_decimal(E_DEC_FATAL_ERROR, val, unsig, &decimal_value); decimals= (uint8) decimal_value.frac; fixed= 1; + unsigned_flag= !decimal_value.sign(); max_length= my_decimal_precision_to_length(decimal_value.intg + decimals, decimals, unsigned_flag); } @@ -1823,6 +1826,7 @@ Item_decimal::Item_decimal(double val, int precision, int scale) double2my_decimal(E_DEC_FATAL_ERROR, val, &decimal_value); decimals= (uint8) decimal_value.frac; fixed= 1; + unsigned_flag= !decimal_value.sign(); max_length= my_decimal_precision_to_length(decimal_value.intg + decimals, decimals, unsigned_flag); } @@ -1835,6 +1839,7 @@ Item_decimal::Item_decimal(const char *str, const my_decimal *val_arg, name= (char*) str; decimals= (uint8) decimal_par; max_length= length; + unsigned_flag= !decimal_value.sign(); fixed= 1; } @@ -1844,8 +1849,9 @@ Item_decimal::Item_decimal(my_decimal *value_par) my_decimal2decimal(value_par, &decimal_value); decimals= (uint8) decimal_value.frac; fixed= 1; + unsigned_flag= !decimal_value.sign(); max_length= my_decimal_precision_to_length(decimal_value.intg + decimals, - decimals, !decimal_value.sign()); + decimals, unsigned_flag); } @@ -1855,8 +1861,9 @@ Item_decimal::Item_decimal(const char *bin, int precision, int scale) &decimal_value, precision, scale); decimals= (uint8) decimal_value.frac; fixed= 1; + unsigned_flag= !decimal_value.sign(); max_length= my_decimal_precision_to_length(precision, decimals, - !decimal_value.sign()); + unsigned_flag); } From 13651fa55b79bfc96c10c98841cf63a2b5532db3 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Sep 2005 09:40:51 -0700 Subject: [PATCH 138/225] BUG #7815 - Post-review fixes required for push. client/mysqldump.c: BUG #7815 Pre-push fixes requested per Sergei's review. --- client/mysqldump.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 5d1a6c175bf..460297cd1b2 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2959,7 +2959,7 @@ static void print_value(FILE *file, MYSQL_RES *result, MYSQL_ROW row, char check_if_ignore_table(const char *table_name, char *table_type) { - bool result= IGNORE_NONE; + char result= IGNORE_NONE; char buff[FN_REFLEN+80], show_name_buff[FN_REFLEN]; MYSQL_RES *res; MYSQL_ROW row; @@ -2977,7 +2977,7 @@ char check_if_ignore_table(const char *table_name, char *table_type) fprintf(stderr, "-- Warning: Couldn't get status information for table %s (%s)\n", table_name,mysql_error(sock)); - DBUG_RETURN(IGNORE_NONE); /* assume table is ok */ + DBUG_RETURN(result); /* assume table is ok */ } } if (!(row= mysql_fetch_row(res))) @@ -2986,10 +2986,10 @@ char check_if_ignore_table(const char *table_name, char *table_type) "Error: Couldn't read status information for table %s (%s)\n", table_name, mysql_error(sock)); mysql_free_result(res); - DBUG_RETURN(IGNORE_NONE); /* assume table is ok */ + DBUG_RETURN(result); /* assume table is ok */ } if (!(row[1])) - strcpy(table_type,"VIEW"); + strmake(table_type,"VIEW", NAME_LEN-1); else { /* @@ -2998,7 +2998,7 @@ char check_if_ignore_table(const char *table_name, char *table_type) these types, but we do want to use delayed inserts in the dump if the table type is _NOT_ one of these types */ - sprintf(table_type, "%s",row[1]); + strmake(table_type, row[1], NAME_LEN-1); if (opt_delayed) { if (strcmp(table_type,"MyISAM") && From 94496220cdeca8caf8458485dd3604461ff04876 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Sep 2005 20:11:09 +0200 Subject: [PATCH 139/225] CHECKSUM TABLE now allows concurrent inserts myisam/mi_check.c: info->s->state.checksum moved to info->state->checksum myisam/mi_delete.c: info->s->state.checksum moved to info->state->checksum myisam/mi_delete_all.c: info->s->state.checksum moved to info->state->checksum myisam/mi_open.c: info->s->state.checksum moved to info->state->checksum myisam/mi_update.c: info->s->state.checksum moved to info->state->checksum myisam/mi_write.c: info->s->state.checksum moved to info->state->checksum myisam/myisamchk.c: info->s->state.checksum moved to info->state->checksum myisam/myisamdef.h: info->s->state.checksum moved to info->state->checksum myisam/myisampack.c: info->s->state.checksum moved to info->state->checksum mysql-test/r/system_mysql_db.result: result fixed sql/ha_myisam.cc: info->s->state.checksum moved to info->state->checksum --- myisam/mi_check.c | 10 +++++----- myisam/mi_delete.c | 2 +- myisam/mi_delete_all.c | 2 +- myisam/mi_open.c | 4 ++-- myisam/mi_update.c | 2 +- myisam/mi_write.c | 2 +- myisam/myisamchk.c | 4 ++-- myisam/myisamdef.h | 2 +- myisam/myisampack.c | 4 ++-- mysql-test/r/system_mysql_db.result | 2 +- sql/ha_myisam.cc | 2 +- sql/sql_table.cc | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 79fafd0cf5b..074a1b23686 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -1092,7 +1092,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) "Keypointers and record positions doesn't match"); error=1; } - else if (param->glob_crc != info->s->state.checksum && + else if (param->glob_crc != info->state->checksum && (info->s->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD))) { @@ -1388,7 +1388,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info, info->state->data_file_length=sort_param.max_pos; } if (param->testflag & T_CALC_CHECKSUM) - share->state.checksum=param->glob_crc; + info->state->checksum=param->glob_crc; if (!(param->testflag & T_SILENT)) { @@ -2156,7 +2156,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, my_errno); } if (param->testflag & T_CALC_CHECKSUM) - share->state.checksum=param->glob_crc; + info->state->checksum=param->glob_crc; if (my_chsize(share->kfile,info->state->key_file_length,0,MYF(0))) mi_check_print_warning(param, @@ -2577,7 +2577,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, my_errno); } if (param->testflag & T_CALC_CHECKSUM) - share->state.checksum=param->glob_crc; + info->state->checksum=param->glob_crc; if (my_chsize(share->kfile,info->state->key_file_length,0,MYF(0))) mi_check_print_warning(param, @@ -3808,7 +3808,7 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename) (*org_info)->s->state.create_time=share.state.create_time; (*org_info)->s->state.unique=(*org_info)->this_unique= share.state.unique; - (*org_info)->s->state.checksum=share.state.checksum; + (*org_info)->state->checksum=info.state->checksum; (*org_info)->state->del=info.state->del; (*org_info)->s->state.dellink=share.state.dellink; (*org_info)->state->empty=info.state->empty; diff --git a/myisam/mi_delete.c b/myisam/mi_delete.c index 60a07254e82..62ca7f8ff61 100644 --- a/myisam/mi_delete.c +++ b/myisam/mi_delete.c @@ -93,7 +93,7 @@ int mi_delete(MI_INFO *info,const byte *record) if ((*share->delete_record)(info)) goto err; /* Remove record from database */ - info->s->state.checksum-=info->checksum; + info->state->checksum-=info->checksum; info->update= HA_STATE_CHANGED+HA_STATE_DELETED+HA_STATE_ROW_CHANGED; info->state->records--; diff --git a/myisam/mi_delete_all.c b/myisam/mi_delete_all.c index 3033249886f..a30abb95070 100644 --- a/myisam/mi_delete_all.c +++ b/myisam/mi_delete_all.c @@ -41,7 +41,7 @@ int mi_delete_all_rows(MI_INFO *info) info->state->key_file_length=share->base.keystart; info->state->data_file_length=0; info->state->empty=info->state->key_empty=0; - state->checksum=0; + info->state->checksum=0; for (i=share->base.max_key_block_length/MI_MIN_KEY_BLOCK_LENGTH ; i-- ; ) state->key_del[i]= HA_OFFSET_ERROR; diff --git a/myisam/mi_open.c b/myisam/mi_open.c index 82663e0c318..1d99772eba6 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -822,7 +822,7 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite) mi_sizestore(ptr,state->state.empty); ptr +=8; mi_sizestore(ptr,state->state.key_empty); ptr +=8; mi_int8store(ptr,state->auto_increment); ptr +=8; - mi_int8store(ptr,(ulonglong) state->checksum);ptr +=8; + mi_int8store(ptr,(ulonglong) state->state.checksum);ptr +=8; mi_int4store(ptr,state->process); ptr +=4; mi_int4store(ptr,state->unique); ptr +=4; mi_int4store(ptr,state->status); ptr +=4; @@ -884,7 +884,7 @@ char *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state) state->state.empty = mi_sizekorr(ptr); ptr +=8; state->state.key_empty= mi_sizekorr(ptr); ptr +=8; state->auto_increment=mi_uint8korr(ptr); ptr +=8; - state->checksum=(ha_checksum) mi_uint8korr(ptr); ptr +=8; + state->state.checksum=(ha_checksum) mi_uint8korr(ptr); ptr +=8; state->process= mi_uint4korr(ptr); ptr +=4; state->unique = mi_uint4korr(ptr); ptr +=4; state->status = mi_uint4korr(ptr); ptr +=4; diff --git a/myisam/mi_update.c b/myisam/mi_update.c index ab23f2e6da9..86652996afe 100644 --- a/myisam/mi_update.c +++ b/myisam/mi_update.c @@ -162,7 +162,7 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec) if (auto_key_changed) update_auto_increment(info,newrec); if (share->calc_checksum) - share->state.checksum+=(info->checksum - old_checksum); + info->state->checksum+=(info->checksum - old_checksum); info->update= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED | HA_STATE_AKTIV | key_changed); diff --git a/myisam/mi_write.c b/myisam/mi_write.c index c8f9aa84a41..8785adae9a2 100644 --- a/myisam/mi_write.c +++ b/myisam/mi_write.c @@ -142,7 +142,7 @@ int mi_write(MI_INFO *info, byte *record) { if ((*share->write_record)(info,record)) goto err; - share->state.checksum+=info->checksum; + info->state->checksum+=info->checksum; } if (share->base.auto_key) update_auto_increment(info,record); diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index 4fc0e560911..d1907af1a83 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -1261,7 +1261,7 @@ static void descript(MI_CHECK *param, register MI_INFO *info, my_string name) share->base.raid_chunksize); } if (share->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD)) - printf("Checksum: %23s\n",llstr(info->s->state.checksum,llbuff)); + printf("Checksum: %23s\n",llstr(info->state->checksum,llbuff)); ; if (share->options & HA_OPTION_DELAY_KEY_WRITE) printf("Keys are only flushed at close\n"); @@ -1576,7 +1576,7 @@ static int mi_sort_records(MI_CHECK *param, old_record_count=info->state->records; info->state->records=0; if (sort_info.new_data_file_type != COMPRESSED_RECORD) - share->state.checksum=0; + info->state->checksum=0; if (sort_record_index(&sort_param,info,keyinfo,share->state.key_root[sort_key], temp_buff, sort_key,new_file,update_index) || diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h index 6b040f2ef0e..95ef20ed41d 100644 --- a/myisam/myisamdef.h +++ b/myisam/myisamdef.h @@ -38,6 +38,7 @@ typedef struct st_mi_status_info my_off_t key_empty; /* lost space in indexfile */ my_off_t key_file_length; my_off_t data_file_length; + ha_checksum checksum; } MI_STATUS_INFO; typedef struct st_mi_state_info @@ -75,7 +76,6 @@ typedef struct st_mi_state_info ulong sec_index_changed; /* Updated when new sec_index */ ulong sec_index_used; /* which extra index are in use */ ulonglong key_map; /* Which keys are in use */ - ha_checksum checksum; ulong version; /* timestamp of create */ time_t create_time; /* Time when created database */ time_t recover_time; /* Time for last recover */ diff --git a/myisam/myisampack.c b/myisam/myisampack.c index 3b091cd6ea2..c68968c83a3 100644 --- a/myisam/myisampack.c +++ b/myisam/myisampack.c @@ -2965,7 +2965,7 @@ static int save_state(MI_INFO *isam_file,PACK_MRG_INFO *mrg,my_off_t new_length, share->state.key_root[key]= HA_OFFSET_ERROR; for (key=0 ; key < share->state.header.max_block_size ; key++) share->state.key_del[key]= HA_OFFSET_ERROR; - share->state.checksum=crc; /* Save crc here */ + isam_file->state->checksum=crc; /* Save crc here */ share->changed=1; /* Force write of header */ share->state.open_count=0; share->global_changed=0; @@ -3001,7 +3001,7 @@ static int save_state_mrg(File file,PACK_MRG_INFO *mrg,my_off_t new_length, state.dellink= HA_OFFSET_ERROR; state.version=(ulong) time((time_t*) 0); mi_clear_all_keys_active(state.key_map); - state.checksum=crc; + state.state.checksum=crc; if (isam_file->s->base.keys) isamchk_neaded=1; state.changed=STATE_CHANGED | STATE_NOT_ANALYZED; /* Force check of table */ diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index d2872878cb9..f68c4805d72 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -73,7 +73,7 @@ Table Create Table user CREATE TABLE `user` ( `Host` char(60) collate utf8_bin NOT NULL default '', `User` char(16) collate utf8_bin NOT NULL default '', - `Password` char(41) collate utf8_bin NOT NULL default '', + `Password` binary(41) NOT NULL default '', `Select_priv` enum('N','Y') character set utf8 NOT NULL default 'N', `Insert_priv` enum('N','Y') character set utf8 NOT NULL default 'N', `Update_priv` enum('N','Y') character set utf8 NOT NULL default 'N', diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 6b88656dd76..02769c1eb31 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -1703,6 +1703,6 @@ int ha_myisam::ft_read(byte * buf) uint ha_myisam::checksum() const { - return (uint)file->s->state.checksum; + return (uint)file->state->checksum; } diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 635b512fe23..dba4168343a 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4074,7 +4074,7 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, HA_CHECK_OPT *check_opt) strxmov(table_name, table->db ,".", table->table_name, NullS); - t= table->table= open_ltable(thd, table, TL_READ_NO_INSERT); + t= table->table= open_ltable(thd, table, TL_READ); thd->clear_error(); // these errors shouldn't get client protocol->prepare_for_resend(); From 06313b18f21166f17d89e8c88ab6329fa2368fb0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Sep 2005 23:36:02 +0400 Subject: [PATCH 140/225] Fix for bug #13501 "build problem: too many arguments to function my_bool acl_init". Updated calls to acl_init()/grant_init() in init_embedded_server() - their signatures were changed recently, now they don't need argument for passing pointer to THD object (this code was only compiled if one built embedded server library with --with-embedded-privilege-control switch). libmysqld/lib_sql.cc: acl_init/grant_init() are now used only at server start up so they always allocate temporary THD object and don't need argument for passing pointer to it. --- libmysqld/lib_sql.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 82e1c19d758..bf8c17a71af 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -427,9 +427,9 @@ int init_embedded_server(int argc, char **argv, char **groups) acl_error= 0; #ifndef NO_EMBEDDED_ACCESS_CHECKS - if (!(acl_error= acl_init((THD *)0, opt_noacl)) && + if (!(acl_error= acl_init(opt_noacl)) && !opt_noacl) - (void) grant_init((THD *)0); + (void) grant_init(); #endif if (acl_error || my_tz_init((THD *)0, default_tz_name, opt_bootstrap)) { From a17b3dcbe3d86eaaaabe627139ed09c35828d61c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Sep 2005 00:58:12 +0400 Subject: [PATCH 141/225] Fix bug#13356 resolve_const_item() wasn't able to handle Item_row items. resolve_const_item() assumed to be not called for Item_row items. For ensuring that DBUG_ASSERT(0) was set there. This patch adds section for Item_row items. If it can it recursively calls resolve_const_item() for each item the Item_row contains. If any of the contained items is null then whole Item_row substitued by Item_null. Otherwise it just returns. sql/item.cc: Fix bug#13356 resolve_const_item() wasn't able to handle Item_row items. Added section to resolve_const_item() for Item_row items. If it can it recursively calls resolve_const_item() for each item the Item_row contains. If any of the contained items is null then Item_row is substituted by Item_null. Otherwise it just returns. Comment moved closer to function it belongs to. mysql-test/t/select.test: Test case for bug#13356 resolve_const_item() wasn't able to handle Item_row items. mysql-test/r/select.result: Test case for bug#13356 resolve_const_item() wasn't able to handle Item_row items. --- mysql-test/r/select.result | 9 +++++++++ mysql-test/t/select.test | 10 ++++++++++ sql/item.cc | 29 +++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 993fe7d22f1..64cbaf4fa67 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2617,3 +2617,12 @@ select found_rows(); found_rows() 1 DROP TABLE t1; +create table t1(f1 int, f2 int); +create table t2(f3 int); +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); +f1 +drop table t1,t2; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index b51ea89c7dd..bdadd5c536b 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2164,4 +2164,14 @@ select found_rows(); DROP TABLE t1; +# +# Bug #13356 assertion failed in resolve_const_item() +# +create table t1(f1 int, f2 int); +create table t2(f3 int); +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); +select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); +drop table t1,t2; + # End of 4.1 tests diff --git a/sql/item.cc b/sql/item.cc index 010189c321c..03ab38fc970 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2870,6 +2870,35 @@ void resolve_const_item(THD *thd, Item **ref, Item *comp_item) new_item= (null_value ? (Item*) new Item_null(name) : (Item*) new Item_int(name, result, length)); } + else if (res_type == ROW_RESULT) + { + new_item= 0; + /* + If item and comp_item are both Item_rows and have same number of cols + then process items in Item_row one by one. If Item_row contain nulls + substitute it by Item_null. Otherwise just return. + */ + if (item->result_type() == comp_item->result_type() && + ((Item_row*)item)->cols() == ((Item_row*)comp_item)->cols()) + { + Item_row *item_row= (Item_row*)item,*comp_item_row= (Item_row*)comp_item; + if (item_row->null_inside()) + new_item= (Item*) new Item_null(name); + else + { + int i= item_row->cols() - 1; + for (; i >= 0; i--) + { + if (item_row->maybe_null && item_row->el(i)->is_null()) + { + new_item= (Item*) new Item_null(name); + break; + } + resolve_const_item(thd, item_row->addr(i), comp_item_row->el(i)); + } + } + } + } else { // It must REAL_RESULT double result=item->val(); From 1a49a7a1d08fe369b362d1fa0682c029a031c64a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Sep 2005 11:14:25 +0300 Subject: [PATCH 142/225] InnoDB: Print better error message when log files are missing/corrupt (bug #13497). innobase/buf/buf0buf.c: Print better error message when log files are missing/corrupt. --- innobase/buf/buf0buf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c index aa3aef7f97c..3a3b64dd51b 100644 --- a/innobase/buf/buf0buf.c +++ b/innobase/buf/buf0buf.c @@ -321,7 +321,9 @@ buf_page_is_corrupted( fprintf(stderr, " InnoDB: Error: page %lu log sequence number %lu %lu\n" "InnoDB: is in the future! Current system log sequence number %lu %lu.\n" -"InnoDB: Your database may be corrupt.\n", +"InnoDB: Your database may be corrupt or you may have copied the InnoDB\n" +"InnoDB: tablespace but not the InnoDB log files. See\n" +"http://dev.mysql.com/doc/mysql/en/backing-up.html for more information.\n", (ulong) mach_read_from_4(read_buf + FIL_PAGE_OFFSET), (ulong) ut_dulint_get_high( mach_read_from_8(read_buf + FIL_PAGE_LSN)), From d33ce6f5f482d7538a06cf88ee2c4b345ce412cf Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Sep 2005 11:58:34 +0200 Subject: [PATCH 143/225] ndb - bug#13512 core dump on no free node id ndb/tools/restore/consumer_restore.cpp: return correct value --- ndb/tools/restore/consumer_restore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/tools/restore/consumer_restore.cpp b/ndb/tools/restore/consumer_restore.cpp index 5786bdac697..552246a4f9e 100644 --- a/ndb/tools/restore/consumer_restore.cpp +++ b/ndb/tools/restore/consumer_restore.cpp @@ -38,7 +38,7 @@ BackupRestore::init() m_cluster_connection = new Ndb_cluster_connection(g_connect_string); if(m_cluster_connection->connect(12, 5, 1) != 0) { - return -1; + return false; } m_ndb = new Ndb(m_cluster_connection); From e57abdc754d9e280dfeeb722461a3a0184aa935c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Sep 2005 14:12:44 +0300 Subject: [PATCH 144/225] Added a cast. Fix for Metrowerks compiler. --- strings/decimal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/decimal.c b/strings/decimal.c index 7816f340eef..ce00b9770b3 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -1033,7 +1033,7 @@ int decimal2ulonglong(decimal_t *from, ulonglong *to) { ulonglong y=x; x=x*DIG_BASE + *buf++; - if (unlikely(y > (ULONGLONG_MAX/DIG_BASE) || x < y)) + if (unlikely(y > ((ulonglong) ULONGLONG_MAX/DIG_BASE) || x < y)) { *to=y; return E_DEC_OVERFLOW; From 2de206b4eee3033a590cb337ffd86c89df678b4c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Sep 2005 14:14:49 +0300 Subject: [PATCH 145/225] Fixed a bug checksum table locks the InnoDB table and does not use a consistent read (Bug #12669). mysql-test/r/innodb.result: Added test results for a checksum test. mysql-test/t/innodb.test: Added test case for a checksum bug #12669. sql/ha_innodb.cc: Use consistent read for checksum table and convert MySQL lock type to the TL_READ because at the moment MySQL uses TL_READ_NO_INSERT. --- mysql-test/r/innodb.result | 28 ++++++++++++++++++++++++++ mysql-test/t/innodb.test | 41 ++++++++++++++++++++++++++++++++++++++ sql/ha_innodb.cc | 7 +++++++ 3 files changed, 76 insertions(+) diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index c7aef8ed792..ca78d23e6dc 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1694,3 +1694,31 @@ select min(b) from t1 where a='8'; min(b) 6 drop table t1; +create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into test_checksum values (1),(2); +set autocommit=0; +checksum table test_checksum; +Table Checksum +test.test_checksum 1531596814 +insert into test_checksum values(3); +checksum table test_checksum; +Table Checksum +test.test_checksum 1531596814 +commit; +checksum table test_checksum; +Table Checksum +test.test_checksum 2050879373 +commit; +drop table test_checksum; +create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into test_checksum values (1),(2); +set autocommit=1; +checksum table test_checksum; +Table Checksum +test.test_checksum 1531596814 +set autocommit=1; +insert into test_checksum values(3); +checksum table test_checksum; +Table Checksum +test.test_checksum 2050879373 +drop table test_checksum; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index b966ea5b281..3a693968769 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1239,4 +1239,45 @@ insert into t1 values ('8', '6'), ('4', '7'); select min(a) from t1; select min(b) from t1 where a='8'; drop table t1; + +# +# Test that checksum table uses a consistent read Bug #12669 +# +connect (a,localhost,root,,); +connect (b,localhost,root,,); +connection a; +create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into test_checksum values (1),(2); +set autocommit=0; +checksum table test_checksum; +connection b; +insert into test_checksum values(3); +connection a; +# +# Here checksum should not see insert +# +checksum table test_checksum; +connection a; +commit; +checksum table test_checksum; +commit; +drop table test_checksum; +# +# autocommit = 1 +# +connection a; +create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into test_checksum values (1),(2); +set autocommit=1; +checksum table test_checksum; +connection b; +set autocommit=1; +insert into test_checksum values(3); +connection a; +# +# Here checksum sees insert +# +checksum table test_checksum; +drop table test_checksum; + # End of 4.1 tests diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index b30ddfe8227..1312b645017 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -5421,6 +5421,13 @@ ha_innobase::store_lock( prebuilt->select_lock_type = LOCK_NONE; prebuilt->stored_select_lock_type = LOCK_NONE; + } else if (thd->lex->sql_command == SQLCOM_CHECKSUM) { + /* Use consistent read for checksum table and + convert lock type to the TL_READ */ + + prebuilt->select_lock_type = LOCK_NONE; + prebuilt->stored_select_lock_type = LOCK_NONE; + lock.type = TL_READ; } else { prebuilt->select_lock_type = LOCK_S; prebuilt->stored_select_lock_type = LOCK_S; From a11fc7341cadf393ed3378c9a113ca606dc297ed Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Sep 2005 14:26:33 +0300 Subject: [PATCH 146/225] InnoDB: Remove compiler warnings. innobase/os/os0proc.c: Add UT_NOT_USED for parameters in dummy implementations of AWE functions. sql/ha_innodb.cc: Tweak casts to eliminate compiler warnings. --- innobase/os/os0proc.c | 9 +++++++++ sql/ha_innodb.cc | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/innobase/os/os0proc.c b/innobase/os/os0proc.c index 167aed93de7..24bb007e504 100644 --- a/innobase/os/os0proc.c +++ b/innobase/os/os0proc.c @@ -292,6 +292,9 @@ os_awe_allocate_physical_mem( return(TRUE); #else + UT_NOT_USED(n_megabytes); + UT_NOT_USED(page_info); + return(FALSE); #endif } @@ -349,6 +352,8 @@ os_awe_allocate_virtual_mem_window( return(ptr); #else + UT_NOT_USED(size); + return(NULL); #endif } @@ -476,6 +481,10 @@ os_awe_map_physical_mem_to_window( return(TRUE); #else + UT_NOT_USED(ptr); + UT_NOT_USED(n_mem_pages); + UT_NOT_USED(page_info); + return(FALSE); #endif } diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 69c20bb7974..afa8570c144 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2116,7 +2116,7 @@ innobase_rollback_to_savepoint( /* TODO: use provided savepoint data area to store savepoint data */ - longlong2str((ulonglong)savepoint, name, 36); + longlong2str((ulint)savepoint, name, 36); error = (int) trx_rollback_to_savepoint_for_mysql(trx, name, &mysql_binlog_cache_pos); @@ -2145,7 +2145,7 @@ innobase_release_savepoint( /* TODO: use provided savepoint data area to store savepoint data */ - longlong2str((ulonglong)savepoint, name, 36); + longlong2str((ulint)savepoint, name, 36); error = (int) trx_release_savepoint_for_mysql(trx, name); @@ -2186,7 +2186,7 @@ innobase_savepoint( /* TODO: use provided savepoint data area to store savepoint data */ char name[64]; - longlong2str((ulonglong)savepoint,name,36); + longlong2str((ulint)savepoint,name,36); error = (int) trx_savepoint_for_mysql(trx, name, (ib_longlong)0); From b4d738e71116241c1edddc10612de18ab984b871 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Sep 2005 13:29:13 +0200 Subject: [PATCH 147/225] Correct merge error, warning ended up after new tests from 4.1 mysql-test/r/cast.result: Move the warning to corecct place --- mysql-test/r/cast.result | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index cecc9c07130..fa8e810cf2b 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -72,6 +72,8 @@ Warning 1292 Truncated incorrect CHAR(4) value: '2004-01-22 21:45:33' select CAST(DATE "2004-01-22 21:45:33" AS BINARY(4)); CAST(DATE "2004-01-22 21:45:33" AS BINARY(4)) 2004 +Warnings: +Warning 1292 Truncated incorrect CHAR(4) value: '2004-01-22 21:45:33' select CAST(0xb3 as signed); CAST(0xb3 as signed) 179 @@ -84,8 +86,6 @@ CAST(0xffffffffffffffff as unsigned) select CAST(0xfffffffffffffffe as signed); CAST(0xfffffffffffffffe as signed) -2 -Warnings: -Warning 1292 Truncated incorrect CHAR(4) value: '2004-01-22 21:45:33' select cast('-10a' as signed integer); cast('-10a' as signed integer) -10 From 86856939c4ba9f786541e2293de897086517caf0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Sep 2005 13:39:28 +0200 Subject: [PATCH 148/225] mysql_config.sh: Added -lz to link using libmysqld scripts/mysql_config.sh: Added -lz to link using libmysqld --- scripts/mysql_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 15b45391ef8..5b35c0190a5 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -101,7 +101,7 @@ libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@" libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` cflags="-I$pkgincludedir @CFLAGS@ " #note: end space! include="-I$pkgincludedir" -embedded_libs="$ldflags -L$pkglibdir -lmysqld @LIBS@ @WRAPLIBS@ @innodb_system_libs@ $client_libs" +embedded_libs="$ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@" embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` # Remove some options that a client doesn't have to care about From e3d7877f4b522c8f735d8fdf8ba626d722b0506c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Sep 2005 18:43:46 +0400 Subject: [PATCH 149/225] Fix for bug #13546 "Build errors with --with-embedded-server --with-embedded-privilege-control options". One more (hopefully last) build failure which was introduced during work on WL#2787 "Add view definer/owner to the view definition..." libmysqld/lib_sql.cc: create_embedded_thd()/check_embedded_connection(): Several security related THD members (user, host, ip, priv_user, ...) have moved to the Security_context class. New THD::security_ctx member points to active security context. sql/sql_acl.cc: acl_getroot(): Updated function description to refelect the fact that THD::user/host/ip/... members were moved to separate Security_context class. sql/sql_parse.cc: check_user(): Updated function description to refelect the fact that THD::user/host/ip/... members were moved to separate Security_context class. --- libmysqld/lib_sql.cc | 17 +++++++++-------- sql/sql_acl.cc | 4 ++-- sql/sql_parse.cc | 6 +++--- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 5e621bf4419..8552b1c2b8a 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -514,8 +514,8 @@ void *create_embedded_thd(int client_flag, char *db) thd->db= db; thd->db_length= db ? strip_sp(db) : 0; #ifndef NO_EMBEDDED_ACCESS_CHECKS - thd->db_access= DB_ACLS; - thd->master_access= ~NO_ACCESS; + thd->security_ctx->db_access= DB_ACLS; + thd->security_ctx->master_access= ~NO_ACCESS; #endif thd->net.query_cache_query= 0; @@ -542,26 +542,27 @@ int check_embedded_connection(MYSQL *mysql) int check_embedded_connection(MYSQL *mysql) { THD *thd= (THD*)mysql->thd; + Security_context *sctx= thd->security_ctx; int result; char scramble_buff[SCRAMBLE_LENGTH]; int passwd_len; if (mysql->options.client_ip) { - thd->host= my_strdup(mysql->options.client_ip, MYF(0)); - thd->ip= my_strdup(thd->host, MYF(0)); + sctx->host= my_strdup(mysql->options.client_ip, MYF(0)); + sctx->ip= my_strdup(sctx->host, MYF(0)); } else - thd->host= (char*)my_localhost; - thd->host_or_ip= thd->host; + sctx->host= (char*)my_localhost; + sctx->host_or_ip= sctx->host; - if (acl_check_host(thd->host,thd->ip)) + if (acl_check_host(sctx->host, sctx->ip)) { result= ER_HOST_NOT_PRIVILEGED; goto err; } - thd->user= my_strdup(mysql->user, MYF(0)); + sctx->user= my_strdup(mysql->user, MYF(0)); if (mysql->passwd && mysql->passwd[0]) { memset(thd->scramble, 55, SCRAMBLE_LENGTH); // dummy scramble diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index bb182232e0d..771cb93ed9c 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -693,8 +693,8 @@ static int acl_compare(ACL_ACCESS *a,ACL_ACCESS *b) SYNOPSIS acl_getroot() thd thread handle. If all checks are OK, - thd->priv_user, thd->master_access are updated. - thd->host, thd->ip, thd->user are used for checks. + thd->security_ctx->priv_user/master_access are updated. + thd->security_ctx->host/ip/user are used for checks. mqh user resources; on success mqh is reset, else unchanged passwd scrambled & crypted password, received from client diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index a5faff5cf61..46740460526 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -246,7 +246,7 @@ end: SYNOPSIS check_user() - thd thread handle, thd->{host,user,ip} are used + thd thread handle, thd->security_ctx->{host,user,ip} are used command originator of the check: now check_user is called during connect and change user procedures; used for logging. @@ -261,8 +261,8 @@ end: are 'IN'. RETURN VALUE - 0 OK; thd->user, thd->master_access, thd->priv_user, thd->db and - thd->db_access are updated; OK is sent to client; + 0 OK; thd->security_ctx->user/master_access/priv_user/db_access and + thd->db are updated; OK is sent to client; -1 access denied or handshake error; error is sent to client; >0 error, not sent to client */ From ea599a00327419e832d6baa1a40a0f1941d194a0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Sep 2005 08:04:08 -0700 Subject: [PATCH 150/225] BUG #13511 Wrong patch pushed, fixing. BUILD/SETUP.sh: BUG #13511, wrong patch pushed, fixing. --- BUILD/SETUP.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index c86687bf03b..d9d92137817 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -10,7 +10,7 @@ prefix_configs="--prefix=/usr/local/mysql" just_print= just_configure= full_debug= -if test ! -z $MYSQL_BUILD_PREFIX +if test -n "$MYSQL_BUILD_PREFIX" then prefix_configs="--prefix=$MYSQL_BUILD_PREFIX" fi From 0fda286a415777e755d4bc076d4d35f27c071219 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Sep 2005 21:30:10 +0400 Subject: [PATCH 151/225] select.result, item.cc: After merge fix for bug#13356 sql/item.cc: After merge fix for bug#13356 mysql-test/r/select.result: After merge fix for bug#13356 --- mysql-test/r/select.result | 18 +++++++++--------- sql/item.cc | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index e9cfd900531..43a8f7f7615 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2620,6 +2620,15 @@ select found_rows(); found_rows() 1 DROP TABLE t1; +create table t1(f1 int, f2 int); +create table t2(f3 int); +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); +f1 +drop table t1,t2; CREATE TABLE t1 ( city char(30) ); INSERT INTO t1 VALUES ('London'); INSERT INTO t1 VALUES ('Paris'); @@ -3029,12 +3038,3 @@ id 102 drop table t1, t2; drop view v1, v2, v3; -create table t1(f1 int, f2 int); -create table t2(f3 int); -select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); -f1 -select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); -f1 -select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); -f1 -drop table t1,t2; diff --git a/sql/item.cc b/sql/item.cc index 0d8dcc8d112..9b49a47a989 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -5255,6 +5255,7 @@ void resolve_const_item(THD *thd, Item **ref, Item *comp_item) } } } + break; } case REAL_RESULT: { // It must REAL_RESULT @@ -5276,7 +5277,6 @@ void resolve_const_item(THD *thd, Item **ref, Item *comp_item) (Item*) new Item_decimal(name, result, length, decimals)); break; } - case ROW_RESULT: default: DBUG_ASSERT(0); } From 9de4fa45f9c533b33af95748c8ae2e1acd83d3ba Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Sep 2005 19:54:55 +0200 Subject: [PATCH 152/225] ndb - printSchemaFile: more checks and options ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp: more checks and options --- .../kernel/blocks/dbdict/printSchemaFile.cpp | 168 ++++++++++++------ 1 file changed, 117 insertions(+), 51 deletions(-) diff --git a/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp b/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp index b9b144cd977..f73654fd9d5 100644 --- a/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp +++ b/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp @@ -1,14 +1,3 @@ -#if 0 -make -f Makefile -f - printSchemaFile <<'_eof_' -printSchemaFile: printSchemaFile.cpp SchemaFile.hpp - $(CXXCOMPILE) -o $@ $@.cpp -L../../../common/util/.libs -lgeneral -ifneq ($(MYSQL_HOME),) - ln -sf `pwd`/$@ $(MYSQL_HOME)/bin/$@ -endif -_eof_ -exit $? -#endif - /* Copyright (C) 2003 MySQL AB This program is free software; you can redistribute it and/or modify @@ -36,14 +25,19 @@ exit $? static const char* progname = 0; static bool allflag = false; static bool checkonly = false; -static int xitcode = 0; +static bool equalcontents = false; +static bool okquiet = false; static void usage() { - ndbout << "Usage " << progname - << " [-ac]" - << " P0.SchemaLog" << endl; + ndbout + << "Usage: " << progname << " [-aceq]" << " file ..." << endl + << "-a print also unused slots" << endl + << "-c check only (return status 1 on error)" << endl + << "-e check also that the files have identical contents" << endl + << "-q no output if file is ok" << endl + << "Example: " << progname << " -ceq ndb_*_fs/D[12]/DBDICT/P0.SchemaLog" << endl; } static void @@ -57,52 +51,78 @@ fill(const char * buf, int mod) } } -static void +static const char* +version(Uint32 v) +{ + static char buf[40]; + sprintf(buf, "%d.%d.%d", v >> 16, (v >> 8) & 0xFF, v & 0xFF); + return buf; +} + +static int print_head(const char * filename, const SchemaFile * sf) { + int retcode = 0; + if (! checkonly) { ndbout << "----- Schemafile: " << filename << " -----" << endl; - ndbout_c("Magic: %.*s ByteOrder: %.8x NdbVersion: %d.%d.%d FileSize: %d", + ndbout_c("Magic: %.*s ByteOrder: %.8x NdbVersion: %s FileSize: %d", sizeof(sf->Magic), sf->Magic, sf->ByteOrder, - sf->NdbVersion >> 16, - (sf->NdbVersion >> 8) & 0xFF, - sf->NdbVersion & 0xFF, + version(sf->NdbVersion), sf->FileSize); } + + if (memcmp(sf->Magic, "NDBSCHMA", sizeof(sf->Magic) != 0)) { + ndbout << filename << ": invalid header magic" << endl; + retcode = 1; + } + + if ((sf->NdbVersion >> 16) < 4 || (sf->NdbVersion >> 16) > 9) { + ndbout << filename << ": impossible version " << hex << sf->NdbVersion << endl; + retcode = 1; + } + + return retcode; } -static void -print_old(const char * filename, const SchemaFile * sf) +static int +print_old(const char * filename, const SchemaFile * sf, Uint32 sz) { - print_head(filename, sf); + int retcode = 0; + + if (print_head(filename, sf) != 0) + retcode = 1; for (Uint32 i = 0; i < sf->NoOfTableEntries; i++) { SchemaFile::TableEntry_old te = sf->TableEntries_old[i]; if (allflag || (te.m_tableState != SchemaFile::INIT && te.m_tableState != SchemaFile::DROP_TABLE_COMMITTED)) { - ndbout << "Table " << i << ":" - << " State = " << te.m_tableState - << " version = " << te.m_tableVersion - << " type = " << te.m_tableType - << " noOfPages = " << te.m_noOfPages - << " gcp: " << te.m_gcp << endl; + if (! checkonly) + ndbout << "Table " << i << ":" + << " State = " << te.m_tableState + << " version = " << te.m_tableVersion + << " type = " << te.m_tableType + << " noOfPages = " << te.m_noOfPages + << " gcp: " << te.m_gcp << endl; } } + return retcode; } -static void +static int print(const char * filename, const SchemaFile * xsf, Uint32 sz) { int retcode = 0; - print_head(filename, xsf); + if (print_head(filename, xsf) != 0) + retcode = 1; assert(sizeof(SchemaFile) == NDB_SF_PAGE_SIZE); if (xsf->FileSize != sz || xsf->FileSize % NDB_SF_PAGE_SIZE != 0) { - ndbout << "***** invalid FileSize " << xsf->FileSize << endl; + ndbout << filename << ": invalid FileSize " << xsf->FileSize << endl; retcode = 1; } Uint32 noOfPages = xsf->FileSize / NDB_SF_PAGE_SIZE; @@ -111,19 +131,23 @@ print(const char * filename, const SchemaFile * xsf, Uint32 sz) ndbout << "----- Page: " << n << " (" << noOfPages << ") -----" << endl; } const SchemaFile * sf = &xsf[n]; + if (memcmp(sf->Magic, xsf->Magic, sizeof(sf->Magic)) != 0) { + ndbout << filename << ": page " << n << " invalid magic" << endl; + retcode = 1; + } if (sf->FileSize != xsf->FileSize) { - ndbout << "***** page " << n << " FileSize changed to " << sf->FileSize << "!=" << xsf->FileSize << endl; + ndbout << filename << ": page " << n << " FileSize changed to " << sf->FileSize << "!=" << xsf->FileSize << endl; retcode = 1; } Uint32 cs = 0; for (Uint32 j = 0; j < NDB_SF_PAGE_SIZE_IN_WORDS; j++) cs ^= ((const Uint32*)sf)[j]; if (cs != 0) { - ndbout << "***** page " << n << " invalid CheckSum" << endl; + ndbout << filename << ": page " << n << " invalid CheckSum" << endl; retcode = 1; } if (sf->NoOfTableEntries != NDB_SF_PAGE_ENTRIES) { - ndbout << "***** page " << n << " invalid NoOfTableEntries " << sf->NoOfTableEntries << endl; + ndbout << filename << ": page " << n << " invalid NoOfTableEntries " << sf->NoOfTableEntries << endl; retcode = 1; } for (Uint32 i = 0; i < NDB_SF_PAGE_ENTRIES; i++) { @@ -141,31 +165,41 @@ print(const char * filename, const SchemaFile * xsf, Uint32 sz) << " gcp: " << te.m_gcp << endl; } if (te.m_unused[0] != 0 || te.m_unused[1] != 0 || te.m_unused[2] != 0) { - ndbout << "***** entry " << j << " garbage in m_unused[3]" << endl; + ndbout << filename << ": entry " << j << " garbage in m_unused[3]" << endl; retcode = 1; } } } - if (retcode != 0) - xitcode = 1; - else if (checkonly) - ndbout << "ok: " << filename << endl; + return retcode; } NDB_COMMAND(printSchemafile, "printSchemafile", "printSchemafile", "Prints a schemafile", 16384) { progname = argv[0]; + int exitcode = 0; - while (argv[1][0] == '-') { + while (argc > 1 && argv[1][0] == '-') { if (strchr(argv[1], 'a') != 0) allflag = true; if (strchr(argv[1], 'c') != 0) checkonly = true; + if (strchr(argv[1], 'e') != 0) + equalcontents = true; + if (strchr(argv[1], 'q') != 0) + okquiet = true; + if (strchr(argv[1], 'h') != 0 || strchr(argv[1], '?') != 0) { + usage(); + return 0; + } argc--, argv++; } + const char * prevfilename = 0; + Uint32 * prevbuf = 0; + Uint32 prevbytes = 0; + while (argc > 1) { const char * filename = argv[1]; argc--, argv++; @@ -173,8 +207,9 @@ NDB_COMMAND(printSchemafile, struct stat sbuf; const int res = stat(filename, &sbuf); if (res != 0) { - ndbout << "Could not find file: \"" << filename << "\"" << endl; - return 1; + ndbout << filename << ": not found errno=" << errno << endl; + exitcode = 1; + continue; } const Uint32 bytes = sbuf.st_size; @@ -182,25 +217,56 @@ NDB_COMMAND(printSchemafile, FILE * f = fopen(filename, "rb"); if (f == 0) { - ndbout << "Failed to open file" << endl; + ndbout << filename << ": open failed errno=" << errno << endl; delete [] buf; - return 1; + exitcode = 1; + continue; } Uint32 sz = fread(buf, 1, bytes, f); fclose(f); if (sz != bytes) { - ndbout << "Failure while reading file" << endl; + ndbout << filename << ": read failed errno=" << errno << endl; delete [] buf; - return 1; + exitcode = 1; + continue; + } + + if (sz < 32) { + ndbout << filename << ": too short (no header)" << endl; + delete [] buf; + exitcode = 1; + continue; } SchemaFile* sf = (SchemaFile *)&buf[0]; + int ret; if (sf->NdbVersion < NDB_SF_VERSION_5_0_6) - print_old(filename, sf); + ret = print_old(filename, sf, sz); else - print(filename, sf, sz); - delete [] buf; + ret = print(filename, sf, sz); + + if (ret != 0) { + ndbout << filename << ": check failed" + << " version=" << version(sf->NdbVersion) << endl; + exitcode = 1; + } else if (! okquiet) { + ndbout << filename << ": ok" + << " version=" << version(sf->NdbVersion) << endl; + } + + if (equalcontents && prevfilename != 0) { + if (prevbytes != bytes || memcmp(prevbuf, buf, bytes) != 0) { + ndbout << filename << ": differs from " << prevfilename << endl; + exitcode = 1; + } + } + + prevfilename = filename; + delete [] prevbuf; + prevbuf = buf; + prevbytes = bytes; } - return xitcode; + delete [] prevbuf; + return exitcode; } From 51361adaf6be15f404dd0e0c6988cd6a41d7c5ed Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Sep 2005 23:04:35 +0200 Subject: [PATCH 153/225] - compile fix: don't use C++ - style comments in .c files! --- client/mysqltest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index eef9a7d50af..e28ec503d89 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -4081,7 +4081,7 @@ int main(int argc, char **argv) } else { - // Print the result to stdout + /* Print the result to stdout */ printf("%s", ds_res.str); } } From 21f6b1a10c3ecf24e296eba8181794290f2b957b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Sep 2005 23:24:44 +0200 Subject: [PATCH 154/225] mysql-test-run.pl: Pass on all --skip-* to mysqld mysql-test/mysql-test-run.pl: Pass on all --skip-* to mysqld --- mysql-test/mysql-test-run.pl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 66c92151ea4..bd71d89298d 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -467,6 +467,7 @@ sub command_line_setup () { # Read the command line # Note: Keep list, and the order, in sync with usage at end of this file + Getopt::Long::Configure("pass_through"); GetOptions( # Control what engine/variation to run 'embedded-server' => \$opt_embedded_server, @@ -554,7 +555,21 @@ sub command_line_setup () { usage(""); } - @opt_cases= @ARGV; + foreach my $arg ( @ARGV ) + { + if ( $arg =~ /^--skip-/ ) + { + push(@opt_extra_mysqld_opt, $arg); + } + elsif ( $arg =~ /^-/ ) + { + usage("Invalid option \"$arg\""); + } + else + { + push(@opt_cases, $arg); + } + } # -------------------------------------------------------------------------- # Set the "var/" directory, as it is the base for everything else From 5e26e3f42924cb3bf7961d6a0931eca405b1f631 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Sep 2005 23:52:10 +0200 Subject: [PATCH 155/225] mysql-test-run.pl: Append to some of the log files, not overwrite. Changed introduction text to reflect the current status of the Perl version of mysql-test-run. Some code cleanup. mysql-test/mysql-test-run.pl: Append to some of the log files, not overwrite. Changed introduction text to reflect the current status of the Perl version of mysql-test-run. Some code cleanup. --- mysql-test/mysql-test-run.pl | 135 ++++++++++++++++++++--------------- 1 file changed, 76 insertions(+), 59 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index bd71d89298d..be0c9b66f71 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2,37 +2,35 @@ # -*- cperl -*- # This is a transformation of the "mysql-test-run" Bourne shell script -# to Perl. This is just an intermediate step, the goal is to rewrite -# the Perl script to C. The complexity of the mysql-test-run script -# makes it a bit hard to write and debug it as a C program directly, -# so this is considered a prototype. +# to Perl. There are reasons this rewrite is not the prettiest Perl +# you have seen # -# Because of this the Perl coding style may in some cases look a bit -# funny. The rules used are +# - The original script is huge and for most part uncommented, +# not even a usage description of the flags. # -# - The coding style is as close as possible to the C/C++ MySQL -# coding standard. +# - There has been an attempt to write a replacement in C for the +# original Bourne shell script. It was kind of working but lacked +# lot of functionality to really be a replacement. Not to redo +# that mistake and catch all the obscure features of the original +# script, the rewrite in Perl is more close to the original script +# meaning it also share some of the ugly parts as well. # -# - Where NULL is to be returned, the undefined value is used. +# - The original intention was that this script was to be a prototype +# to be the base for a new C version with full functionality. Since +# then it was decided that the Perl version should replace the +# Bourne shell version, but the Perl style still reflects the wish +# to make the Perl to C step easy. # -# - Regexp comparisons are simple and can be translated to strcmp -# and other string functions. To ease this transformation matching -# is done in the lib "lib/mtr_match.pl", i.e. regular expressions -# should be avoided in the main program. +# Some coding style from the original intent has been kept # -# - The "unless" construct is not to be used. It is the same as "if !". -# -# - opendir/readdir/closedir is used instead of glob()/<*>. +# - To make this Perl script easy to alter even for those that not +# code Perl that often, the coding style is as close as possible to +# the C/C++ MySQL coding standard. # # - All lists of arguments to send to commands are Perl lists/arrays, # not strings we append args to. Within reason, most string # concatenation for arguments should be avoided. # -# - sprintf() is to be used, within reason, for all string creation. -# This mtr_add_arg() function is also based on sprintf(), i.e. you -# use a format string and put the variable argument in the argument -# list. -# # - Functions defined in the main program are not to be prefixed, # functions in "library files" are to be prefixed with "mtr_" (for # Mysql-Test-Run). There are some exceptions, code that fits best in @@ -758,47 +756,62 @@ sub command_line_setup () { # Put this into a hash, will be a C struct - $master->[0]->{'path_myddir'}= "$opt_vardir/master-data"; - $master->[0]->{'path_myerr'}= "$opt_vardir/log/master.err"; - $master->[0]->{'path_mylog'}= "$opt_vardir/log/master.log"; - $master->[0]->{'path_mypid'}= "$opt_vardir/run/master.pid"; - $master->[0]->{'path_mysock'}= "$opt_tmpdir/master.sock"; - $master->[0]->{'path_myport'}= $opt_master_myport; - $master->[0]->{'start_timeout'}= 400; # enough time create innodb tables + $master->[0]= + { + path_myddir => "$opt_vardir/master-data", + path_myerr => "$opt_vardir/log/master.err", + path_mylog => "$opt_vardir/log/master.log", + path_mypid => "$opt_vardir/run/master.pid", + path_mysock => "$opt_tmpdir/master.sock", + path_myport => $opt_master_myport, + start_timeout => 400, # enough time create innodb tables - $master->[0]->{'ndbcluster'}= 1; # ndbcluster not started + ndbcluster => 1, # ndbcluster not started + }; - $master->[1]->{'path_myddir'}= "$opt_vardir/master1-data"; - $master->[1]->{'path_myerr'}= "$opt_vardir/log/master1.err"; - $master->[1]->{'path_mylog'}= "$opt_vardir/log/master1.log"; - $master->[1]->{'path_mypid'}= "$opt_vardir/run/master1.pid"; - $master->[1]->{'path_mysock'}= "$opt_tmpdir/master1.sock"; - $master->[1]->{'path_myport'}= $opt_master_myport + 1; - $master->[1]->{'start_timeout'}= 400; # enough time create innodb tables + $master->[1]= + { + path_myddir => "$opt_vardir/master1-data", + path_myerr => "$opt_vardir/log/master1.err", + path_mylog => "$opt_vardir/log/master1.log", + path_mypid => "$opt_vardir/run/master1.pid", + path_mysock => "$opt_tmpdir/master1.sock", + path_myport => $opt_master_myport + 1, + start_timeout => 400, # enough time create innodb tables + }; - $slave->[0]->{'path_myddir'}= "$opt_vardir/slave-data"; - $slave->[0]->{'path_myerr'}= "$opt_vardir/log/slave.err"; - $slave->[0]->{'path_mylog'}= "$opt_vardir/log/slave.log"; - $slave->[0]->{'path_mypid'}= "$opt_vardir/run/slave.pid"; - $slave->[0]->{'path_mysock'}= "$opt_tmpdir/slave.sock"; - $slave->[0]->{'path_myport'}= $opt_slave_myport; - $slave->[0]->{'start_timeout'}= 400; + $slave->[0]= + { + path_myddir => "$opt_vardir/slave-data", + path_myerr => "$opt_vardir/log/slave.err", + path_mylog => "$opt_vardir/log/slave.log", + path_mypid => "$opt_vardir/run/slave.pid", + path_mysock => "$opt_tmpdir/slave.sock", + path_myport => $opt_slave_myport, + start_timeout => 400, + }; - $slave->[1]->{'path_myddir'}= "$opt_vardir/slave1-data"; - $slave->[1]->{'path_myerr'}= "$opt_vardir/log/slave1.err"; - $slave->[1]->{'path_mylog'}= "$opt_vardir/log/slave1.log"; - $slave->[1]->{'path_mypid'}= "$opt_vardir/run/slave1.pid"; - $slave->[1]->{'path_mysock'}= "$opt_tmpdir/slave1.sock"; - $slave->[1]->{'path_myport'}= $opt_slave_myport + 1; - $slave->[1]->{'start_timeout'}= 300; + $slave->[1]= + { + path_myddir => "$opt_vardir/slave1-data", + path_myerr => "$opt_vardir/log/slave1.err", + path_mylog => "$opt_vardir/log/slave1.log", + path_mypid => "$opt_vardir/run/slave1.pid", + path_mysock => "$opt_tmpdir/slave1.sock", + path_myport => $opt_slave_myport + 1, + start_timeout => 300, + }; - $slave->[2]->{'path_myddir'}= "$opt_vardir/slave2-data"; - $slave->[2]->{'path_myerr'}= "$opt_vardir/log/slave2.err"; - $slave->[2]->{'path_mylog'}= "$opt_vardir/log/slave2.log"; - $slave->[2]->{'path_mypid'}= "$opt_vardir/run/slave2.pid"; - $slave->[2]->{'path_mysock'}= "$opt_tmpdir/slave2.sock"; - $slave->[2]->{'path_myport'}= $opt_slave_myport + 2; - $slave->[2]->{'start_timeout'}= 300; + $slave->[2]= + { + path_myddir => "$opt_vardir/slave2-data", + path_myerr => "$opt_vardir/log/slave2.err", + path_mylog => "$opt_vardir/log/slave2.log", + path_mypid => "$opt_vardir/run/slave2.pid", + path_mysock => "$opt_tmpdir/slave2.sock", + path_myport => $opt_slave_myport + 2, + start_timeout => 300, + }; if ( $opt_extern ) { @@ -1971,7 +1984,9 @@ sub mysqld_start ($$$$) { { if ( $pid= mtr_spawn($exe, $args, "", $master->[$idx]->{'path_myerr'}, - $master->[$idx]->{'path_myerr'}, "") ) + $master->[$idx]->{'path_myerr'}, + "", + { append_log_file => 1 }) ) { return sleep_until_file_created($master->[$idx]->{'path_mypid'}, $master->[$idx]->{'start_timeout'}, $pid); @@ -1982,7 +1997,9 @@ sub mysqld_start ($$$$) { { if ( $pid= mtr_spawn($exe, $args, "", $slave->[$idx]->{'path_myerr'}, - $slave->[$idx]->{'path_myerr'}, "") ) + $slave->[$idx]->{'path_myerr'}, + "", + { append_log_file => 1 }) ) { return sleep_until_file_created($slave->[$idx]->{'path_mypid'}, $master->[$idx]->{'start_timeout'}, $pid); From e42572f5f85364b8c4e87f73a2a724723e12168b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Sep 2005 23:53:31 +0200 Subject: [PATCH 156/225] mtr_process.pl: Append to some of the log files, not overwrite mysql-test/lib/mtr_process.pl: Append to some of the log files, not overwrite --- mysql-test/lib/mtr_process.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index 9176a246835..177665cf578 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -680,7 +680,8 @@ sub mtr_mysqladmin_shutdown { mtr_add_arg($args, "shutdown"); # We don't wait for termination of mysqladmin my $pid= mtr_spawn($::exe_mysqladmin, $args, - "", $::path_manager_log, $::path_manager_log, ""); + "", $::path_manager_log, $::path_manager_log, "", + { append_log_file => 1 }); $mysql_admin_pids{$pid}= 1; } From 72340d672d573d21871b385b8ca5edd29e839a9b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Sep 2005 02:08:24 +0200 Subject: [PATCH 157/225] Many files: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. my_regex.h: Rename: regex/regex.h -> regex/my_regex.h client/mysqltest.c: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. os2/MySQL-Source.icc: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. regex/Makefile.am: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. regex/debug.c: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. regex/debug.ih: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. regex/engine.c: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. regex/engine.ih: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. regex/main.c: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. regex/main.ih: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. regex/regcomp.c: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. regex/regerror.c: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. regex/regerror.ih: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. regex/my_regex.h: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. regex/regexec.c: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. regex/regfree.c: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. regex/reginit.c: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. sql/item_cmpfunc.cc: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. sql/item_cmpfunc.h: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. sql/mysqld.cc: Prefix regex functions/types with "my_" as our library is not compatible with normal regex lib. --- client/mysqltest.c | 19 +++++++------ os2/MySQL-Source.icc | 4 +-- regex/Makefile.am | 2 +- regex/debug.c | 5 ++-- regex/debug.ih | 2 +- regex/engine.c | 8 +++--- regex/engine.ih | 2 +- regex/main.c | 52 +++++++++++++++++------------------ regex/main.ih | 2 +- regex/{regex.h => my_regex.h} | 16 +++++------ regex/regcomp.c | 10 +++---- regex/regerror.c | 6 ++-- regex/regerror.ih | 2 +- regex/regexec.c | 9 +++--- regex/regfree.c | 6 ++-- regex/reginit.c | 4 +-- sql/item_cmpfunc.cc | 32 ++++++++++----------- sql/item_cmpfunc.h | 4 +-- sql/mysqld.cc | 8 +++--- 19 files changed, 97 insertions(+), 96 deletions(-) rename regex/{regex.h => my_regex.h} (79%) diff --git a/client/mysqltest.c b/client/mysqltest.c index e28ec503d89..19a44b0f24c 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -59,7 +59,7 @@ #include #include #include -#include /* Our own version of lib */ +#include "my_regex.h" /* Our own version of lib */ #ifdef HAVE_SYS_WAIT_H #include #endif @@ -188,7 +188,7 @@ static int got_end_timer= FALSE; static void timer_output(void); static ulonglong timer_now(void); -static regex_t ps_re; /* Holds precompiled re for valid PS statements */ +static my_regex_t ps_re; /* Holds precompiled re for valid PS statements */ static void ps_init_re(void); static int ps_match_re(char *); static char *ps_eprint(int); @@ -3585,12 +3585,13 @@ static void ps_init_re(void) "[[:space:]]*UPDATE[[:space:]]+MULTI[[:space:]]|" "[[:space:]]*INSERT[[:space:]]+SELECT[[:space:]])"; - int err= regcomp(&ps_re, ps_re_str, (REG_EXTENDED | REG_ICASE | REG_NOSUB), - &my_charset_latin1); + int err= my_regcomp(&ps_re, ps_re_str, + (REG_EXTENDED | REG_ICASE | REG_NOSUB), + &my_charset_latin1); if (err) { char erbuf[100]; - int len= regerror(err, &ps_re, erbuf, sizeof(erbuf)); + int len= my_regerror(err, &ps_re, erbuf, sizeof(erbuf)); fprintf(stderr, "error %s, %d/%d `%s'\n", ps_eprint(err), len, (int)sizeof(erbuf), erbuf); exit(1); @@ -3600,7 +3601,7 @@ static void ps_init_re(void) static int ps_match_re(char *stmt_str) { - int err= regexec(&ps_re, stmt_str, (size_t)0, NULL, 0); + int err= my_regexec(&ps_re, stmt_str, (size_t)0, NULL, 0); if (err == 0) return 1; @@ -3609,7 +3610,7 @@ static int ps_match_re(char *stmt_str) else { char erbuf[100]; - int len= regerror(err, &ps_re, erbuf, sizeof(erbuf)); + int len= my_regerror(err, &ps_re, erbuf, sizeof(erbuf)); fprintf(stderr, "error %s, %d/%d `%s'\n", ps_eprint(err), len, (int)sizeof(erbuf), erbuf); exit(1); @@ -3619,7 +3620,7 @@ static int ps_match_re(char *stmt_str) static char *ps_eprint(int err) { static char epbuf[100]; - size_t len= regerror(REG_ITOA|err, (regex_t *)NULL, epbuf, sizeof(epbuf)); + size_t len= my_regerror(REG_ITOA|err, (my_regex_t *)NULL, epbuf, sizeof(epbuf)); assert(len <= sizeof(epbuf)); return(epbuf); } @@ -3627,7 +3628,7 @@ static char *ps_eprint(int err) static void ps_free_reg(void) { - regfree(&ps_re); + my_regfree(&ps_re); } /****************************************************************************/ diff --git a/os2/MySQL-Source.icc b/os2/MySQL-Source.icc index f4ac881c90e..a2e1916beb8 100644 --- a/os2/MySQL-Source.icc +++ b/os2/MySQL-Source.icc @@ -12,7 +12,7 @@ group client_global_pch = 'm_ctype.h', 'mysqld_error.h', 'my_list.h', 'my_sys.h', 'my_net.h', 'myisam.h', 'myisampack.h', '.\myisam\myisamdef.h', - '.\regex\regex.h' + '.\regex\my_regex.h' group server_global_pch = 'os2.h', @@ -38,7 +38,7 @@ group server_global_pch = 'my_tree.h', '..\mysys\my_static.h', 'netdb.h', 'thr_alarm.h', 'heap.h', '..\myisam\fulltext.h', '..\myisam\ftdefs.h', 'myisammrg.h', - '.\regex\regex.h' + '.\regex\my_regex.h' group server_pch = 'ha_heap.h', 'ha_myisammrg.h', 'opt_ft.h', diff --git a/regex/Makefile.am b/regex/Makefile.am index bcba6818b1b..ee57913e3a3 100644 --- a/regex/Makefile.am +++ b/regex/Makefile.am @@ -19,7 +19,7 @@ INCLUDES = @MT_INCLUDES@ \ -I$(top_builddir)/include -I$(top_srcdir)/include noinst_LIBRARIES = libregex.a LDADD= libregex.a $(top_builddir)/strings/libmystrings.a -noinst_HEADERS = cclass.h cname.h regex2.h utils.h engine.c regex.h +noinst_HEADERS = cclass.h cname.h regex2.h utils.h engine.c my_regex.h libregex_a_SOURCES = regerror.c regcomp.c regexec.c regfree.c reginit.c noinst_PROGRAMS = re re_SOURCES = split.c debug.c main.c diff --git a/regex/debug.c b/regex/debug.c index bdd3e00d5a7..271b09bb27a 100644 --- a/regex/debug.c +++ b/regex/debug.c @@ -2,7 +2,8 @@ #include #include #include -#include + +#include "my_regex.h" #include "utils.h" #include "regex2.h" #include "debug.ih" @@ -15,7 +16,7 @@ */ void regprint(r, d) -regex_t *r; +my_regex_t *r; FILE *d; { register struct re_guts *g = r->re_g; diff --git a/regex/debug.ih b/regex/debug.ih index 0d91e170437..1e1fb11177c 100644 --- a/regex/debug.ih +++ b/regex/debug.ih @@ -4,7 +4,7 @@ extern "C" { #endif /* === debug.c === */ -void regprint(regex_t *r, FILE *d); +void regprint(my_regex_t *r, FILE *d); static void s_print(CHARSET_INFO *charset, register struct re_guts *g, FILE *d); static char *regchar(CHARSET_INFO *charset, int ch,char *buf); diff --git a/regex/engine.c b/regex/engine.c index 6734560b9bf..55f5f1723df 100644 --- a/regex/engine.c +++ b/regex/engine.c @@ -32,7 +32,7 @@ struct match { struct re_guts *g; int eflags; - regmatch_t *pmatch; /* [nsub+1] (0 element unused) */ + my_regmatch_t *pmatch; /* [nsub+1] (0 element unused) */ char *offp; /* offsets work from here */ char *beginp; /* start of string -- virtual NUL precedes */ char *endp; /* end of string -- virtual NUL here */ @@ -68,7 +68,7 @@ CHARSET_INFO *charset; register struct re_guts *g; char *str; size_t nmatch; -regmatch_t pmatch[]; +my_regmatch_t pmatch[]; int eflags; { register char *endp; @@ -148,8 +148,8 @@ int eflags; /* oh my, he wants the subexpressions... */ if (m->pmatch == NULL) - m->pmatch = (regmatch_t *)malloc((m->g->nsub + 1) * - sizeof(regmatch_t)); + m->pmatch = (my_regmatch_t *)malloc((m->g->nsub + 1) * + sizeof(my_regmatch_t)); if (m->pmatch == NULL) { if (m->lastpos != NULL) free((char *)m->lastpos); diff --git a/regex/engine.ih b/regex/engine.ih index 7cfcb39fb2d..a9e98abef00 100644 --- a/regex/engine.ih +++ b/regex/engine.ih @@ -4,7 +4,7 @@ extern "C" { #endif /* === engine.c === */ -static int matcher(CHARSET_INFO *charset,register struct re_guts *g, char *string, size_t nmatch, regmatch_t pmatch[], int eflags); +static int matcher(CHARSET_INFO *charset,register struct re_guts *g, char *string, size_t nmatch, my_regmatch_t pmatch[], int eflags); static char *dissect(CHARSET_INFO *charset,register struct match *m, char *start, char *stop, sopno startst, sopno stopst); static char *backref(CHARSET_INFO *charset, register struct match *m, char *start, char *stop, sopno startst, sopno stopst, sopno lev); static char *fast(CHARSET_INFO *charset, register struct match *m, char *start, char *stop, sopno startst, sopno stopst); diff --git a/regex/main.c b/regex/main.c index 29abca6d9a2..0e21f6c094e 100644 --- a/regex/main.c +++ b/regex/main.c @@ -1,9 +1,9 @@ #include #include #include -#include #include +#include "my_regex.h" #include "main.ih" char *progname; @@ -27,9 +27,9 @@ int main(argc, argv) int argc; char *argv[]; { - regex_t re; + my_regex_t re; # define NS 10 - regmatch_t subs[NS]; + my_regmatch_t subs[NS]; char erbuf[100]; int err; size_t len; @@ -74,9 +74,9 @@ char *argv[]; exit(status); } - err = regcomp(&re, argv[optind++], copts, &my_charset_latin1); + err = my_regcomp(&re, argv[optind++], copts, &my_charset_latin1); if (err) { - len = regerror(err, &re, erbuf, sizeof(erbuf)); + len = my_regerror(err, &re, erbuf, sizeof(erbuf)); fprintf(stderr, "error %s, %d/%d `%s'\n", eprint(err), len, (int) sizeof(erbuf), erbuf); exit(status); @@ -84,7 +84,7 @@ char *argv[]; regprint(&re, stdout); if (optind >= argc) { - regfree(&re); + my_regfree(&re); exit(status); } @@ -92,9 +92,9 @@ char *argv[]; subs[0].rm_so = startoff; subs[0].rm_eo = strlen(argv[optind]) - endoff; } - err = regexec(&re, argv[optind], (size_t)NS, subs, eopts); + err = my_regexec(&re, argv[optind], (size_t)NS, subs, eopts); if (err) { - len = regerror(err, &re, erbuf, sizeof(erbuf)); + len = my_regerror(err, &re, erbuf, sizeof(erbuf)); fprintf(stderr, "error %s, %d/%d `%s'\n", eprint(err), (int) len, (int) sizeof(erbuf), erbuf); exit(status); @@ -136,7 +136,7 @@ FILE *in; const char *badpat = "invalid regular expression"; # define SHORT 10 const char *bpname = "REG_BADPAT"; - regex_t re; + my_regex_t re; while (fgets(inbuf, sizeof(inbuf), in) != NULL) { line++; @@ -163,27 +163,27 @@ FILE *in; options('c', f[1]) &~ REG_EXTENDED); } - ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, sizeof(erbuf)); + ne = my_regerror(REG_BADPAT, (my_regex_t *)NULL, erbuf, sizeof(erbuf)); if (strcmp(erbuf, badpat) != 0 || ne != strlen(badpat)+1) { fprintf(stderr, "end: regerror() test gave `%s' not `%s'\n", erbuf, badpat); status = 1; } - ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, (size_t)SHORT); + ne = my_regerror(REG_BADPAT, (my_regex_t *)NULL, erbuf, (size_t)SHORT); if (strncmp(erbuf, badpat, SHORT-1) != 0 || erbuf[SHORT-1] != '\0' || ne != strlen(badpat)+1) { fprintf(stderr, "end: regerror() short test gave `%s' not `%.*s'\n", erbuf, SHORT-1, badpat); status = 1; } - ne = regerror(REG_ITOA|REG_BADPAT, (regex_t *)NULL, erbuf, sizeof(erbuf)); + ne = my_regerror(REG_ITOA|REG_BADPAT, (my_regex_t *)NULL, erbuf, sizeof(erbuf)); if (strcmp(erbuf, bpname) != 0 || ne != strlen(bpname)+1) { fprintf(stderr, "end: regerror() ITOA test gave `%s' not `%s'\n", erbuf, bpname); status = 1; } re.re_endp = bpname; - ne = regerror(REG_ATOI, &re, erbuf, sizeof(erbuf)); + ne = my_regerror(REG_ATOI, &re, erbuf, sizeof(erbuf)); if (atoi(erbuf) != (int)REG_BADPAT) { fprintf(stderr, "end: regerror() ATOI test gave `%s' not `%ld'\n", erbuf, (long)REG_BADPAT); @@ -208,9 +208,9 @@ char *f3; char *f4; int opts; /* may not match f1 */ { - regex_t re; + my_regex_t re; # define NSUBS 10 - regmatch_t subs[NSUBS]; + my_regmatch_t subs[NSUBS]; # define NSHOULD 15 char *should[NSHOULD]; int nshould; @@ -226,10 +226,10 @@ int opts; /* may not match f1 */ strcpy(f0copy, f0); re.re_endp = (opts®_PEND) ? f0copy + strlen(f0copy) : NULL; fixstr(f0copy); - err = regcomp(&re, f0copy, opts, &my_charset_latin1); + err = my_regcomp(&re, f0copy, opts, &my_charset_latin1); if (err != 0 && (!opt('C', f1) || err != efind(f2))) { /* unexpected error or wrong error */ - len = regerror(err, &re, erbuf, sizeof(erbuf)); + len = my_regerror(err, &re, erbuf, sizeof(erbuf)); fprintf(stderr, "%d: %s error %s, %d/%d `%s'\n", line, type, eprint(err), len, (int) sizeof(erbuf), erbuf); @@ -243,7 +243,7 @@ int opts; /* may not match f1 */ } if (err != 0) { - regfree(&re); + my_regfree(&re); return; } @@ -256,11 +256,11 @@ int opts; /* may not match f1 */ subs[0].rm_so = strchr(f2, '(') - f2 + 1; subs[0].rm_eo = strchr(f2, ')') - f2; } - err = regexec(&re, f2copy, NSUBS, subs, options('e', f1)); + err = my_regexec(&re, f2copy, NSUBS, subs, options('e', f1)); if (err != 0 && (f3 != NULL || err != REG_NOMATCH)) { /* unexpected error or wrong error */ - len = regerror(err, &re, erbuf, sizeof(erbuf)); + len = my_regerror(err, &re, erbuf, sizeof(erbuf)); fprintf(stderr, "%d: %s exec error %s, %d/%d `%s'\n", line, type, eprint(err), len, (int) sizeof(erbuf), erbuf); @@ -282,7 +282,7 @@ int opts; /* may not match f1 */ } if (err != 0 || f4 == NULL) { - regfree(&re); + my_regfree(&re); return; } @@ -303,7 +303,7 @@ int opts; /* may not match f1 */ } } - regfree(&re); + my_regfree(&re); } /* @@ -404,7 +404,7 @@ register char *p; char * /* NULL or complaint */ check(str, sub, should) char *str; -regmatch_t sub; +my_regmatch_t sub; char *should; { register int len; @@ -485,7 +485,7 @@ int err; static char epbuf[100]; size_t len; - len = regerror(REG_ITOA|err, (regex_t *)NULL, epbuf, sizeof(epbuf)); + len = my_regerror(REG_ITOA|err, (my_regex_t *)NULL, epbuf, sizeof(epbuf)); assert(len <= sizeof(epbuf)); return(epbuf); } @@ -499,11 +499,11 @@ efind(name) char *name; { static char efbuf[100]; - regex_t re; + my_regex_t re; sprintf(efbuf, "REG_%s", name); assert(strlen(efbuf) < sizeof(efbuf)); re.re_endp = efbuf; - (void) regerror(REG_ATOI, &re, efbuf, sizeof(efbuf)); + (void) my_regerror(REG_ATOI, &re, efbuf, sizeof(efbuf)); return(atoi(efbuf)); } diff --git a/regex/main.ih b/regex/main.ih index 4b16e676ad3..f0104cc18c0 100644 --- a/regex/main.ih +++ b/regex/main.ih @@ -9,7 +9,7 @@ void rx_try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts); int options(int type, char *s); int opt(int c, char *s); void fixstr(register char *p); -char *check(char *str, regmatch_t sub, char *should); +char *check(char *str, my_regmatch_t sub, char *should); static char *eprint(int err); static int efind(char *name); diff --git a/regex/regex.h b/regex/my_regex.h similarity index 79% rename from regex/regex.h rename to regex/my_regex.h index e0fb0c77dc9..0d1cedf5430 100644 --- a/regex/regex.h +++ b/regex/my_regex.h @@ -20,15 +20,15 @@ typedef struct { const char *re_endp; /* end pointer for REG_PEND */ struct re_guts *re_g; /* none of your business :-) */ CHARSET_INFO *charset; /* For ctype things */ -} regex_t; +} my_regex_t; typedef struct { regoff_t rm_so; /* start of match */ regoff_t rm_eo; /* end of match */ -} regmatch_t; +} my_regmatch_t; /* === regcomp.c === */ -extern int regcomp(regex_t *, const char *, int, CHARSET_INFO *charset); +extern int my_regcomp(my_regex_t *, const char *, int, CHARSET_INFO *charset); #define REG_BASIC 0000 #define REG_EXTENDED 0001 #define REG_ICASE 0002 @@ -58,11 +58,11 @@ extern int regcomp(regex_t *, const char *, int, CHARSET_INFO *charset); #define REG_INVARG 16 #define REG_ATOI 255 /* convert name to number (!) */ #define REG_ITOA 0400 /* convert number to name (!) */ -extern size_t regerror(int, const regex_t *, char *, size_t); +extern size_t my_regerror(int, const my_regex_t *, char *, size_t); /* === regexec.c === */ -extern int regexec(const regex_t *, const char *, size_t, regmatch_t [], int); +extern int my_regexec(const my_regex_t *, const char *, size_t, my_regmatch_t [], int); #define REG_NOTBOL 00001 #define REG_NOTEOL 00002 #define REG_STARTEND 00004 @@ -72,12 +72,12 @@ extern int regexec(const regex_t *, const char *, size_t, regmatch_t [], int); /* === regfree.c === */ -extern void regfree(regex_t *); +extern void my_regfree(my_regex_t *); /* === reginit.c === */ -extern void regex_init(CHARSET_INFO *cs); /* Should be called for multithread progs */ -extern void regex_end(void); /* If one wants a clean end */ +extern void my_regex_init(CHARSET_INFO *cs); /* Should be called for multithread progs */ +extern void my_regex_end(void); /* If one wants a clean end */ #ifdef __cplusplus } diff --git a/regex/regcomp.c b/regex/regcomp.c index 998b39379aa..9cba56a97dd 100644 --- a/regex/regcomp.c +++ b/regex/regcomp.c @@ -1,11 +1,11 @@ #include #include #include -#include #ifdef __WIN__ #include #endif +#include "my_regex.h" #include "utils.h" #include "regex2.h" @@ -100,8 +100,8 @@ static int never = 0; /* for use in asserts; shuts lint up */ = #define REG_DUMP 0200 */ int /* 0 success, otherwise REG_something */ -regcomp(preg, pattern, cflags, charset) -regex_t *preg; +my_regcomp(preg, pattern, cflags, charset) +my_regex_t *preg; const char *pattern; int cflags; CHARSET_INFO *charset; @@ -117,7 +117,7 @@ CHARSET_INFO *charset; # define GOODFLAGS(f) ((f)&~REG_DUMP) #endif - regex_init(charset); /* Init cclass if neaded */ + my_regex_init(charset); /* Init cclass if neaded */ preg->charset=charset; cflags = GOODFLAGS(cflags); if ((cflags®_EXTENDED) && (cflags®_NOSPEC)) @@ -199,7 +199,7 @@ CHARSET_INFO *charset; /* win or lose, we're done */ if (p->error != 0) /* lose */ - regfree(preg); + my_regfree(preg); return(p->error); } diff --git a/regex/regerror.c b/regex/regerror.c index 9caa5b95a4c..489f2e35abb 100644 --- a/regex/regerror.c +++ b/regex/regerror.c @@ -1,8 +1,8 @@ #include #include #include -#include +#include "my_regex.h" #include "utils.h" #include "regerror.ih" @@ -56,7 +56,7 @@ static struct rerr { */ /* ARGSUSED */ size_t -regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size) +my_regerror(int errcode, const my_regex_t *preg, char *errbuf, size_t errbuf_size) { register struct rerr *r; register size_t len; @@ -101,7 +101,7 @@ regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size) */ static char * regatoi(preg, localbuf) -const regex_t *preg; +const my_regex_t *preg; char *localbuf; { register struct rerr *r; diff --git a/regex/regerror.ih b/regex/regerror.ih index 2cb668c24f0..a4d048022f8 100644 --- a/regex/regerror.ih +++ b/regex/regerror.ih @@ -4,7 +4,7 @@ extern "C" { #endif /* === regerror.c === */ -static char *regatoi(const regex_t *preg, char *localbuf); +static char *regatoi(const my_regex_t *preg, char *localbuf); #ifdef __cplusplus } diff --git a/regex/regexec.c b/regex/regexec.c index 723289bd0ad..b7ad83ba883 100644 --- a/regex/regexec.c +++ b/regex/regexec.c @@ -8,11 +8,10 @@ #include #include #include -#include #ifdef __WIN__ #include #endif - +#include "my_regex.h" #include "utils.h" #include "regex2.h" @@ -110,11 +109,11 @@ static int nope = 0; /* for use in asserts; shuts lint up */ * have been prototyped. */ int /* 0 success, REG_NOMATCH failure */ -regexec(preg, str, nmatch, pmatch, eflags) -const regex_t *preg; +my_regexec(preg, str, nmatch, pmatch, eflags) +const my_regex_t *preg; const char *str; size_t nmatch; -regmatch_t pmatch[]; +my_regmatch_t pmatch[]; int eflags; { register struct re_guts *g = preg->re_g; diff --git a/regex/regfree.c b/regex/regfree.c index 6ab50735075..f764fcdf84e 100644 --- a/regex/regfree.c +++ b/regex/regfree.c @@ -2,7 +2,7 @@ #include #include #include -#include +#include "my_regex.h" #include "utils.h" #include "regex2.h" @@ -12,8 +12,8 @@ = extern void regfree(regex_t *); */ void -regfree(preg) -regex_t *preg; +my_regfree(preg) +my_regex_t *preg; { register struct re_guts *g; diff --git a/regex/reginit.c b/regex/reginit.c index 74ad3dc6de4..f0b53e64be3 100644 --- a/regex/reginit.c +++ b/regex/reginit.c @@ -7,7 +7,7 @@ static bool regex_inited=0; -void regex_init(CHARSET_INFO *cs) +void my_regex_init(CHARSET_INFO *cs) { char buff[CCLASS_LAST][256]; int count[CCLASS_LAST]; @@ -67,7 +67,7 @@ void regex_init(CHARSET_INFO *cs) return; } -void regex_end() +void my_regex_end() { if (regex_inited) { diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 74eed7fa41a..f3ba276ec04 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2556,14 +2556,14 @@ Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) return 0; } int error; - if ((error= regcomp(&preg,res->c_ptr(), - ((cmp_collation.collation->state & - (MY_CS_BINSORT | MY_CS_CSSORT)) ? - REG_EXTENDED | REG_NOSUB : - REG_EXTENDED | REG_NOSUB | REG_ICASE), - cmp_collation.collation))) + if ((error= my_regcomp(&preg,res->c_ptr(), + ((cmp_collation.collation->state & + (MY_CS_BINSORT | MY_CS_CSSORT)) ? + REG_EXTENDED | REG_NOSUB : + REG_EXTENDED | REG_NOSUB | REG_ICASE), + cmp_collation.collation))) { - (void) regerror(error,&preg,buff,sizeof(buff)); + (void) my_regerror(error,&preg,buff,sizeof(buff)); my_printf_error(ER_REGEXP_ERROR,ER(ER_REGEXP_ERROR),MYF(0),buff); return 1; } @@ -2605,15 +2605,15 @@ longlong Item_func_regex::val_int() prev_regexp.copy(*res2); if (regex_compiled) { - regfree(&preg); + my_regfree(&preg); regex_compiled=0; } - if (regcomp(&preg,res2->c_ptr(), - ((cmp_collation.collation->state & - (MY_CS_BINSORT | MY_CS_CSSORT)) ? - REG_EXTENDED | REG_NOSUB : - REG_EXTENDED | REG_NOSUB | REG_ICASE), - cmp_collation.collation)) + if (my_regcomp(&preg,res2->c_ptr(), + ((cmp_collation.collation->state & + (MY_CS_BINSORT | MY_CS_CSSORT)) ? + REG_EXTENDED | REG_NOSUB : + REG_EXTENDED | REG_NOSUB | REG_ICASE), + cmp_collation.collation)) { null_value=1; return 0; @@ -2622,7 +2622,7 @@ longlong Item_func_regex::val_int() } } null_value=0; - return regexec(&preg,res->c_ptr(),0,(regmatch_t*) 0,0) ? 0 : 1; + return my_regexec(&preg,res->c_ptr(),0,(my_regmatch_t*) 0,0) ? 0 : 1; } @@ -2632,7 +2632,7 @@ void Item_func_regex::cleanup() Item_bool_func::cleanup(); if (regex_compiled) { - regfree(&preg); + my_regfree(&preg); regex_compiled=0; } DBUG_VOID_RETURN; diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 741ae90108a..045566a46d5 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -915,11 +915,11 @@ public: #ifdef USE_REGEX -#include +#include "my_regex.h" class Item_func_regex :public Item_bool_func { - regex_t preg; + my_regex_t preg; bool regex_compiled; bool regex_is_const; String prev_regexp; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 1b931b25647..a6a91ac32ee 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1028,7 +1028,7 @@ void clean_up(bool print_message) my_free((gptr) ssl_acceptor_fd, MYF(MY_ALLOW_ZERO_PTR)); #endif /* HAVE_OPENSSL */ #ifdef USE_REGEX - regex_end(); + my_regex_end(); #endif if (print_message && errmesg) @@ -2529,7 +2529,7 @@ static int init_common_variables(const char *conf_file_name, int argc, set_var_init(); mysys_uses_curses=0; #ifdef USE_REGEX - regex_init(&my_charset_latin1); + my_regex_init(&my_charset_latin1); #endif if (!(default_charset_info= get_charset_by_csname(default_character_set_name, MY_CS_PRIMARY, @@ -5879,7 +5879,7 @@ static void mysql_init_variables(void) #else have_openssl=SHOW_OPTION_NO; #endif -#ifdef HAVE_BROKEN_REALPATH +#if !defined(HAVE_REALPATH) || defined(HAVE_BROKEN_REALPATH) have_symlink=SHOW_OPTION_NO; #else have_symlink=SHOW_OPTION_YES; @@ -6550,7 +6550,7 @@ static void get_options(int argc,char **argv) usage(); exit(0); } -#if defined(HAVE_BROKEN_REALPATH) +#if !defined(HAVE_REALPATH) || defined(HAVE_BROKEN_REALPATH) my_use_symdir=0; my_disable_symlinks=1; have_symlink=SHOW_OPTION_NO; From 5c24a8feef931f4769a1b9e5625004ba7a54b22c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Sep 2005 19:04:51 -0700 Subject: [PATCH 158/225] Moving archive from example to sql. sql/ha_archive.h: Rename: sql/examples/ha_archive.h -> sql/ha_archive.h libmysqld/Makefile.am: Moved archive files references sql/Makefile.am: Moved archive from example to sql sql/ha_archive.cc: Moved location of prov file. sql/handler.cc: Moved location from examples to sql --- libmysqld/Makefile.am | 4 ++-- sql/Makefile.am | 4 ++-- sql/{examples => }/ha_archive.cc | 2 +- sql/{examples => }/ha_archive.h | 0 sql/handler.cc | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) rename sql/{examples => }/ha_archive.cc (99%) rename sql/{examples => }/ha_archive.h (100%) diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index 1f5c707f538..943b75f9973 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -37,7 +37,7 @@ SUBDIRS = . examples libmysqld_sources= libmysqld.c lib_sql.cc emb_qcache.cc libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \ my_time.c -sqlexamplessources = ha_example.cc ha_archive.cc ha_tina.cc +sqlexamplessources = ha_example.cc ha_tina.cc noinst_HEADERS = embedded_priv.h emb_qcache.h @@ -63,7 +63,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \ sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \ parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \ - ha_blackhole.cc + ha_blackhole.cc ha_archive.cc libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources) libmysqld_a_SOURCES= diff --git a/sql/Makefile.am b/sql/Makefile.am index 60c485d79f9..cd1de0ce3c9 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -62,7 +62,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h \ parse_file.h sql_view.h sql_trigger.h \ sql_array.h sql_cursor.h \ - examples/ha_example.h examples/ha_archive.h \ + examples/ha_example.h ha_archive.h \ examples/ha_tina.h ha_blackhole.h \ ha_federated.h mysqld_SOURCES = sql_lex.cc sql_handler.cc \ @@ -98,7 +98,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \ tztime.cc my_time.c my_decimal.cc\ sp_head.cc sp_pcontext.cc sp_rcontext.cc sp.cc \ sp_cache.cc parse_file.cc sql_trigger.cc \ - examples/ha_example.cc examples/ha_archive.cc \ + examples/ha_example.cc ha_archive.cc \ examples/ha_tina.cc ha_blackhole.cc \ ha_federated.cc diff --git a/sql/examples/ha_archive.cc b/sql/ha_archive.cc similarity index 99% rename from sql/examples/ha_archive.cc rename to sql/ha_archive.cc index 7a0c957e5c3..7e5c89cfe39 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/ha_archive.cc @@ -18,7 +18,7 @@ #pragma implementation // gcc: Class implementation #endif -#include "../mysql_priv.h" +#include "mysql_priv.h" #ifdef HAVE_ARCHIVE_DB #include "ha_archive.h" diff --git a/sql/examples/ha_archive.h b/sql/ha_archive.h similarity index 100% rename from sql/examples/ha_archive.h rename to sql/ha_archive.h diff --git a/sql/handler.cc b/sql/handler.cc index b7b599a0a90..39d9b706ed2 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -38,7 +38,7 @@ extern handlerton blackhole_hton; extern handlerton example_hton; #endif #ifdef HAVE_ARCHIVE_DB -#include "examples/ha_archive.h" +#include "ha_archive.h" extern handlerton archive_hton; #endif #ifdef HAVE_CSV_DB From 2c0e2a147dd5f71538c5bf8b9a2a414208ea28b9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Sep 2005 08:34:38 +0300 Subject: [PATCH 159/225] Fixed a bug checksum table locks the InnoDB table and does not use a consistent read (Bug #12669). This fixes InnoDB part of the bug. mysql-test/r/innodb.result: Added results for a checksum test. mysql-test/t/innodb.test: Addeed a test case for a checksum bug #12669. sql/ha_innodb.cc: Use consistent read for checksum table. --- mysql-test/r/innodb.result | 28 +++++++++++++++++++++++++++ mysql-test/t/innodb.test | 39 ++++++++++++++++++++++++++++++++++++++ sql/ha_innodb.cc | 5 +++++ 3 files changed, 72 insertions(+) diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 0d8de3a8e7d..8579d94595f 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -2616,3 +2616,31 @@ SET FOREIGN_KEY_CHECKS=1; INSERT INTO t2 VALUES(3); ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test/t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`)) DROP TABLE t2; +create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into test_checksum values (1),(2); +set autocommit=0; +checksum table test_checksum; +Table Checksum +test.test_checksum 1531596814 +insert into test_checksum values(3); +checksum table test_checksum; +Table Checksum +test.test_checksum 1531596814 +commit; +checksum table test_checksum; +Table Checksum +test.test_checksum 2050879373 +commit; +drop table test_checksum; +create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into test_checksum values (1),(2); +set autocommit=1; +checksum table test_checksum; +Table Checksum +test.test_checksum 1531596814 +set autocommit=1; +insert into test_checksum values(3); +checksum table test_checksum; +Table Checksum +test.test_checksum 2050879373 +drop table test_checksum; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 9023521c086..25cc6036e1a 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1564,3 +1564,42 @@ SET FOREIGN_KEY_CHECKS=1; INSERT INTO t2 VALUES(3); DROP TABLE t2; +# +# Test that checksum table uses a consistent read Bug #12669 +# +connect (a,localhost,root,,); +connect (b,localhost,root,,); +connection a; +create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into test_checksum values (1),(2); +set autocommit=0; +checksum table test_checksum; +connection b; +insert into test_checksum values(3); +connection a; +# +# Here checksum should not see insert +# +checksum table test_checksum; +connection a; +commit; +checksum table test_checksum; +commit; +drop table test_checksum; +# +# autocommit = 1 +# +connection a; +create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into test_checksum values (1),(2); +set autocommit=1; +checksum table test_checksum; +connection b; +set autocommit=1; +insert into test_checksum values(3); +connection a; +# +# Here checksum sees insert +# +checksum table test_checksum; +drop table test_checksum; diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index afa8570c144..c78a127319c 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -6686,6 +6686,11 @@ ha_innobase::store_lock( without FOR UPDATE or IN SHARE MODE in select, then we use consistent read for select. */ + prebuilt->select_lock_type = LOCK_NONE; + prebuilt->stored_select_lock_type = LOCK_NONE; + } else if (thd->lex->sql_command == SQLCOM_CHECKSUM) { + /* Use consistent read for checksum table */ + prebuilt->select_lock_type = LOCK_NONE; prebuilt->stored_select_lock_type = LOCK_NONE; } else { From f4ec1ed519bbfdab91866e7d7779fbf91fcf5ade Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Sep 2005 09:41:30 +0200 Subject: [PATCH 160/225] the test changed to be, simpler, faster, and easier to read --- mysql-test/r/mysqldump.result | 75 +++++++++++++++++++++++++++-------- mysql-test/t/mysqldump.test | 12 +----- 2 files changed, 60 insertions(+), 27 deletions(-) diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 48e6ded689e..4ac0faf00c7 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -1737,22 +1737,65 @@ create view v1 as select * from v3 where b in (1, 2, 3, 4, 5, 6, 7); create view v2 as select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1; -drop view v1, v2, v3; -drop table t1; -show full tables; -Tables_in_test Table_type -t1 BASE TABLE -v1 VIEW -v2 VIEW -v3 VIEW -show create view v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `v3`.`a` AS `a`,`v3`.`b` AS `b`,`v3`.`c` AS `c` from `v3` where (`v3`.`b` in (1,2,3,4,5,6,7)) -select * from v1; -a b c -1 2 one -2 4 two -3 6 three + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` int(11) default NULL, + `b` int(11) default NULL, + `c` varchar(30) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES (1,2,'one'),(2,4,'two'),(3,6,'three'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; +DROP TABLE IF EXISTS `v1`; +/*!50001 DROP VIEW IF EXISTS `v1`*/; +/*!50001 CREATE TABLE `v1` ( + `a` int(11) default NULL, + `b` int(11) default NULL, + `c` varchar(30) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1*/; +DROP TABLE IF EXISTS `v2`; +/*!50001 DROP VIEW IF EXISTS `v2`*/; +/*!50001 CREATE TABLE `v2` ( + `a` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1*/; +DROP TABLE IF EXISTS `v3`; +/*!50001 DROP VIEW IF EXISTS `v3`*/; +/*!50001 CREATE TABLE `v3` ( + `a` int(11) default NULL, + `b` int(11) default NULL, + `c` varchar(30) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1*/; +/*!50001 DROP TABLE IF EXISTS `v1`*/; +/*!50001 DROP VIEW IF EXISTS `v1`*/; +/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `v3`.`a` AS `a`,`v3`.`b` AS `b`,`v3`.`c` AS `c` from `v3` where (`v3`.`b` in (1,2,3,4,5,6,7))*/; +/*!50001 DROP TABLE IF EXISTS `v2`*/; +/*!50001 DROP VIEW IF EXISTS `v2`*/; +/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `v3`.`a` AS `a` from (`v3` join `v1`) where ((`v1`.`a` = `v3`.`a`) and (`v3`.`b` = 3)) limit 1*/; +/*!50001 DROP TABLE IF EXISTS `v3`*/; +/*!50001 DROP VIEW IF EXISTS `v3`*/; +/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b`,`t1`.`c` AS `c` from `t1`*/; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + drop view v1, v2, v3; drop table t1; CREATE TABLE t1 (a int, b bigint default NULL); diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 2ce4b1071e2..22ec5109b10 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -758,17 +758,7 @@ select * from v3 where b in (1, 2, 3, 4, 5, 6, 7); create view v2 as select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1; ---exec $MYSQL_DUMP test > var/tmp/bug10927.sql -drop view v1, v2, v3; -drop table t1; ---exec $MYSQL test < var/tmp/bug10927.sql - -# Without dropping the original tables in between ---exec $MYSQL_DUMP test > var/tmp/bug10927.sql ---exec $MYSQL test < var/tmp/bug10927.sql -show full tables; -show create view v1; -select * from v1; +--exec $MYSQL_DUMP --skip-comments test drop view v1, v2, v3; drop table t1; From 9a8482f69b4416f1bc97be3dd9fa4bcb2323043d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Sep 2005 10:30:20 +0200 Subject: [PATCH 161/225] Add -ansi flag when building with gcc BUILD/SETUP.sh: Add -ansi flag, make gcc not allow "C++ comments in C" --- BUILD/SETUP.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 3f8a9ccaf22..91633139c9c 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -43,7 +43,7 @@ AM_MAKEFLAGS="-j 4" # The following warning flag will give too many warnings: # -Wshadow -Wunused -Winline (The later isn't usable in C++ as # __attribute()__ doesn't work with gnu C++) -global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings" +global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -ansi" #debug_extra_warnings="-Wuninitialized" c_warnings="$global_warnings -Wunused" cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" From aa1c81b1500aa9cfcd126d0e0742a443c29d4537 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Sep 2005 19:01:53 +1000 Subject: [PATCH 162/225] merge fixes - SingleUser logging ndb/include/mgmapi/ndb_logevent.h: Merge fix - add SingleUser log events ndb/src/common/debugger/EventLogger.cpp: merge fix - add text for SingleUser log events. ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: merge fix ndb/src/mgmapi/ndb_logevent.cpp: add SingeUser log info --- ndb/include/mgmapi/ndb_logevent.h | 10 +++++--- ndb/src/common/debugger/EventLogger.cpp | 24 +++++++++++++++++++ ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp | 4 ++-- ndb/src/mgmapi/ndb_logevent.cpp | 1 + 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/ndb/include/mgmapi/ndb_logevent.h b/ndb/include/mgmapi/ndb_logevent.h index d5744b0fffe..ff0d817d593 100644 --- a/ndb/include/mgmapi/ndb_logevent.h +++ b/ndb/include/mgmapi/ndb_logevent.h @@ -148,9 +148,9 @@ extern "C" { /** NDB_MGM_EVENT_CATEGORY_INFO */ NDB_LE_InfoEvent = 49, - /* GREP */ - NDB_LE_GrepSubscriptionInfo = 52, - NDB_LE_GrepSubscriptionAlert = 53, + /* SINGLE USER */ + NDB_LE_SingleUser = 52, + /* NDB_LE_ UNUSED = 53, */ /** NDB_MGM_EVENT_CATEGORY_BACKUP */ NDB_LE_BackupStarted = 54, @@ -593,6 +593,10 @@ extern "C" { unsigned backup_id; unsigned error; } BackupAborted; + /** Log event data @ref NDB_LE_SingleUser */ + struct { + unsigned node_id; + } SingleUser; #ifndef DOXYGEN_FIX }; #else diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp index d18b0feb1ad..9a1dcb8a3e1 100644 --- a/ndb/src/common/debugger/EventLogger.cpp +++ b/ndb/src/common/debugger/EventLogger.cpp @@ -633,6 +633,27 @@ void getTextBackupAborted(QQQQ) { theData[3]); } +void getTextSingleUser(QQQQ) { + switch (theData[1]) + { + case 0: + BaseString::snprintf(m_text, m_text_len, "Entering single user mode"); + break; + case 1: + BaseString::snprintf(m_text, m_text_len, + "Entered single user mode " + "Node %d has exclusive access", theData[2]); + break; + case 2: + BaseString::snprintf(m_text, m_text_len,"Exiting single user mode"); + break; + default: + BaseString::snprintf(m_text, m_text_len, + "Unknown single user report %d", theData[1]); + break; + } +} + #if 0 BaseString::snprintf(m_text, m_text_len, @@ -716,6 +737,9 @@ const EventLoggerBase::EventRepLogLevelMatrix EventLoggerBase::matrix[] = { ROW(CreateLogBytes, LogLevel::llInfo, 11, Logger::LL_INFO ), ROW(InfoEvent, LogLevel::llInfo, 2, Logger::LL_INFO ), + //Single User + ROW(SingleUser, LogLevel::llInfo, 7, Logger::LL_INFO ), + // Backup ROW(BackupStarted, LogLevel::llBackup, 7, Logger::LL_INFO ), ROW(BackupCompleted, LogLevel::llBackup, 7, Logger::LL_INFO ), diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp index 60f3c4e83cd..e50e6bd242b 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp @@ -1963,7 +1963,7 @@ Ndbcntr::execRESUME_REQ(Signal* signal){ jamEntry(); - signal->theData[0] = EventReport::SingleUser; + signal->theData[0] = NDB_LE_SingleUser; signal->theData[1] = 2; sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB); @@ -2248,7 +2248,7 @@ void Ndbcntr::execABORT_ALL_CONF(Signal* signal){ c_stopRec.stopReq.senderRef = 0; // the command is done - signal->theData[0] = EventReport::SingleUser; + signal->theData[0] = NDB_LE_SingleUser; signal->theData[1] = 1; signal->theData[2] = c_stopRec.stopReq.singleUserApi; sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 3, JBB); diff --git a/ndb/src/mgmapi/ndb_logevent.cpp b/ndb/src/mgmapi/ndb_logevent.cpp index 27e7c1f36f5..046df06754a 100644 --- a/ndb/src/mgmapi/ndb_logevent.cpp +++ b/ndb/src/mgmapi/ndb_logevent.cpp @@ -289,6 +289,7 @@ struct Ndb_logevent_body_row ndb_logevent_body[]= { ROW( BackupAborted, "backup_id", 2, backup_id), ROW( BackupAborted, "error", 3, error), + ROW( SingleUser, "node_id", 1, node_id), { NDB_LE_ILLEGAL_TYPE, 0, 0, 0, 0, 0} }; From 612b9cebb26c3585da1ddbae511fdd60436a11d9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Sep 2005 12:37:27 +0300 Subject: [PATCH 163/225] Minor corrections to InnoDB function comments innobase/include/mem0mem.h: Correct the comment of mem_heap_create_func(). innobase/include/mem0mem.ic: Correct the comment of mem_heap_create_func(). sql/ha_innodb.cc: Correct comments regarding return value --- innobase/include/mem0mem.h | 3 +-- innobase/include/mem0mem.ic | 3 +-- sql/ha_innodb.cc | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/innobase/include/mem0mem.h b/innobase/include/mem0mem.h index 87afdb8f91c..3768e93c03e 100644 --- a/innobase/include/mem0mem.h +++ b/innobase/include/mem0mem.h @@ -99,8 +99,7 @@ heap freeing. */ /********************************************************************* NOTE: Use the corresponding macros instead of this function. Creates a memory heap which allocates memory from dynamic space. For debugging -purposes, takes also the file name and line as argument in the debug -version. */ +purposes, takes also the file name and line as argument. */ UNIV_INLINE mem_heap_t* mem_heap_create_func( diff --git a/innobase/include/mem0mem.ic b/innobase/include/mem0mem.ic index 8c87c884d78..28562f7c9f8 100644 --- a/innobase/include/mem0mem.ic +++ b/innobase/include/mem0mem.ic @@ -371,8 +371,7 @@ mem_heap_free_top( /********************************************************************* NOTE: Use the corresponding macros instead of this function. Creates a memory heap which allocates memory from dynamic space. For debugging -purposes, takes also the file name and line as argument in the debug -version. */ +purposes, takes also the file name and line as argument. */ UNIV_INLINE mem_heap_t* mem_heap_create_func( diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 290ee1d7883..8abde6980cc 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -1191,7 +1191,7 @@ Opens an InnoDB database. */ handlerton* innobase_init(void) /*===============*/ - /* out: TRUE if error */ + /* out: &innobase_hton, or NULL on error */ { static char current_dir[3]; /* Set if using current lib */ int err; @@ -2492,7 +2492,7 @@ Closes a handle to an InnoDB table. */ int ha_innobase::close(void) /*====================*/ - /* out: error number */ + /* out: 0 */ { DBUG_ENTER("ha_innobase::close"); From b2d8eb02a7ee3fd6204ddbb037321b76f36db24e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Sep 2005 13:02:18 +0300 Subject: [PATCH 164/225] InnoDB: Fix potential buffer underflow. innobase/include/ut0mem.h: Add ut_strlcpy_rev. innobase/mem/mem0mem.c: Use ut_strlcpy_rev instead of buggy own implementation. innobase/ut/ut0mem.c: Add ut_strlcpy_rev. --- innobase/include/ut0mem.h | 13 +++++++++++++ innobase/mem/mem0mem.c | 4 +--- innobase/ut/ut0mem.c | 25 ++++++++++++++++++++++++- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/innobase/include/ut0mem.h b/innobase/include/ut0mem.h index 8f109a64b55..b9bbe0b5c92 100644 --- a/innobase/include/ut0mem.h +++ b/innobase/include/ut0mem.h @@ -122,6 +122,7 @@ ut_strcmp(const void* str1, const void* str2); Copies up to size - 1 characters from the NUL-terminated string src to dst, NUL-terminating the result. Returns strlen(src), so truncation occurred if the return value >= size. */ + ulint ut_strlcpy( /*=======*/ @@ -130,6 +131,18 @@ ut_strlcpy( const char* src, /* in: source buffer */ ulint size); /* in: size of destination buffer */ +/************************************************************************** +Like ut_strlcpy, but if src doesn't fit in dst completely, copies the last +(size - 1) bytes of src, not the first. */ + +ulint +ut_strlcpy_rev( +/*===========*/ + /* out: strlen(src) */ + char* dst, /* in: destination buffer */ + const char* src, /* in: source buffer */ + ulint size); /* in: size of destination buffer */ + /************************************************************************** Compute strlen(ut_strcpyq(str, q)). */ UNIV_INLINE diff --git a/innobase/mem/mem0mem.c b/innobase/mem/mem0mem.c index 85f0119d02a..daf78008d45 100644 --- a/innobase/mem/mem0mem.c +++ b/innobase/mem/mem0mem.c @@ -187,9 +187,7 @@ mem_heap_create_block( } block->magic_n = MEM_BLOCK_MAGIC_N; - ut_memcpy(&(block->file_name), file_name + ut_strlen(file_name) - 7, - 7); - block->file_name[7]='\0'; + ut_strlcpy_rev(block->file_name, file_name, sizeof(block->file_name)); block->line = line; #ifdef MEM_PERIODIC_CHECK diff --git a/innobase/ut/ut0mem.c b/innobase/ut/ut0mem.c index c1e3ebbf35c..47b1e24e5e1 100644 --- a/innobase/ut/ut0mem.c +++ b/innobase/ut/ut0mem.c @@ -364,7 +364,30 @@ ut_strlcpy( dst[n] = '\0'; } - return src_size; + return(src_size); +} + +/************************************************************************** +Like ut_strlcpy, but if src doesn't fit in dst completely, copies the last +(size - 1) bytes of src, not the first. */ + +ulint +ut_strlcpy_rev( +/*===========*/ + /* out: strlen(src) */ + char* dst, /* in: destination buffer */ + const char* src, /* in: source buffer */ + ulint size) /* in: size of destination buffer */ +{ + ulint src_size = strlen(src); + + if (size != 0) { + ulint n = ut_min(src_size, size - 1); + + memcpy(dst, src + src_size - n, n + 1); + } + + return(src_size); } /************************************************************************** From 496f2b47ab27d5f0953c964ba7b865290544bfe4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Sep 2005 12:29:58 +0200 Subject: [PATCH 165/225] Fix for bug #13451 (memleak in rename view) after Dmitri's review: - call explicitly destructor for view's LEX - cs fixes --- sql/sql_view.cc | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/sql/sql_view.cc b/sql/sql_view.cc index b45bca4ff67..36b49196456 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1394,12 +1394,13 @@ int view_checksum(THD *thd, TABLE_LIST *view) */ bool mysql_rename_view(THD *thd, - const char *new_name, - TABLE_LIST *view) + const char *new_name, + TABLE_LIST *view) { LEX_STRING pathstr, file; File_parser *parser; char view_path[FN_REFLEN]; + bool error= TRUE; DBUG_ENTER("mysql_rename_view"); @@ -1411,19 +1412,20 @@ mysql_rename_view(THD *thd, pathstr.length= strlen(view_path); if ((parser= sql_parse_prepare(&pathstr, thd->mem_root, 1)) && - is_equal(&view_type, parser->type())) { + is_equal(&view_type, parser->type())) + { char dir_buff[FN_REFLEN], file_buff[FN_REFLEN]; /* get view definition and source */ if (mysql_make_view(parser, view) || parser->parse((gptr)view, thd->mem_root, view_parameters + source_number_position, 1)) - DBUG_RETURN(1); + goto err; /* rename view and it's backups */ if (rename_in_schema_file(view->db, view->table_name, new_name, view->revision - 1, num_view_backups)) - DBUG_RETURN(1); + goto err; strxnmov(dir_buff, FN_REFLEN, mysql_data_home, "/", view->db, "/", NullS); (void) unpack_filename(dir_buff, dir_buff); @@ -1436,11 +1438,13 @@ mysql_rename_view(THD *thd, - file_buff); if (sql_create_definition_file(&pathstr, &file, view_file_type, - (gptr)view, view_parameters, num_view_backups)) { + (gptr)view, view_parameters, + num_view_backups)) + { /* restore renamed view in case of error */ rename_in_schema_file(view->db, new_name, view->table_name, view->revision - 1, num_view_backups); - DBUG_RETURN(1); + goto err; } } else DBUG_RETURN(1); @@ -1448,5 +1452,13 @@ mysql_rename_view(THD *thd, /* remove cache entries */ query_cache_invalidate3(thd, view, 0); sp_cache_invalidate(); - DBUG_RETURN(0); + error= FALSE; + +err: + /* + We have to explicitly call destructor for view's LEX since it won't + be called otherwise. + */ + delete view->view; + DBUG_RETURN(error); } From 811d98adc84d1deea9465ce889122b8df9d9c02a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Sep 2005 13:50:27 +0300 Subject: [PATCH 166/225] Fix incorrectly merged changeset, these may not be before a first 5.0 test i.e. range test. --- mysql-test/r/innodb.result | 28 -------------------------- mysql-test/t/innodb.test | 40 -------------------------------------- 2 files changed, 68 deletions(-) diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index ef1163b17c9..8579d94595f 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1739,34 +1739,6 @@ select min(b) from t1 where a='8'; min(b) 6 drop table t1; -create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; -insert into test_checksum values (1),(2); -set autocommit=0; -checksum table test_checksum; -Table Checksum -test.test_checksum 1531596814 -insert into test_checksum values(3); -checksum table test_checksum; -Table Checksum -test.test_checksum 1531596814 -commit; -checksum table test_checksum; -Table Checksum -test.test_checksum 2050879373 -commit; -drop table test_checksum; -create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; -insert into test_checksum values (1),(2); -set autocommit=1; -checksum table test_checksum; -Table Checksum -test.test_checksum 1531596814 -set autocommit=1; -insert into test_checksum values(3); -checksum table test_checksum; -Table Checksum -test.test_checksum 2050879373 -drop table test_checksum; create table t1 (x bigint unsigned not null primary key) engine=innodb; insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1); select * from t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index d45ac4fc6c4..7d4e15163ef 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1269,46 +1269,6 @@ select min(a) from t1; select min(b) from t1 where a='8'; drop table t1; -# -# Test that checksum table uses a consistent read Bug #12669 -# -connect (a,localhost,root,,); -connect (b,localhost,root,,); -connection a; -create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; -insert into test_checksum values (1),(2); -set autocommit=0; -checksum table test_checksum; -connection b; -insert into test_checksum values(3); -connection a; -# -# Here checksum should not see insert -# -checksum table test_checksum; -connection a; -commit; -checksum table test_checksum; -commit; -drop table test_checksum; -# -# autocommit = 1 -# -connection a; -create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; -insert into test_checksum values (1),(2); -set autocommit=1; -checksum table test_checksum; -connection b; -set autocommit=1; -insert into test_checksum values(3); -connection a; -# -# Here checksum sees insert -# -checksum table test_checksum; -drop table test_checksum; - # End of 4.1 tests # From f3ad7320523e341efeadfa46ef88a224a80d6dfd Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Sep 2005 16:17:45 +0500 Subject: [PATCH 167/225] Fix for bug #7977 in sql_mode=ANSI, show create table ignores auto_increment "CHARACTER SET", "COLLATE", and "DEFAULT" are always printed(excepting MODE_MYSQL323 and MODE_MYSQL40) "AUTO_INCREMENT", "ON UPDATE CURRENT_TIMESTAMP" are printed only if NO_FIELD_OPTIONS is not set. mysql-test/r/sql_mode.result: Fix for bug #7977 in sql_mode=ANSI, show create table ignores auto_increment test case mysql-test/t/sql_mode.test: Fix for bug #7977 in sql_mode=ANSI, show create table ignores auto_increment test case --- mysql-test/r/sql_mode.result | 26 +++++++++++++++++++++++--- mysql-test/t/sql_mode.test | 12 ++++++++++++ sql/sql_show.cc | 10 ++++++---- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result index 4e1693e15ec..d459b6acf6d 100644 --- a/mysql-test/r/sql_mode.result +++ b/mysql-test/r/sql_mode.result @@ -65,7 +65,7 @@ sql_mode NO_FIELD_OPTIONS,MYSQL323,MYSQL40 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` int(11) NOT NULL auto_increment, + `a` int(11) NOT NULL, `pseudo` varchar(35) NOT NULL default '', `email` varchar(60) NOT NULL default '', PRIMARY KEY (`a`), @@ -79,8 +79,8 @@ show create table t1; Table Create Table t1 CREATE TABLE "t1" ( "a" int(11) NOT NULL, - "pseudo" varchar(35) NOT NULL default '', - "email" varchar(60) NOT NULL default '', + "pseudo" varchar(35) character set latin2 NOT NULL default '', + "email" varchar(60) character set latin2 NOT NULL default '', PRIMARY KEY ("a"), UNIQUE KEY "email" ("email") ) @@ -140,3 +140,23 @@ t1 CREATE TABLE `t1` ( drop table t1 ; set @@SQL_MODE=NULL; ERROR 42000: Variable 'sql_mode' can't be set to the value of 'NULL' +set session sql_mode=ansi; +create table t1 +(f1 integer auto_increment primary key, +f2 timestamp default current_timestamp on update current_timestamp); +show create table t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "f1" int(11) NOT NULL auto_increment, + "f2" timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + PRIMARY KEY ("f1") +) +set session sql_mode=no_field_options; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(11) NOT NULL, + `f2` timestamp NOT NULL default CURRENT_TIMESTAMP, + PRIMARY KEY (`f1`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/t/sql_mode.test b/mysql-test/t/sql_mode.test index 4a5a136f54a..7877f9acc40 100644 --- a/mysql-test/t/sql_mode.test +++ b/mysql-test/t/sql_mode.test @@ -86,4 +86,16 @@ drop table t1 ; --error 1231 set @@SQL_MODE=NULL; +# +# Bug #797: in sql_mode=ANSI, show create table ignores auto_increment +# +set session sql_mode=ansi; +create table t1 +(f1 integer auto_increment primary key, + f2 timestamp default current_timestamp on update current_timestamp); +show create table t1; +set session sql_mode=no_field_options; +show create table t1; +drop table t1; + # End of 4.1 tests diff --git a/sql/sql_show.cc b/sql/sql_show.cc index c3c28535954..e619b148f3a 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1299,7 +1299,8 @@ store_create_info(THD *thd, TABLE *table, String *packet) field->sql_type(type); packet->append(type.ptr(), type.length(), system_charset_info); - if (field->has_charset() && !limited_mysql_mode && !foreign_db_mode) + if (field->has_charset() && + !(thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40))) { if (field->charset() != table->table_charset) { @@ -1337,7 +1338,7 @@ store_create_info(THD *thd, TABLE *table, String *packet) has_default= (field->type() != FIELD_TYPE_BLOB && field->unireg_check != Field::NEXT_NUMBER && - !((foreign_db_mode || limited_mysql_mode) && + !((thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40)) && has_now_default)); if (has_default) @@ -1367,12 +1368,13 @@ store_create_info(THD *thd, TABLE *table, String *packet) packet->append(tmp); } - if (!foreign_db_mode && !limited_mysql_mode && + if (!(thd->variables.sql_mode & MODE_NO_FIELD_OPTIONS) && table->timestamp_field == field && field->unireg_check != Field::TIMESTAMP_DN_FIELD) packet->append(" on update CURRENT_TIMESTAMP",28); - if (field->unireg_check == Field::NEXT_NUMBER && !foreign_db_mode) + if (field->unireg_check == Field::NEXT_NUMBER && + !(thd->variables.sql_mode & MODE_NO_FIELD_OPTIONS)) packet->append(" auto_increment", 15 ); if (field->comment.length) From a671075d3e11a30a117a919a7b9b32de08e0265a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Sep 2005 13:37:30 +0200 Subject: [PATCH 168/225] Bug#9112 - Merge table with composite index producing invalid results with some queries Second platform fix for floating point rounding. --- mysql-test/r/merge.result | 6 +++--- mysql-test/t/merge.test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index d00423ea4bf..ffb715e3903 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -635,13 +635,13 @@ b varchar(10), index (a,b) ) engine=myisam; insert into t2 values ( null, ''); -insert into t2 values ( 9999999999.9999, ''); +insert into t2 values ( 9999999999.999, ''); insert into t3 select * from t2; select min(a), max(a) from t1; min(a) max(a) -9999999999.9999 9999999999.9999 +9999999999.9990 9999999999.9990 flush tables; select min(a), max(a) from t1; min(a) max(a) -9999999999.9999 9999999999.9999 +9999999999.9990 9999999999.9990 drop table t1, t2, t3; diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 429013af56f..a3e3d487c67 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -291,7 +291,7 @@ create table t3 ( ) engine=myisam; insert into t2 values ( null, ''); -insert into t2 values ( 9999999999.9999, ''); +insert into t2 values ( 9999999999.999, ''); insert into t3 select * from t2; select min(a), max(a) from t1; flush tables; From a44907e7a6799e82edde89d7f2119d1f7160172d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Sep 2005 13:55:54 +0200 Subject: [PATCH 169/225] - fixed the removing of the RPM_BUILD_ROOT in the %clean section of the RPM spec file (the $RBR variable did not get expanded, thus leaving old build roots behind) support-files/mysql.spec.sh: - fixed the removing of the RPM_BUILD_ROOT in the %clean section (the $RBR variable did not get expanded, thus leaving old build roots behind) --- support-files/mysql.spec.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 325ebdf2c01..6104b7a4882 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -425,7 +425,7 @@ fi # Clean up the BuildRoot %clean -[ "$RBR" != "/" ] && [ -d $RBR ] && rm -rf $RBR; +[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; %files server %defattr(-,root,root,0755) @@ -562,6 +562,11 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Thu Sep 29 2005 Lenz Grimmer + +- fixed the removing of the RPM_BUILD_ROOT in the %clean section (the + $RBR variable did not get expanded, thus leaving old build roots behind) + * Thu Aug 04 2005 Lenz Grimmer - Fixed the creation of the mysql user group account in the postinstall From 0d7a2fb87f166d89d257699821cc9c7a9153529b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Sep 2005 17:21:32 +0500 Subject: [PATCH 170/225] after merge fix --- mysql-test/r/sql_mode.result | 40 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result index 903384429ab..83099623e23 100644 --- a/mysql-test/r/sql_mode.result +++ b/mysql-test/r/sql_mode.result @@ -140,6 +140,26 @@ t1 CREATE TABLE `t1` ( drop table t1 ; set @@SQL_MODE=NULL; ERROR 42000: Variable 'sql_mode' can't be set to the value of 'NULL' +set session sql_mode=ansi; +create table t1 +(f1 integer auto_increment primary key, +f2 timestamp default current_timestamp on update current_timestamp); +show create table t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "f1" int(11) NOT NULL auto_increment, + "f2" timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + PRIMARY KEY ("f1") +) +set session sql_mode=no_field_options; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(11) NOT NULL, + `f2` timestamp NOT NULL default CURRENT_TIMESTAMP, + PRIMARY KEY (`f1`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=''; show local variables like 'SQL_MODE'; Variable_name Value @@ -457,24 +477,4 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER="root"@"localhost" SQL SECURITY DEFINER VI create view v2 as select a from t2 where a in (select a from v1); drop view v2, v1; drop table t1, t2; -set session sql_mode=ansi; -create table t1 -(f1 integer auto_increment primary key, -f2 timestamp default current_timestamp on update current_timestamp); -show create table t1; -Table Create Table -t1 CREATE TABLE "t1" ( - "f1" int(11) NOT NULL auto_increment, - "f2" timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - PRIMARY KEY ("f1") -) -set session sql_mode=no_field_options; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) NOT NULL, - `f2` timestamp NOT NULL default CURRENT_TIMESTAMP, - PRIMARY KEY (`f1`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -drop table t1; SET @@SQL_MODE=@OLD_SQL_MODE; From 7acbea3f3ff5c9f8db8ea8bb7c805b83ca1e7ada Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Sep 2005 19:34:21 +0500 Subject: [PATCH 171/225] fix for bug #13545: Server crash caused by select query. sql/sql_base.cc: fix for bug #13545: Server crash caused by select query. - compare table qualifier only with tables which are not nested joins. - perform recursion accordingly. - DBUG_ASSERT(table_list->table); added before the find_field_in_table() call. --- mysql-test/r/join_nested.result | 28 ++++++++++++++++++++++++++++ mysql-test/t/join_nested.test | 31 +++++++++++++++++++++++++++++++ sql/sql_base.cc | 15 ++++++--------- 3 files changed, 65 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/join_nested.result b/mysql-test/r/join_nested.result index f9a25898a6f..9d514be76e8 100644 --- a/mysql-test/r/join_nested.result +++ b/mysql-test/r/join_nested.result @@ -1375,3 +1375,31 @@ groupid price 6 9900 DROP VIEW v1,v2; DROP TABLE t1,t2,t3,t4; +CREATE TABLE t1(a int); +CREATE TABLE t2(b int); +CREATE TABLE t3(c int, d int); +CREATE TABLE t4(d int); +CREATE TABLE t5(e int, f int); +CREATE TABLE t6(f int); +CREATE VIEW v1 AS +SELECT e FROM t5 JOIN t6 ON t5.e=t6.f; +CREATE VIEW v2 AS +SELECT e FROM t5 NATURAL JOIN t6; +SELECT t1.a FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c JOIN t4 USING(d); +a +SELECT t1.x FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c JOIN t4 USING(d); +ERROR 42S22: Unknown column 't1.x' in 'field list' +SELECT t1.a FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c NATURAL JOIN t4; +a +SELECT t1.x FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c NATURAL JOIN t4; +ERROR 42S22: Unknown column 't1.x' in 'field list' +SELECT v1.e FROM v1 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d); +e +SELECT v1.x FROM v1 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d); +ERROR 42S22: Unknown column 'v1.x' in 'field list' +SELECT v2.e FROM v2 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d); +e +SELECT v2.x FROM v2 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d); +ERROR 42S22: Unknown column 'v2.x' in 'field list' +DROP VIEW v1, v2; +DROP TABLE t1, t2, t3, t4, t5, t6; diff --git a/mysql-test/t/join_nested.test b/mysql-test/t/join_nested.test index 482c7f9f8b9..0592ec3152f 100644 --- a/mysql-test/t/join_nested.test +++ b/mysql-test/t/join_nested.test @@ -801,3 +801,34 @@ SELECT * FROM DROP VIEW v1,v2; DROP TABLE t1,t2,t3,t4; + +# +# Bug #13545: problem with NATURAL/USING joins. +# + +CREATE TABLE t1(a int); +CREATE TABLE t2(b int); +CREATE TABLE t3(c int, d int); +CREATE TABLE t4(d int); +CREATE TABLE t5(e int, f int); +CREATE TABLE t6(f int); +CREATE VIEW v1 AS + SELECT e FROM t5 JOIN t6 ON t5.e=t6.f; +CREATE VIEW v2 AS + SELECT e FROM t5 NATURAL JOIN t6; + +SELECT t1.a FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c JOIN t4 USING(d); +--error 1054 +SELECT t1.x FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c JOIN t4 USING(d); +SELECT t1.a FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c NATURAL JOIN t4; +--error 1054 +SELECT t1.x FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c NATURAL JOIN t4; +SELECT v1.e FROM v1 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d); +--error 1054 +SELECT v1.x FROM v1 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d); +SELECT v2.e FROM v2 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d); +--error 1054 +SELECT v2.x FROM v2 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d); + +DROP VIEW v1, v2; +DROP TABLE t1, t2, t3, t4, t5, t6; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 715d38925aa..8c54f964723 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2988,7 +2988,7 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list, are the same as the table reference we are going to search for the field. We exclude from the test below NATURAL/USING joins and any nested join - that is an operand of NATURAL/USING join, because each column in such + because each column in such joins may potentially originate from a different table. However, base tables and views that are under some NATURAL/USING join are searched as usual base tables/views. @@ -3001,8 +3001,8 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list, TODO: Ensure that table_name, db_name and tables->db always points to something ! */ - if (/* Exclude natural joins and nested joins underlying natural joins. */ - (!(table_list->nested_join && table_list->join_columns) || + if (/* Exclude nested joins. */ + (!table_list->nested_join || /* Include merge views and information schema tables. */ table_list->field_translation) && /* @@ -3025,13 +3025,10 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list, register_tree_change))) *actual_table= table_list; } - else if (!(table_list->nested_join && table_list->join_columns)) + else if (!table_list->nested_join) { - /* - 'table_list' is a stored table. It is so because the only type of nested - join passed to this procedure is a NATURAL/USING join or an operand of a - NATURAL/USING join. - */ + /* 'table_list' is a stored table. */ + DBUG_ASSERT(table_list->table); if ((fld= find_field_in_table(thd, table_list->table, name, length, check_grants_table, allow_rowid, cached_field_index_ptr))) From 4ed46633fc4764dbe5007805293143a92ed9c83a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Sep 2005 19:37:03 +0200 Subject: [PATCH 172/225] portability.h: Corrected OpenServer ifdef test Makefile.am: Added test-pl and test-force-pl targets Makefile.am: Added test-pl and test-force-pl targets server-tools/instance-manager/portability.h: Corrected OpenServer ifdef test --- Makefile.am | 32 ++++++++++++--------- server-tools/instance-manager/portability.h | 2 +- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/Makefile.am b/Makefile.am index 3be3ce80b71..403a4ba2137 100644 --- a/Makefile.am +++ b/Makefile.am @@ -107,20 +107,26 @@ MYSQL_TEST_RUN_ARGS = --manager-port=$(MYSQL_TEST_MANAGER_PORT) \ --master_port=$(MYSQL_TEST_MASTER_PORT) \ --slave_port=$(MYSQL_TEST_SLAVE_PORT) \ --ndbcluster_port=$(MYSQL_TEST_NDB_PORT) + test: cd mysql-test ; \ - ./mysql-test-run \ - --manager-port=$(MYSQL_TEST_MANAGER_PORT) \ - --master_port=$(MYSQL_TEST_MASTER_PORT) \ - --slave_port=$(MYSQL_TEST_SLAVE_PORT) \ - --ndbcluster_port=$(MYSQL_TEST_NDB_PORT) && \ - ./mysql-test-run --ps-protocol \ - --manager-port=$(MYSQL_TEST_MANAGER_PORT) \ - --master_port=$(MYSQL_TEST_MASTER_PORT) \ - --slave_port=$(MYSQL_TEST_SLAVE_PORT) \ - --ndbcluster_port=$(MYSQL_TEST_NDB_PORT) + ./mysql-test-run $(MYSQL_TEST_RUN_ARGS) && \ + ./mysql-test-run $(MYSQL_TEST_RUN_ARGS) --ps-protocol test-force: - cd mysql-test; \ - ./mysql-test-run --force ;\ - ./mysql-test-run --ps-protocol --force + cd mysql-test ; \ + ./mysql-test-run $(MYSQL_TEST_RUN_ARGS) --force ; \ + ./mysql-test-run $(MYSQL_TEST_RUN_ARGS) --ps-protocol --force + +test-pl: + cd mysql-test ; \ + ./mysql-test-run.pl $(MYSQL_TEST_RUN_ARGS) && \ + ./mysql-test-run.pl $(MYSQL_TEST_RUN_ARGS) --ps-protocol + +test-force-pl: + cd mysql-test ; \ + ./mysql-test-run.pl $(MYSQL_TEST_RUN_ARGS) --force ; \ + ./mysql-test-run.pl $(MYSQL_TEST_RUN_ARGS) --ps-protocol --force + +# Don't update the files from bitkeeper +%::SCCS/s.% diff --git a/server-tools/instance-manager/portability.h b/server-tools/instance-manager/portability.h index 9fc0fe58c0a..2bdeff71a72 100644 --- a/server-tools/instance-manager/portability.h +++ b/server-tools/instance-manager/portability.h @@ -1,7 +1,7 @@ #ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_PORTABILITY_H #define INCLUDES_MYSQL_INSTANCE_MANAGER_PORTABILITY_H -#if defined(__SCO_DS) && !defined(SHUT_RDWR) +#if defined(_SCO_DS) && !defined(SHUT_RDWR) #define SHUT_RDWR 2 #endif From 2f9e42f7ebcdbc32f67cb65bc5f9e31664d25204 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Sep 2005 13:45:39 -0700 Subject: [PATCH 173/225] New flags for new max-no-ndb build script to get a build that has everything except NDB BUILD/SETUP.sh: Added base_max_no_ndb_configs so I can get a max-type build sans NDB for faster builds. BUILD/compile-pentium-debug-max-no-ndb: new script to compile a max-type build sans NDB BUILD/compile-ppc-debug-max-no-ndb: new script to build a max-type build sans NDB --- BUILD/SETUP.sh | 2 ++ BUILD/compile-pentium-debug-max-no-ndb | 11 +++++++++++ BUILD/compile-ppc-debug-max-no-ndb | 11 +++++++++++ 3 files changed, 24 insertions(+) create mode 100755 BUILD/compile-pentium-debug-max-no-ndb create mode 100755 BUILD/compile-ppc-debug-max-no-ndb diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index d9d92137817..598aaaa80ae 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -53,8 +53,10 @@ global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wch c_warnings="$global_warnings -Wunused" cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine" +base_max_no_ndb_configs="--with-innodb --with-berkeley-db --without-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine" max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --with-openssl --with-embedded-server --with-big-tables" max_configs="$base_max_configs --with-embedded-server" +max_no_ndb_configs="$base_max_no_ndb_configs --with-embedded-server" path=`dirname $0` . "$path/check-cpu" diff --git a/BUILD/compile-pentium-debug-max-no-ndb b/BUILD/compile-pentium-debug-max-no-ndb new file mode 100755 index 00000000000..26ec7eacc9d --- /dev/null +++ b/BUILD/compile-pentium-debug-max-no-ndb @@ -0,0 +1,11 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" $@ --with-debug=full + +extra_flags="$pentium_cflags $debug_cflags $max_cflags" +c_warnings="$c_warnings $debug_extra_warnings" +cxx_warnings="$cxx_warnings $debug_extra_warnings" +extra_configs="$pentium_configs $debug_configs $max_no_ndb_configs" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-ppc-debug-max-no-ndb b/BUILD/compile-ppc-debug-max-no-ndb new file mode 100755 index 00000000000..a5b922a1ec9 --- /dev/null +++ b/BUILD/compile-ppc-debug-max-no-ndb @@ -0,0 +1,11 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$ppc_cflags $debug_cflags $max_cflags" +c_warnings="$c_warnings $debug_extra_warnings" +cxx_warnings="$cxx_warnings $debug_extra_warnings" +extra_configs="$debug_configs $max_no_ndb_configs" + +. "$path/FINISH.sh" From 8bdb41ab8779ea02e4964031189b48d395117eb7 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 01:34:19 +0400 Subject: [PATCH 174/225] Fix for BUG#13455: Make "ref" optimizer able to make this inference: "t.key BETWEEN c1 AND c2" and c1 = c2 -> can access table t using "t.key = c1". mysql-test/r/heap.result: BUG#13455: updated test results mysql-test/r/innodb.result: BUG#13455: updated test results mysql-test/r/myisam.result: BUG#13455: updated test results mysql-test/r/range.result: Testcase for BUG#13455 mysql-test/t/range.test: Testcase for BUG#13455 --- mysql-test/r/heap.result | 8 ++++---- mysql-test/r/innodb.result | 12 ++++++------ mysql-test/r/myisam.result | 12 ++++++------ mysql-test/r/range.result | 25 ++++++++++++++++++++++++- mysql-test/t/range.test | 28 +++++++++++++++++++++++++++- sql/sql_select.cc | 23 +++++++++++++++++++++-- 6 files changed, 88 insertions(+), 20 deletions(-) diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index 969cb06e9fe..7f40dfa3a36 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -379,10 +379,10 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL v NULL NULL NULL 271 Using where explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL v NULL NULL NULL 271 Using where +1 SIMPLE t1 ref v v 13 const 10 Using where explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL v NULL NULL NULL 271 Using where +1 SIMPLE t1 ref v v 13 const 10 Using where alter table t1 add unique(v); ERROR 23000: Duplicate entry '{ ' for key 1 select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a' order by length(concat('*',v,'*',c,'*',t,'*')); @@ -602,10 +602,10 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range v v 13 NULL # Using where explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 13 NULL # Using where +1 SIMPLE t1 ref v v 13 const # Using where explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 13 NULL # Using where +1 SIMPLE t1 ref v v 13 const # Using where alter table t1 add unique(v); ERROR 23000: Duplicate entry '{ ' for key 1 select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a' order by length(concat('*',v,'*',c,'*',t,'*')); diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 0d8de3a8e7d..39894348ba2 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1997,10 +1997,10 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range v v 13 NULL # Using where; Using index explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 13 NULL # Using where; Using index +1 SIMPLE t1 ref v v 13 const # Using where; Using index explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 13 NULL # Using where; Using index +1 SIMPLE t1 ref v v 13 const # Using where; Using index alter table t1 add unique(v); ERROR 23000: Duplicate entry '{ ' for key 1 alter table t1 add key(v); @@ -2188,10 +2188,10 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range v v 303 NULL # Using where; Using index explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 303 NULL # Using where; Using index +1 SIMPLE t1 ref v v 303 const # Using where; Using index explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 303 NULL # Using where; Using index +1 SIMPLE t1 ref v v 303 const # Using where; Using index explain select * from t1 where v='a'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref v v 303 const # Using where @@ -2268,10 +2268,10 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range v v 33 NULL # Using where explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 33 NULL # Using where +1 SIMPLE t1 ref v v 33 const # Using where explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 33 NULL # Using where +1 SIMPLE t1 ref v v 33 const # Using where explain select * from t1 where v='a'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref v v 33 const # Using where diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 0e5969ed83e..f484a937b27 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -802,10 +802,10 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range v v 13 NULL # Using where; Using index explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 13 NULL # Using where; Using index +1 SIMPLE t1 ref v v 13 const # Using where; Using index explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 13 NULL # Using where; Using index +1 SIMPLE t1 ref v v 13 const # Using where; Using index alter table t1 add unique(v); ERROR 23000: Duplicate entry '{ ' for key 1 alter table t1 add key(v); @@ -993,10 +993,10 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range v v 303 NULL # Using where; Using index explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 303 NULL # Using where; Using index +1 SIMPLE t1 ref v v 303 const # Using where; Using index explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 303 NULL # Using where; Using index +1 SIMPLE t1 ref v v 303 const # Using where; Using index explain select * from t1 where v='a'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref v v 303 const # Using where @@ -1073,10 +1073,10 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range v v 33 NULL # Using where explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 33 NULL # Using where +1 SIMPLE t1 ref v v 33 const # Using where explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 33 NULL # Using where +1 SIMPLE t1 ref v v 33 const # Using where explain select * from t1 where v='a'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref v v 33 const # Using where diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 6adbea973df..69c150fc0b7 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -1,4 +1,4 @@ -drop table if exists t1, t2; +drop table if exists t1, t2, t3; CREATE TABLE t1 ( event_date date DEFAULT '0000-00-00' NOT NULL, type int(11) DEFAULT '0' NOT NULL, @@ -787,3 +787,26 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 range PRIMARY PRIMARY 8 NULL # Using where; Using index drop view v1; drop table t1; +create table t3 (a int); +insert into t3 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1 (a varchar(10), filler char(200), key(a)) charset=binary; +insert into t1 values ('a',''); +insert into t1 values ('a ',''); +insert into t1 values ('a ', ''); +insert into t1 select concat('a', 1000 + A.a + 10 * (B.a + 10 * C.a)), '' + from t3 A, t3 B, t3 C; +create table t2 (a varchar(10), filler char(200), key(a)); +insert into t2 select * from t1; +explain select * from t1 where a between 'a' and 'a '; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 13 NULL # Using where +explain select * from t1 where a = 'a' or a='a '; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 13 NULL # Using where +explain select * from t2 where a between 'a' and 'a '; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref a a 13 const # Using where +explain select * from t2 where a = 'a' or a='a '; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref a a 13 const # Using where +drop table t1,t2,t3; diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index d8b3f5ef953..11c5e8d7bc5 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -3,7 +3,7 @@ # --disable_warnings -drop table if exists t1, t2; +drop table if exists t1, t2, t3; --enable_warnings CREATE TABLE t1 ( @@ -600,3 +600,29 @@ explain select * from v1 where a between 3 and 4 and b between 1 and 2; drop view v1; drop table t1; + +# BUG#13455: +create table t3 (a int); +insert into t3 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +create table t1 (a varchar(10), filler char(200), key(a)) charset=binary; +insert into t1 values ('a',''); +insert into t1 values ('a ',''); +insert into t1 values ('a ', ''); +insert into t1 select concat('a', 1000 + A.a + 10 * (B.a + 10 * C.a)), '' + from t3 A, t3 B, t3 C; + +create table t2 (a varchar(10), filler char(200), key(a)); +insert into t2 select * from t1; + +--replace_column 9 # +explain select * from t1 where a between 'a' and 'a '; +--replace_column 9 # +explain select * from t1 where a = 'a' or a='a '; + +--replace_column 9 # +explain select * from t2 where a between 'a' and 'a '; +--replace_column 9 # +explain select * from t2 where a = 'a' or a='a '; + +drop table t1,t2,t3; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5fc97385f15..1b1a35d2584 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2409,6 +2409,7 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, Item_func *cond, !field->table->maybe_null || field->null_ptr) return; // Not a key. Skip it exists_optimize= KEY_OPTIMIZE_EXISTS; + DBUG_ASSERT(num_values == 1); } else { @@ -2460,7 +2461,26 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, Item_func *cond, eq_func is NEVER true when num_values > 1 */ if (!eq_func) - return; + { + /* + Additional optimization: if we're processing + "t.key BETWEEN c1 AND c1" then proceed as if we were processing + "t.key = c1". + TODO: This is a very limited fix. A more generic fix is possible. + There are 2 options: + A) Make equality propagation code be able to handle BETWEEN + (including cases like t1.key BETWEEN t2.key AND t3.key) + B) Make range optimizer to infer additional "t.key = c" equalities + and use them in equality propagation process (see details in + OptimizerKBAndTodo) + */ + if ((cond->functype() == Item_func::BETWEEN) && + value[0]->eq(value[1], field->binary())) + eq_func= TRUE; + else + return; + } + if (field->result_type() == STRING_RESULT) { if ((*value)->result_type() != STRING_RESULT) @@ -2487,7 +2507,6 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, Item_func *cond, } } } - DBUG_ASSERT(num_values == 1); /* For the moment eq_func is always true. This slot is reserved for future extensions where we want to remembers other things than just eq comparisons From 3dd066e8430b64380fc6d20041f3cc6ee329c286 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 00:52:18 +0200 Subject: [PATCH 175/225] mtr_report.pl: Text formatting, adjust table header mysql-test-run.pl: Remove requirement for source tree to run embedded server test mysqldump.test: Removed ending ';' from --exec line mysql-test/t/mysqldump.test: Removed ending ';' from --exec line mysql-test/mysql-test-run.pl: Remove requirement for source tree to run embedded server test mysql-test/lib/mtr_report.pl: Text formatting, adjust table header --- mysql-test/lib/mtr_report.pl | 4 ++-- mysql-test/mysql-test-run.pl | 8 +------- mysql-test/t/mysqldump.test | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index 9002f204602..515988ee5c7 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -257,11 +257,11 @@ sub mtr_print_header () { print "\n"; if ( $::opt_timer ) { - print "TEST RESULT TIME (ms)\n"; + print "TEST RESULT TIME (ms)\n"; } else { - print "TEST RESULT\n"; + print "TEST RESULT\n"; } mtr_print_line(); print "\n"; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index be0c9b66f71..4b055e0bb84 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -659,11 +659,6 @@ sub command_line_setup () { mtr_error("Coverage test needs the source - please use source dist"); } - if ( $glob_use_embedded_server and ! $opt_source_dist ) - { - mtr_error("Embedded server needs source tree - please use source dist"); - } - if ( $opt_gdb ) { $opt_wait_timeout= 300; @@ -853,7 +848,7 @@ sub executable_setup () { if ( $glob_use_embedded_server ) { my $path_examples= "$glob_basedir/libmysqld/examples"; - $exe_mysqltest= mtr_exe_exists("$path_examples/mysqltest"); + $exe_mysqltest= mtr_exe_exists("$path_examples/mysqltest_embedded"); $exe_mysql_client_test= mtr_exe_exists("$path_examples/mysql_client_test_embedded", "/usr/bin/false"); @@ -878,7 +873,6 @@ sub executable_setup () { else { $path_client_bindir= mtr_path_exists("$glob_basedir/bin"); - $exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest"); $exe_mysqldump= mtr_exe_exists("$path_client_bindir/mysqldump"); $exe_mysqlshow= mtr_exe_exists("$path_client_bindir/mysqlshow"); $exe_mysqlbinlog= mtr_exe_exists("$path_client_bindir/mysqlbinlog"); diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index f2d56eed151..4978da0bd67 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -138,7 +138,7 @@ drop table t1; --exec $MYSQL_DUMP --skip-comments --databases test create database mysqldump_test_db character set latin2 collate latin2_bin; ---exec $MYSQL_DUMP --skip-comments --databases mysqldump_test_db; +--exec $MYSQL_DUMP --skip-comments --databases mysqldump_test_db drop database mysqldump_test_db; # From 0c8d29e06211e599e5721f1134c41a989bfb5eab Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 07:06:04 +0400 Subject: [PATCH 176/225] Adjust test results changed because of fix for BUG#13455 --- mysql-test/r/bdb.result | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result index d525b019c64..2bba44d36e9 100644 --- a/mysql-test/r/bdb.result +++ b/mysql-test/r/bdb.result @@ -1429,10 +1429,10 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range v v 13 NULL # Using where explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 13 NULL # Using where +1 SIMPLE t1 ref v v 13 const # Using where explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 13 NULL # Using where +1 SIMPLE t1 ref v v 13 const # Using where alter table t1 add unique(v); ERROR 23000: Duplicate entry '{ ' for key 1 alter table t1 add key(v); @@ -1622,10 +1622,10 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range v v 258 NULL # Using where explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 258 NULL # Using where +1 SIMPLE t1 ref v v 258 const # Using where explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 258 NULL # Using where +1 SIMPLE t1 ref v v 258 const # Using where explain select * from t1 where v='a'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref v v 258 const # Using where @@ -1702,10 +1702,10 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range v v 33 NULL # Using where explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 33 NULL # Using where +1 SIMPLE t1 ref v v 33 const # Using where explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 33 NULL # Using where +1 SIMPLE t1 ref v v 33 const # Using where explain select * from t1 where v='a'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref v v 33 const # Using where From 62233c2091f3fe2462f52a867806ee9c1ca6120c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 14:44:24 +1000 Subject: [PATCH 177/225] more post-merge fixes for SingleUser log events ndb/include/mgmapi/ndb_logevent.h: more post-merge fixes ndb/src/mgmapi/ndb_logevent.cpp: more post-merge fixes --- ndb/include/mgmapi/ndb_logevent.h | 1 + ndb/src/mgmapi/ndb_logevent.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ndb/include/mgmapi/ndb_logevent.h b/ndb/include/mgmapi/ndb_logevent.h index ff0d817d593..b69379545fc 100644 --- a/ndb/include/mgmapi/ndb_logevent.h +++ b/ndb/include/mgmapi/ndb_logevent.h @@ -595,6 +595,7 @@ extern "C" { } BackupAborted; /** Log event data @ref NDB_LE_SingleUser */ struct { + unsigned type; unsigned node_id; } SingleUser; #ifndef DOXYGEN_FIX diff --git a/ndb/src/mgmapi/ndb_logevent.cpp b/ndb/src/mgmapi/ndb_logevent.cpp index 046df06754a..918ec5d6705 100644 --- a/ndb/src/mgmapi/ndb_logevent.cpp +++ b/ndb/src/mgmapi/ndb_logevent.cpp @@ -289,7 +289,8 @@ struct Ndb_logevent_body_row ndb_logevent_body[]= { ROW( BackupAborted, "backup_id", 2, backup_id), ROW( BackupAborted, "error", 3, error), - ROW( SingleUser, "node_id", 1, node_id), + ROW( SingleUser, "type", 1, type), + ROW( SingleUser, "node_id", 2, node_id), { NDB_LE_ILLEGAL_TYPE, 0, 0, 0, 0, 0} }; From 33313992bb484d0817d5b62d5be6ca9dbdf757ba Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 12:37:58 +0500 Subject: [PATCH 178/225] Comment adjusted (see fix for #13545) --- sql/sql_base.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 8c54f964723..bb14d22e493 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2987,11 +2987,10 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list, Check that the table and database that qualify the current field name are the same as the table reference we are going to search for the field. - We exclude from the test below NATURAL/USING joins and any nested join - because each column in such - joins may potentially originate from a different table. However, base - tables and views that are under some NATURAL/USING join are searched - as usual base tables/views. + Exclude from the test below nested joins because the columns in a + nested join generally originate from different tables. Nested joins + also have no table name, except when a nested join is a merge view + or an information schema table. We include explicitly table references with a 'field_translation' table, because if there are views over natural joins we don't want to search From 68a91293ebced766717bb2d602f4fdaa21e94bef Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 10:39:17 +0300 Subject: [PATCH 179/225] Fix for BUG#13597 - columns in ON condition not resolved if references a table in a nested right join. The problem was in that when finding the last table reference in a nested join tree, the procedure doing the iteration over the right-most branches of a join tree was testing for RIGHT JOINs the table reference that represents the join, and not the second operand of the JOIN. Currently the information whether a join is LEFT/RIGHT is stored not on the join object itself, but on one of its operands. mysql-test/r/select.result: Added test for BUG#13597 mysql-test/t/select.test: Added test for BUG#13597 sql/table.cc: - test whether a table reference is a right join by testing the rigth join operand (first in the list of operands), and not the table reference that represents the join itself. - clearer comments --- mysql-test/r/select.result | 23 +++++++++++++++++++++++ mysql-test/t/select.test | 34 ++++++++++++++++++++++++++++++++++ sql/table.cc | 14 ++++++++------ 3 files changed, 65 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 43a8f7f7615..3e4f29d7a01 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -3038,3 +3038,26 @@ id 102 drop table t1, t2; drop view v1, v2, v3; +create table a ( +id int(11) not null default '0' +) engine=myisam default charset=latin1; +insert into a values (123),(191),(192); +create table b ( +id char(16) character set utf8 not null default '' +) engine=myisam default charset=latin1; +insert into b values ('58013'),('58014'),('58015'),('58016'); +create table c ( +a_id int(11) not null default '0', +b_id char(16) character set utf8 default null +) engine=myisam default charset=latin1; +insert into c values +(123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013'); +select count(*) +from a inner join (c left join b on b.id = c.b_id) on a.id = c.a_id; +count(*) +6 +select count(*) +from a inner join (b right join c on b.id = c.b_id) on a.id = c.a_id; +count(*) +6 +drop table a, b, c; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index f6f08eeb492..f7de7239292 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2575,3 +2575,37 @@ select * from v1 left join v3 using (id); drop table t1, t2; drop view v1, v2, v3; + +# +# Bug #13597 Column in ON condition not resolved if references a table in +# nested right join. +# + +create table a ( + id int(11) not null default '0' +) engine=myisam default charset=latin1; + +insert into a values (123),(191),(192); + +create table b ( + id char(16) character set utf8 not null default '' +) engine=myisam default charset=latin1; + +insert into b values ('58013'),('58014'),('58015'),('58016'); + +create table c ( + a_id int(11) not null default '0', + b_id char(16) character set utf8 default null +) engine=myisam default charset=latin1; + +insert into c values +(123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013'); + +-- both queries are equivalent +select count(*) +from a inner join (c left join b on b.id = c.b_id) on a.id = c.a_id; + +select count(*) +from a inner join (b right join c on b.id = c.b_id) on a.id = c.a_id; + +drop table a, b, c; diff --git a/sql/table.cc b/sql/table.cc index 982d5e7ddc9..1b3a6173752 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2291,8 +2291,10 @@ TABLE_LIST *st_table_list::first_leaf_for_name_resolution() List_iterator_fast it(cur_nested_join->join_list); cur_table_ref= it++; /* - If 'this' is a RIGHT JOIN, the operands in 'join_list' are in reverse - order, thus the first operand is already at the front of the list. + If the current nested join is a RIGHT JOIN, the operands in + 'join_list' are in reverse order, thus the first operand is + already at the front of the list. Otherwise the first operand + is in the end of the list of join operands. */ if (!(cur_table_ref->outer_join & JOIN_TYPE_RIGHT)) { @@ -2343,9 +2345,11 @@ TABLE_LIST *st_table_list::last_leaf_for_name_resolution() cur_nested_join; cur_nested_join= cur_table_ref->nested_join) { + cur_table_ref= cur_nested_join->join_list.head(); /* - If 'this' is a RIGHT JOIN, the operands in 'join_list' are in reverse - order, thus the last operand is in the end of the list. + If the current nested is a RIGHT JOIN, the operands in + 'join_list' are in reverse order, thus the last operand is in the + end of the list. */ if ((cur_table_ref->outer_join & JOIN_TYPE_RIGHT)) { @@ -2355,8 +2359,6 @@ TABLE_LIST *st_table_list::last_leaf_for_name_resolution() while ((next= it++)) cur_table_ref= next; } - else - cur_table_ref= cur_nested_join->join_list.head(); if (cur_table_ref->is_leaf_for_name_resolution()) break; } From 3b49f80aba520fa6ff8ab5952ed0ee348ba32c3d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 09:54:53 +0200 Subject: [PATCH 180/225] export forced_defaults_file using global variable defaults_file analog with defaults_extra_file and defaults_grouop_suffix include/my_sys.h: export forced_defaults_file using global variable defaults_file mysys/default.c: export forced_defaults_file using global variable defaults_file --- include/my_sys.h | 1 + mysys/default.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/my_sys.h b/include/my_sys.h index 836b2a85528..e13f943b84d 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -262,6 +262,7 @@ extern char wild_many,wild_one,wild_prefix; extern const char *charsets_dir; extern char *defaults_extra_file; extern const char *defaults_group_suffix; +extern const char *defaults_file; extern my_bool timed_mutexes; diff --git a/mysys/default.c b/mysys/default.c index bca3ec0fed3..9f47b09a4b0 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -42,6 +42,7 @@ #include #endif +const char *defaults_file=0; const char *defaults_group_suffix=0; char *defaults_extra_file=0; @@ -140,6 +141,9 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv, if (forced_extra_defaults) defaults_extra_file= forced_extra_defaults; + if (forced_default_file) + defaults_file= forced_default_file; + /* We can only handle 'defaults-group-suffix' if we are called from load_defaults() as otherwise we can't know the type of 'func_ctx' From b55ad590b97da6fed919ee895a030879ddbbbbfc Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 10:02:56 +0200 Subject: [PATCH 181/225] wl#1882 allow ndb_mgmd to use my.cnf for cluster configuration ndb/src/mgmsrv/ConfigInfo.cpp: Depricate Id infavor of nodeid in config.ini ndb/src/mgmsrv/InitConfigFileParser.cpp: Add support for getting cluster config from my.cnf [cluster_config] ndb/src/mgmsrv/InitConfigFileParser.hpp: Add support for getting cluster config from my.cnf [cluster_config] ndb/src/mgmsrv/MgmtSrvr.cpp: Add support for getting cluster config from my.cnf [cluster_config] ndb/src/mgmsrv/MgmtSrvrConfig.cpp: Add support for getting cluster config from my.cnf [cluster_config] ndb/src/mgmsrv/main.cpp: Add support for getting cluster config from my.cnf [cluster_config] --- ndb/src/mgmsrv/ConfigInfo.cpp | 52 +++- ndb/src/mgmsrv/InitConfigFileParser.cpp | 362 +++++++++++++++++++++++- ndb/src/mgmsrv/InitConfigFileParser.hpp | 16 ++ ndb/src/mgmsrv/MgmtSrvr.cpp | 4 +- ndb/src/mgmsrv/MgmtSrvrConfig.cpp | 10 +- ndb/src/mgmsrv/main.cpp | 24 +- 6 files changed, 453 insertions(+), 15 deletions(-) diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 4e96047e54d..a870c395bd2 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -241,6 +241,9 @@ struct DepricationTransform { static const DepricationTransform f_deprication[] = { { DB_TOKEN, "Discless", "Diskless", 0, 1 }, + { DB_TOKEN, "Id", "nodeid", 0, 1 }, + { API_TOKEN, "Id", "nodeid", 0, 1 }, + { MGM_TOKEN, "Id", "nodeid", 0, 1 }, { 0, 0, 0, 0, 0} }; @@ -405,9 +408,21 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { 0, 0 }, { - CFG_NODE_ID, + KEY_INTERNAL, "Id", DB_TOKEN, + "", + ConfigInfo::CI_DEPRICATED, + false, + ConfigInfo::CI_INT, + MANDATORY, + "1", + STR_VALUE(MAX_NODES) }, + + { + CFG_NODE_ID, + "nodeid", + DB_TOKEN, "Number identifying the database node ("DB_TOKEN_PRINT")", ConfigInfo::CI_USED, false, @@ -1244,9 +1259,21 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { 0, 0 }, { - CFG_NODE_ID, + KEY_INTERNAL, "Id", API_TOKEN, + "", + ConfigInfo::CI_DEPRICATED, + false, + ConfigInfo::CI_INT, + MANDATORY, + "1", + STR_VALUE(MAX_NODES) }, + + { + CFG_NODE_ID, + "nodeid", + API_TOKEN, "Number identifying application node ("API_TOKEN_PRINT")", ConfigInfo::CI_USED, false, @@ -1375,9 +1402,21 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { 0, 0 }, { - CFG_NODE_ID, + KEY_INTERNAL, "Id", MGM_TOKEN, + "", + ConfigInfo::CI_DEPRICATED, + false, + ConfigInfo::CI_INT, + MANDATORY, + "1", + STR_VALUE(MAX_NODES) }, + + { + CFG_NODE_ID, + "nodeid", + MGM_TOKEN, "Number identifying the management server node ("MGM_TOKEN_PRINT")", ConfigInfo::CI_USED, false, @@ -2516,14 +2555,14 @@ bool transformNode(InitConfigFileParser::Context & ctx, const char * data){ Uint32 id; - if(!ctx.m_currentSection->get("Id", &id)){ + if(!ctx.m_currentSection->get("nodeid", &id) && !ctx.m_currentSection->get("Id", &id)){ Uint32 nextNodeId= 1; ctx.m_userProperties.get("NextNodeId", &nextNodeId); id= nextNodeId; while (ctx.m_userProperties.get("AllocatedNodeId_", id, &id)) id++; ctx.m_userProperties.put("NextNodeId", id+1, true); - ctx.m_currentSection->put("Id", id); + ctx.m_currentSection->put("nodeid", id); #if 0 ctx.reportError("Mandatory parameter Id missing from section " "[%s] starting at line: %d", @@ -2531,7 +2570,7 @@ transformNode(InitConfigFileParser::Context & ctx, const char * data){ return false; #endif } else if(ctx.m_userProperties.get("AllocatedNodeId_", id, &id)) { - ctx.reportError("Duplicate Id in section " + ctx.reportError("Duplicate nodeid in section " "[%s] starting at line: %d", ctx.fname, ctx.m_sectionLineno); return false; @@ -3356,6 +3395,7 @@ transform(InitConfigFileParser::Context & ctx, PropertiesType oldType; require(ctx.m_currentSection->getTypeOf(oldName, &oldType)); ConfigInfo::Type newType = ctx.m_info->getType(ctx.m_currentInfo, newName); + if(!((oldType == PropertiesType_Uint32 || oldType == PropertiesType_Uint64) && (newType == ConfigInfo::CI_INT || newType == ConfigInfo::CI_INT64 || newType == ConfigInfo::CI_BOOL))){ ndbout << "oldType: " << (int)oldType << ", newType: " << (int)newType << endl; diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index 822e10c89aa..fc03561e714 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -160,6 +160,13 @@ InitConfigFileParser::parseConfig(FILE * file) { ctx.reportError("Could not store section of configuration file."); return 0; } + + return run_config_rules(ctx); +} + +Config* +InitConfigFileParser::run_config_rules(Context& ctx) +{ for(size_t i = 0; ConfigInfo::m_ConfigRules[i].m_configRule != 0; i++){ ctx.type = InitConfigFileParser::Undefined; ctx.m_currentSection = 0; @@ -267,10 +274,10 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) } if (status == ConfigInfo::CI_DEPRICATED) { const char * desc = m_info->getDescription(ctx.m_currentInfo, fname); - if(desc){ + if(desc && desc[0]){ ctx.reportWarning("[%s] %s is depricated, use %s instead", ctx.fname, fname, desc); - } else { + } else if (desc == 0){ ctx.reportWarning("[%s] %s is depricated", ctx.fname, fname); } } @@ -588,3 +595,354 @@ InitConfigFileParser::Context::reportWarning(const char * fmt, ...){ ndbout << "Warning line " << m_lineno << ": " << buf << endl; va_end(ap); } + +#include +#include + +static int order = 1; +static +my_bool +parse_mycnf_opt(int, const struct my_option * opt, char * value) +{ + if(opt->comment) + ((struct my_option *)opt)->app_type++; + else + ((struct my_option *)opt)->app_type = order++; + return 0; +} + +bool +InitConfigFileParser::store_in_properties(Vector& options, + InitConfigFileParser::Context& ctx, + const char * name) +{ + for(unsigned i = 0; iput(options[i].name, (char*)options[i].value); + continue; + default: + abort(); + } + + const char * fname = options[i].name; + if (!m_info->verify(ctx.m_currentInfo, fname, value_int)) { + ctx.reportError("Illegal value %lld for parameter %s.\n" + "Legal values are between %Lu and %Lu", + value_int, fname, + m_info->getMin(ctx.m_currentInfo, fname), + m_info->getMax(ctx.m_currentInfo, fname)); + return false; + } + if (options[i].var_type == GET_INT) + ctx.m_currentSection->put(options[i].name, (Uint32)value_int); + else + ctx.m_currentSection->put(options[i].name, value_int); + } + } + return true; +} + +bool +InitConfigFileParser::handle_mycnf_defaults(Vector& options, + InitConfigFileParser::Context& ctx, + const char * name) +{ + strcpy(ctx.fname, name); + ctx.type = InitConfigFileParser::DefaultSection; + ctx.m_currentSection = new Properties(true); + ctx.m_userDefaults = NULL; + require((ctx.m_currentInfo = m_info->getInfo(ctx.fname)) != 0); + require((ctx.m_systemDefaults = m_info->getDefaults(ctx.fname)) != 0); + if(store_in_properties(options, ctx, name)) + return storeSection(ctx); + return false; +} + +static +int +load_defaults(Vector& options, const char* groups[]) +{ + int argc = 1; + const char * argv[] = { "ndb_mgmd", 0, 0, 0, 0 }; + BaseString file; + BaseString extra_file; + BaseString group_suffix; + + const char *save_file = defaults_file; + char *save_extra_file = defaults_extra_file; + const char *save_group_suffix = defaults_group_suffix; + + if (defaults_file) + { + file.assfmt("--defaults-file=%s", defaults_file); + argv[argc++] = file.c_str(); + } + + if (defaults_extra_file) + { + extra_file.assfmt("--defaults-extra-file=%s", defaults_extra_file); + argv[argc++] = extra_file.c_str(); + } + + if (defaults_group_suffix) + { + group_suffix.assfmt("--defaults-group-suffix=%s", defaults_group_suffix); + argv[argc++] = group_suffix.c_str(); + } + + char ** tmp = (char**)argv; + int ret = load_defaults("my", groups, &argc, &tmp); + + defaults_file = save_file; + defaults_extra_file = save_extra_file; + defaults_group_suffix = save_group_suffix; + + if (ret == 0) + { + return handle_options(&argc, &tmp, options.getBase(), parse_mycnf_opt); + } + + return ret; +} + +bool +InitConfigFileParser::load_mycnf_groups(Vector & options, + InitConfigFileParser::Context& ctx, + const char * name, + const char *groups[]) +{ + unsigned i; + Vector copy; + for(i = 0; i options; + for(i = 0; iapp_type < sections[i].src->app_type) + { + sect swap = sections[i]; + sections[i] = sections[j]; + sections[j] = swap; + } + } + } + + ctx.type = InitConfigFileParser::Section; + ctx.m_sectionLineno = ctx.m_lineno; + for(i = 0; sections[i].src; i++) + { + if (sections[i].src->app_type) + { + strcpy(ctx.fname, sections[i].name); + BaseString str(*(char**)sections[i].src->value); + Vector list; + str.split(list, ","); + + const char * defaults_groups[] = { 0, 0, 0 }; + for(unsigned j = 0; jname, j + 1); + group_host.assfmt("%s.%s.%s", groups[0], + sections[i].src->name, list[j].c_str()); + defaults_groups[0] = group_idx.c_str(); + if(list[j].length()) + defaults_groups[1] = group_host.c_str(); + else + defaults_groups[1] = 0; + + ctx.m_currentSection = new Properties(true); + ctx.m_userDefaults = getSection(ctx.fname, ctx.m_defaults); + require((ctx.m_currentInfo = m_info->getInfo(ctx.fname)) != 0); + require((ctx.m_systemDefaults = m_info->getDefaults(ctx.fname))!= 0); + ctx.m_currentSection->put("HostName", list[j].c_str()); + if(!load_mycnf_groups(options, ctx, sections[i].name, + defaults_groups)) + goto end; + + if(!storeSection(ctx)) + goto end; + } + } + } + } + + res = run_config_rules(ctx); + +end: + for(i = 0; options[i].name; i++) + free(options[i].value); + + return res; +} + +template class Vector; + +#if 0 +struct my_option +{ + const char *name; /* Name of the option */ + int id; /* unique id or short option */ + const char *comment; /* option comment, for autom. --help */ + gptr *value; /* The variable value */ + gptr *u_max_value; /* The user def. max variable value */ + const char **str_values; /* Pointer to possible values */ + ulong var_type; + enum get_opt_arg_type arg_type; + longlong def_value; /* Default value */ + longlong min_value; /* Min allowed value */ + longlong max_value; /* Max allowed value */ + longlong sub_size; /* Subtract this from given value */ + long block_size; /* Value should be a mult. of this */ + int app_type; /* To be used by an application */ +}; +#endif diff --git a/ndb/src/mgmsrv/InitConfigFileParser.hpp b/ndb/src/mgmsrv/InitConfigFileParser.hpp index 1ea0a094ccd..704a72ea082 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.hpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.hpp @@ -50,6 +50,7 @@ public: */ Config * parseConfig(FILE * file); Config * parseConfig(const char * filename); + Config * parse_mycnf(); /** * Parser context struct @@ -122,6 +123,21 @@ private: * Information about parameters (min, max values etc) */ ConfigInfo* m_info; + + bool handle_mycnf_defaults(Vector& options, + InitConfigFileParser::Context& ctx, + const char * name); + + bool load_mycnf_groups(Vector & options, + InitConfigFileParser::Context& ctx, + const char * name, + const char *groups[]); + + bool store_in_properties(Vector& options, + InitConfigFileParser::Context& ctx, + const char * name); + + Config* run_config_rules(Context& ctx); }; #endif // InitConfigFileParser_H diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index d946b4af4a7..45d0d19711b 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -433,8 +433,6 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server, m_newConfig = NULL; if (config_filename) m_configFilename.assign(config_filename); - else - m_configFilename.assign("config.ini"); m_nextConfigGenerationNumber = 0; @@ -469,7 +467,7 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server, _config= readConfig(); if (_config == 0) { ndbout << "Unable to read config file" << endl; - require(false); + exit(-1); } } diff --git a/ndb/src/mgmsrv/MgmtSrvrConfig.cpp b/ndb/src/mgmsrv/MgmtSrvrConfig.cpp index 6c4b4e9ae3c..94434b21e28 100644 --- a/ndb/src/mgmsrv/MgmtSrvrConfig.cpp +++ b/ndb/src/mgmsrv/MgmtSrvrConfig.cpp @@ -274,7 +274,15 @@ Config * MgmtSrvr::readConfig() { Config *conf; InitConfigFileParser parser; - conf = parser.parseConfig(m_configFilename.c_str()); + if (m_configFilename.length()) + { + conf = parser.parseConfig(m_configFilename.c_str()); + } + else + { + ndbout_c("Reading cluster configuration using my.cnf"); + conf = parser.parse_mycnf(); + } return conf; } diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index ec20101493e..f0c2ac298a5 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -102,6 +102,7 @@ static int opt_daemon; // NOT bool, bool need not be int static int opt_non_interactive; static int opt_interactive; static const char * opt_config_filename= 0; +static int opt_mycnf = 0; struct MgmGlobals { MgmGlobals(); @@ -166,6 +167,10 @@ static struct my_option my_long_options[] = "Don't run as daemon, but don't read from stdin", (gptr*) &opt_non_interactive, (gptr*) &opt_non_interactive, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "mycnf", 256, + "Read cluster config from my.cnf", + (gptr*) &opt_mycnf, (gptr*) &opt_mycnf, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -199,7 +204,7 @@ int main(int argc, char** argv) #endif global_mgmt_server_check = 1; - + const char *load_default_groups[]= { "mysql_cluster","ndb_mgmd",0 }; load_defaults("my",load_default_groups,&argc,&argv); @@ -217,13 +222,26 @@ int main(int argc, char** argv) opt_daemon= 0; } + if (opt_mycnf && opt_config_filename) + { + ndbout_c("Both --mycnf and -f is not supported"); + return 0; + } + + if (opt_mycnf == 0 && opt_config_filename == 0) + { + struct stat buf; + if (stat("config.ini", &buf) != -1) + opt_config_filename = "config.ini"; + } + glob->socketServer = new SocketServer(); MgmApiService * mapi = new MgmApiService(); glob->mgmObject = new MgmtSrvr(glob->socketServer, - opt_config_filename, - opt_connect_str); + opt_config_filename, + opt_connect_str); if (g_print_full_config) goto the_end; From 1e148ca472db5a181840dc909fa8b04eac5790f8 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 10:58:24 +0200 Subject: [PATCH 182/225] Tell the user that this ROLLBACK is added by mysqlbinlog (so that he does not wonder if it's present in binlog). This was brought up by Salle - thanks Salle. client/mysqlbinlog.cc: tell the user that this ROLLBACK is added by mysqlbinlog (so that he does not wonder if it's present in binlog) mysql-test/r/ctype_ucs_binlog.result: update mysql-test/r/mysqlbinlog.result: update mysql-test/r/mysqlbinlog2.result: update mysql-test/r/rpl_charset.result: update mysql-test/r/rpl_timezone.result: update mysql-test/r/user_var-binlog.result: update --- client/mysqlbinlog.cc | 2 +- mysql-test/r/ctype_ucs_binlog.result | 2 +- mysql-test/r/mysqlbinlog.result | 20 +++++------ mysql-test/r/mysqlbinlog2.result | 50 ++++++++++++++-------------- mysql-test/r/rpl_charset.result | 2 +- mysql-test/r/rpl_timezone.result | 2 +- mysql-test/r/user_var-binlog.result | 2 +- 7 files changed, 40 insertions(+), 40 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index eff05b9a8bf..5345d6d0f54 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -1434,7 +1434,7 @@ int main(int argc, char** argv) of transaction. */ fprintf(result_file, - "# End of log file\nROLLBACK;\n" + "# End of log file\nROLLBACK /* added by mysqlbinlog */;\n" "/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;\n"); if (disable_log_bin) fprintf(result_file, "/*!32316 SET SQL_LOG_BIN=@OLD_SQL_LOG_BIN*/;\n"); diff --git a/mysql-test/r/ctype_ucs_binlog.result b/mysql-test/r/ctype_ucs_binlog.result index fd4db66f6fe..14220a7df13 100644 --- a/mysql-test/r/ctype_ucs_binlog.result +++ b/mysql-test/r/ctype_ucs_binlog.result @@ -18,6 +18,6 @@ SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t2 values (@v); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; drop table t2; diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index e08d0b519b8..cab3d924dd2 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -40,7 +40,7 @@ load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-3-0' INTO table t1; SET TIMESTAMP=1000000000; load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-4-0' INTO table t1; # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- Broken LOAD DATA -- @@ -53,7 +53,7 @@ SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values ("Alas"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- --database -- @@ -62,7 +62,7 @@ ROLLBACK; ROLLBACK; SET INSERT_ID=1; # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- --position -- @@ -75,7 +75,7 @@ SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values ("Alas"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- Remote -- @@ -106,7 +106,7 @@ load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-3-2' INTO table t1; SET TIMESTAMP=1000000000; load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-4-2' INTO table t1; # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- Broken LOAD DATA -- @@ -119,7 +119,7 @@ SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values ("Alas"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- --database -- @@ -128,7 +128,7 @@ ROLLBACK; ROLLBACK; SET INSERT_ID=1; # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- --position -- @@ -141,7 +141,7 @@ SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values ("Alas"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- reading stdin -- @@ -154,7 +154,7 @@ BEGIN; SET TIMESTAMP=1108844555; insert t1 values (1); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; @@ -164,6 +164,6 @@ BEGIN; SET TIMESTAMP=1108844555; insert t1 values (1); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; drop table t1, t2; diff --git a/mysql-test/r/mysqlbinlog2.result b/mysql-test/r/mysqlbinlog2.result index 926c6f35c4b..eb5fb4a87f8 100644 --- a/mysql-test/r/mysqlbinlog2.result +++ b/mysql-test/r/mysqlbinlog2.result @@ -40,7 +40,7 @@ SET INSERT_ID=5; SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- offset -- @@ -67,7 +67,7 @@ SET INSERT_ID=5; SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- start-position -- @@ -84,7 +84,7 @@ SET INSERT_ID=5; SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- stop-position -- @@ -107,7 +107,7 @@ SET INSERT_ID=3; SET TIMESTAMP=1579609944; insert into t1 values(null, "c"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- start-datetime -- @@ -128,7 +128,7 @@ SET INSERT_ID=5; SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- stop-datetime -- @@ -148,7 +148,7 @@ SET INSERT_ID=2; SET TIMESTAMP=1579609942; insert into t1 values(null, "b"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- Local with 2 binlogs on command line -- @@ -184,7 +184,7 @@ SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values(null, "f"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- offset -- @@ -218,7 +218,7 @@ SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values(null, "f"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- start-position -- @@ -242,7 +242,7 @@ SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values(null, "f"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- stop-position -- @@ -272,7 +272,7 @@ SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); SET INSERT_ID=6; # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- start-datetime -- @@ -300,7 +300,7 @@ SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values(null, "f"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- stop-datetime -- @@ -320,7 +320,7 @@ SET INSERT_ID=2; SET TIMESTAMP=1579609942; insert into t1 values(null, "b"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- Remote -- @@ -349,7 +349,7 @@ SET INSERT_ID=5; SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- offset -- @@ -376,7 +376,7 @@ SET INSERT_ID=5; SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- start-position -- @@ -393,7 +393,7 @@ SET INSERT_ID=5; SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- stop-position -- @@ -416,7 +416,7 @@ SET INSERT_ID=3; SET TIMESTAMP=1579609944; insert into t1 values(null, "c"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- start-datetime -- @@ -437,7 +437,7 @@ SET INSERT_ID=5; SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- stop-datetime -- @@ -457,7 +457,7 @@ SET INSERT_ID=2; SET TIMESTAMP=1579609942; insert into t1 values(null, "b"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- Remote with 2 binlogs on command line -- @@ -493,7 +493,7 @@ SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values(null, "f"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- offset -- @@ -527,7 +527,7 @@ SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values(null, "f"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- start-position -- @@ -551,7 +551,7 @@ SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values(null, "f"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- stop-position -- @@ -581,7 +581,7 @@ SET TIMESTAMP=1579609946; insert into t1 values(null, "e"); SET INSERT_ID=6; # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- start-datetime -- @@ -609,7 +609,7 @@ SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; insert into t1 values(null, "f"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- stop-datetime -- @@ -629,7 +629,7 @@ SET INSERT_ID=2; SET TIMESTAMP=1579609942; insert into t1 values(null, "b"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- to-last-log -- @@ -661,7 +661,7 @@ SET INSERT_ID=6; SET TIMESTAMP=1579609943; insert into t1 values(null, "f"); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; --- end of test -- diff --git a/mysql-test/r/rpl_charset.result b/mysql-test/r/rpl_charset.result index 26403952bb9..28f694a3933 100644 --- a/mysql-test/r/rpl_charset.result +++ b/mysql-test/r/rpl_charset.result @@ -247,7 +247,7 @@ SET TIMESTAMP=1000000000; SET @@session.character_set_client=7,@@session.collation_connection=51,@@session.collation_server=30; INSERT INTO t1 (c1, c2) VALUES ('Ну, за рыбалку','Ну, за рыбалку'); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; drop table t1; create table `t1` ( diff --git a/mysql-test/r/rpl_timezone.result b/mysql-test/r/rpl_timezone.result index 9cfe793b9ba..64d05aa787e 100644 --- a/mysql-test/r/rpl_timezone.result +++ b/mysql-test/r/rpl_timezone.result @@ -64,7 +64,7 @@ SET TIMESTAMP=100000000; SET @@session.time_zone='Europe/Moscow'; insert into t1 values ('20040101000000'), ('20040611093902'); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; delete from t1; set time_zone='UTC'; diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result index e6f9ae1c82a..17ac8809d52 100644 --- a/mysql-test/r/user_var-binlog.result +++ b/mysql-test/r/user_var-binlog.result @@ -28,6 +28,6 @@ SET @`var2`:=_latin1 0x61 COLLATE `latin1_swedish_ci`; SET TIMESTAMP=10000; insert into t1 values (@var1),(@var2); # End of log file -ROLLBACK; +ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; drop table t1; From fea5dcaea1caada7fbd8dbd900336a960299a274 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 12:35:12 +0300 Subject: [PATCH 183/225] Small fixes. include/my_sys.h: Initialised TYPE_NOT_SET to zero to make sure no enum is added before it. server-tools/instance-manager/protocol.cc: Changed int to const int. --- include/my_sys.h | 2 +- server-tools/instance-manager/protocol.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/my_sys.h b/include/my_sys.h index ad42c99a86e..0a752e7b225 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -280,7 +280,7 @@ enum loglevel { enum cache_type { - TYPE_NOT_SET, READ_CACHE, WRITE_CACHE, + TYPE_NOT_SET= 0, READ_CACHE, WRITE_CACHE, SEQ_READ_APPEND /* sequential read or append */, READ_FIFO, READ_NET,WRITE_NET}; diff --git a/server-tools/instance-manager/protocol.cc b/server-tools/instance-manager/protocol.cc index 71c225e82c3..e14449746fd 100644 --- a/server-tools/instance-manager/protocol.cc +++ b/server-tools/instance-manager/protocol.cc @@ -74,7 +74,7 @@ int net_send_error(struct st_net *net, uint sql_errno) MYSQL_ERRMSG_SIZE]; // message char *pos= buff; - int ERROR_PACKET_CODE= 255; + const int ERROR_PACKET_CODE= 255; *pos++= ERROR_PACKET_CODE; int2store(pos, sql_errno); pos+= 2; @@ -95,7 +95,7 @@ int net_send_error_323(struct st_net *net, uint sql_errno) MYSQL_ERRMSG_SIZE]; // message char *pos= buff; - int ERROR_PACKET_CODE= 255; + const int ERROR_PACKET_CODE= 255; *pos++= ERROR_PACKET_CODE; int2store(pos, sql_errno); pos+= 2; From 8c570f3f561cfc3a0d52683ae8fa2662ab8139ff Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 11:39:49 +0200 Subject: [PATCH 184/225] ndb - add support for reading config.ini from ndb_config (as alternative to contacting ndb_mgmd) mysql-test/r/ndb_config.result: Add support for reading config.ini from ndb_config mysql-test/t/ndb_config.test: Add support for reading config.ini from ndb_config ndb/src/mgmsrv/InitConfigFileParser.cpp: Handle prinouts better ndb/src/mgmsrv/InitConfigFileParser.hpp: Handle prinouts better ndb/tools/ndb_config.cpp: Add support for reading config.ini from ndb_config --- mysql-test/r/ndb_config.result | 1 + mysql-test/t/ndb_config.test | 1 + ndb/src/mgmsrv/InitConfigFileParser.cpp | 19 ++- ndb/src/mgmsrv/InitConfigFileParser.hpp | 6 +- ndb/tools/ndb_config.cpp | 162 +++++++++++++++--------- 5 files changed, 119 insertions(+), 70 deletions(-) diff --git a/mysql-test/r/ndb_config.result b/mysql-test/r/ndb_config.result index f720b8e98df..506ac32f08e 100644 --- a/mysql-test/r/ndb_config.result +++ b/mysql-test/r/ndb_config.result @@ -3,3 +3,4 @@ ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3, mysqld,4, mysqld,5, mysqld,6, mysq 1 localhost 41943040 12582912 2 localhost 41943040 12582912 1 2 +ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3, mysqld,4, mysqld,5, mysqld,6, mysqld,7, diff --git a/mysql-test/t/ndb_config.test b/mysql-test/t/ndb_config.test index 66287bf6d29..0c24c794dbc 100644 --- a/mysql-test/t/ndb_config.test +++ b/mysql-test/t/ndb_config.test @@ -5,5 +5,6 @@ --exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null --exec $NDB_TOOLS_DIR/ndb_config --no-defaults -r \\n -f " " --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null --exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid --type=ndbd --host=localhost 2> /dev/null +--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=type,nodeid,host --config-file=$NDB_BACKUP_DIR/config.ini 2> /dev/null # End of 4.1 tests diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index 822e10c89aa..e0163b966c0 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -31,8 +31,10 @@ static void require(bool v) { if(!v) abort();} //**************************************************************************** // Ctor / Dtor //**************************************************************************** -InitConfigFileParser::InitConfigFileParser(){ +InitConfigFileParser::InitConfigFileParser(FILE * out) +{ m_info = new ConfigInfo(); + m_errstream = out ? out : stdout; } InitConfigFileParser::~InitConfigFileParser() { @@ -42,11 +44,12 @@ InitConfigFileParser::~InitConfigFileParser() { //**************************************************************************** // Read Config File //**************************************************************************** -InitConfigFileParser::Context::Context(const ConfigInfo * info) +InitConfigFileParser::Context::Context(const ConfigInfo * info, FILE * out) : m_userProperties(true), m_configValues(1000, 20) { m_config = new Properties(true); m_defaults = new Properties(true); + m_errstream = out; } InitConfigFileParser::Context::~Context(){ @@ -61,10 +64,10 @@ Config * InitConfigFileParser::parseConfig(const char * filename) { FILE * file = fopen(filename, "r"); if(file == 0){ - ndbout << "Error opening file: " << filename << endl; + fprintf(m_errstream, "Error opening file: %s\n", filename); return 0; } - + Config * ret = parseConfig(file); fclose(file); return ret; @@ -75,7 +78,7 @@ InitConfigFileParser::parseConfig(FILE * file) { char line[MAX_LINE_LENGTH]; - Context ctx(m_info); + Context ctx(m_info, m_errstream); ctx.m_lineno = 0; ctx.m_currentSection = 0; @@ -571,8 +574,9 @@ InitConfigFileParser::Context::reportError(const char * fmt, ...){ va_start(ap, fmt); if (fmt != 0) BaseString::vsnprintf(buf, sizeof(buf)-1, fmt, ap); - ndbout << "Error line " << m_lineno << ": " << buf << endl; va_end(ap); + fprintf(m_errstream, "Error line %d: %s\n", + m_lineno, buf); //m_currentSection->print(); } @@ -585,6 +589,7 @@ InitConfigFileParser::Context::reportWarning(const char * fmt, ...){ va_start(ap, fmt); if (fmt != 0) BaseString::vsnprintf(buf, sizeof(buf)-1, fmt, ap); - ndbout << "Warning line " << m_lineno << ": " << buf << endl; va_end(ap); + fprintf(m_errstream, "Warning line %d: %s\n", + m_lineno, buf); } diff --git a/ndb/src/mgmsrv/InitConfigFileParser.hpp b/ndb/src/mgmsrv/InitConfigFileParser.hpp index 1ea0a094ccd..39abf3f6811 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.hpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.hpp @@ -34,11 +34,12 @@ class ConfigInfo; * object if the config file has correct syntax and semantic. */ class InitConfigFileParser { + FILE * m_errstream; public: /** * Constructor */ - InitConfigFileParser(); + InitConfigFileParser(FILE * errstream = stdout); ~InitConfigFileParser(); /** @@ -60,7 +61,7 @@ public: * Context = Which section in init config file we are currently parsing */ struct Context { - Context(const ConfigInfo *); + Context(const ConfigInfo *, FILE * out); ~Context(); ContextSectionType type; ///< Section type (e.g. default section,section) @@ -82,6 +83,7 @@ public: ConfigValuesFactory m_configValues; // public: + FILE * m_errstream; void reportError(const char * msg, ...); void reportWarning(const char * msg, ...); }; diff --git a/ndb/tools/ndb_config.cpp b/ndb/tools/ndb_config.cpp index 725249a5af5..457021a4ec4 100644 --- a/ndb/tools/ndb_config.cpp +++ b/ndb/tools/ndb_config.cpp @@ -40,6 +40,7 @@ static const char * g_type = 0; static const char * g_host = 0; static const char * g_field_delimiter=","; static const char * g_row_delimiter=" "; +static const char * g_config_file = 0; int g_print_full_config, opt_ndb_shm; my_bool opt_core; @@ -90,6 +91,9 @@ static struct my_option my_long_options[] = { "rows", 'r', "Row separator", (gptr*) &g_row_delimiter, (gptr*) &g_row_delimiter, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + { "config-file", 256, "Path to config.ini", + (gptr*) &g_config_file, (gptr*) &g_config_file, + 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -124,7 +128,7 @@ struct Match { int m_key; BaseString m_value; - virtual int eval(NdbMgmHandle, const Iter&); + virtual int eval(const Iter&); }; struct Apply @@ -132,18 +136,21 @@ struct Apply Apply() {} Apply(int val) { m_key = val;} int m_key; - virtual int apply(NdbMgmHandle, const Iter&); + virtual int apply(const Iter&); }; struct NodeTypeApply : public Apply { - virtual int apply(NdbMgmHandle, const Iter&); + virtual int apply(const Iter&); }; static int parse_query(Vector&, int &argc, char**& argv); static int parse_where(Vector&, int &argc, char**& argv); -static int eval(NdbMgmHandle, const Iter&, const Vector&); -static int apply(NdbMgmHandle, const Iter&, const Vector&); +static int eval(const Iter&, const Vector&); +static int apply(const Iter&, const Vector&); +static ndb_mgm_configuration* fetch_configuration(); +static ndb_mgm_configuration* load_configuration(); + int main(int argc, char** argv){ NDB_INIT(argv[0]); @@ -154,52 +161,12 @@ main(int argc, char** argv){ ndb_std_get_one_option))) return -1; - NdbMgmHandle mgm = ndb_mgm_create_handle(); - if(mgm == NULL) { - fprintf(stderr, "Cannot create handle to management server.\n"); - exit(-1); - } + ndb_mgm_configuration * conf = 0; - ndb_mgm_set_error_stream(mgm, stderr); - - if (ndb_mgm_set_connectstring(mgm, g_connectstring)) - { - fprintf(stderr, "* %5d: %s\n", - ndb_mgm_get_latest_error(mgm), - ndb_mgm_get_latest_error_msg(mgm)); - fprintf(stderr, - "* %s", ndb_mgm_get_latest_error_desc(mgm)); - exit(-1); - } - - if(ndb_mgm_connect(mgm, try_reconnect-1, 5, 1)) - { - fprintf(stderr, "Connect failed"); - fprintf(stderr, " code: %d, msg: %s\n", - ndb_mgm_get_latest_error(mgm), - ndb_mgm_get_latest_error_msg(mgm)); - exit(-1); - } - else if(g_verbose) - { - fprintf(stderr, "Connected to %s:%d\n", - ndb_mgm_get_connected_host(mgm), - ndb_mgm_get_connected_port(mgm)); - } - - ndb_mgm_configuration * conf = ndb_mgm_get_configuration(mgm, 0); - if(conf == 0) - { - fprintf(stderr, "Could not get configuration"); - fprintf(stderr, "code: %d, msg: %s\n", - ndb_mgm_get_latest_error(mgm), - ndb_mgm_get_latest_error_msg(mgm)); - exit(-1); - } - else if(g_verbose) - { - fprintf(stderr, "Fetched configuration\n"); - } + if (g_config_file) + conf = load_configuration(); + else + conf = fetch_configuration(); Vector select_list; Vector where_clause; @@ -224,12 +191,12 @@ main(int argc, char** argv){ iter.first(); for(iter.first(); iter.valid(); iter.next()) { - if(eval(mgm, iter, where_clause)) + if(eval(iter, where_clause)) { if(prev) printf("%s", g_row_delimiter); prev= true; - apply(mgm, iter, select_list); + apply(iter, select_list); } } printf("\n"); @@ -323,11 +290,11 @@ template class Vector; static int -eval(NdbMgmHandle mgm, const Iter& iter, const Vector& where) +eval(const Iter& iter, const Vector& where) { for(unsigned i = 0; ieval(mgm, iter) == 0) + if(where[i]->eval(iter) == 0) return 0; } @@ -336,11 +303,11 @@ eval(NdbMgmHandle mgm, const Iter& iter, const Vector& where) static int -apply(NdbMgmHandle mgm, const Iter& iter, const Vector& list) +apply(const Iter& iter, const Vector& list) { for(unsigned i = 0; iapply(mgm, iter); + list[i]->apply(iter); if(i + 1 != list.size()) printf("%s", g_field_delimiter); } @@ -348,19 +315,19 @@ apply(NdbMgmHandle mgm, const Iter& iter, const Vector& list) } int -Match::eval(NdbMgmHandle h, const Iter& iter) +Match::eval(const Iter& iter) { Uint32 val32; Uint64 val64; const char* valc; if (iter.get(m_key, &val32) == 0) { - if(atoi(m_value.c_str()) != val32) + if(atoi(m_value.c_str()) != (int)val32) return 0; } else if(iter.get(m_key, &val64) == 0) { - if(strtoll(m_value.c_str(), (char **)NULL, 10) != val64) + if(strtoll(m_value.c_str(), (char **)NULL, 10) != (long long)val64) return 0; } else if(iter.get(m_key, &valc) == 0) @@ -376,7 +343,7 @@ Match::eval(NdbMgmHandle h, const Iter& iter) } int -Apply::apply(NdbMgmHandle h, const Iter& iter) +Apply::apply(const Iter& iter) { Uint32 val32; Uint64 val64; @@ -397,7 +364,7 @@ Apply::apply(NdbMgmHandle h, const Iter& iter) } int -NodeTypeApply::apply(NdbMgmHandle h, const Iter& iter) +NodeTypeApply::apply(const Iter& iter) { Uint32 val32; if (iter.get(CFG_TYPE_OF_SECTION, &val32) == 0) @@ -406,3 +373,76 @@ NodeTypeApply::apply(NdbMgmHandle h, const Iter& iter) } return 0; } + +ndb_mgm_configuration* +fetch_configuration() +{ + ndb_mgm_configuration* conf = 0; + NdbMgmHandle mgm = ndb_mgm_create_handle(); + if(mgm == NULL) { + fprintf(stderr, "Cannot create handle to management server.\n"); + return 0; + } + + ndb_mgm_set_error_stream(mgm, stderr); + + if (ndb_mgm_set_connectstring(mgm, g_connectstring)) + { + fprintf(stderr, "* %5d: %s\n", + ndb_mgm_get_latest_error(mgm), + ndb_mgm_get_latest_error_msg(mgm)); + fprintf(stderr, + "* %s", ndb_mgm_get_latest_error_desc(mgm)); + goto noconnect; + } + + if(ndb_mgm_connect(mgm, try_reconnect-1, 5, 1)) + { + fprintf(stderr, "Connect failed"); + fprintf(stderr, " code: %d, msg: %s\n", + ndb_mgm_get_latest_error(mgm), + ndb_mgm_get_latest_error_msg(mgm)); + goto noconnect; + } + else if(g_verbose) + { + fprintf(stderr, "Connected to %s:%d\n", + ndb_mgm_get_connected_host(mgm), + ndb_mgm_get_connected_port(mgm)); + } + + conf = ndb_mgm_get_configuration(mgm, 0); + if(conf == 0) + { + fprintf(stderr, "Could not get configuration"); + fprintf(stderr, "code: %d, msg: %s\n", + ndb_mgm_get_latest_error(mgm), + ndb_mgm_get_latest_error_msg(mgm)); + } + else if(g_verbose) + { + fprintf(stderr, "Fetched configuration\n"); + } + + ndb_mgm_disconnect(mgm); +noconnect: + ndb_mgm_destroy_handle(&mgm); + + return conf; +} + +#include + +ndb_mgm_configuration* +load_configuration() +{ + InitConfigFileParser parser(stderr); + if (g_verbose) + fprintf(stderr, "Using config.ini : %s", g_config_file); + + Config* conf = parser.parseConfig(g_config_file); + if (conf) + return conf->m_configValues; + + return 0; +} From 31f7a0e831b2cd2ecf85ba61dfafdbea6da98d4c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 12:01:39 +0200 Subject: [PATCH 185/225] duplicate error message removed mysql-test/r/innodb.result: after merge fix --- mysql-test/r/innodb.result | 6 +++--- mysql-test/r/type_decimal.result | 2 +- mysql-test/r/type_float.result | 4 ++-- mysql-test/r/type_newdecimal.result | 2 +- mysql-test/t/type_float.test | 4 ++-- sql/share/errmsg.txt | 10 ++++------ sql/sql_parse.cc | 2 +- 7 files changed, 14 insertions(+), 16 deletions(-) diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index e7a543a9613..3fcdccceed6 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -2625,11 +2625,11 @@ test.test_checksum 1531596814 insert into test_checksum values(3); checksum table test_checksum; Table Checksum -test.test_checksum 1531596814 +test.test_checksum 2605035534 commit; checksum table test_checksum; Table Checksum -test.test_checksum 2050879373 +test.test_checksum 127268899 commit; drop table test_checksum; create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; @@ -2642,5 +2642,5 @@ set autocommit=1; insert into test_checksum values(3); checksum table test_checksum; Table Checksum -test.test_checksum 2050879373 +test.test_checksum 127268899 drop table test_checksum; diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index 56a2bceeccf..d7f5f9fa328 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -476,7 +476,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp CREATE TABLE t1 (a_dec DECIMAL(-1,1)); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1,1))' at line 1 CREATE TABLE t1 (a_dec DECIMAL(0,11)); -ERROR 42000: Scale may not be larger than the precision (column 'a_dec'). +ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 'a_dec'). create table t1(a decimal(7,3)); insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000'); select * from t1; diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index fc7e4c5f346..6b124caac14 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -226,6 +226,6 @@ reckey recdesc 109 Has 109 as key drop table t1; create table t1 (s1 float(0,2)); -ERROR 42000: For float(M,D) or double(M,D), M must be >= D (column 's1'). +ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1'). create table t1 (s1 float(1,2)); -ERROR 42000: For float(M,D) or double(M,D), M must be >= D (column 's1'). +ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1'). diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index 17ebab1c6e7..be5e29ab662 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -936,7 +936,7 @@ ERROR 42000: Too big scale 31 specified for column 'sl'. Maximum is 30. create table t1 (sl decimal(0,38)); ERROR 42000: Too big scale 38 specified for column 'sl'. Maximum is 30. create table t1 (sl decimal(0,30)); -ERROR 42000: Scale may not be larger than the precision (column 'sl'). +ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 'sl'). create table t1 (sl decimal(5, 5)); show create table t1; Table Create Table diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index 2deec5ec63b..cf2a2676ab0 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -152,7 +152,7 @@ drop table t1; # bug #12694 (float(m,d) specifications) # ---error 1453 +--error 1427 create table t1 (s1 float(0,2)); ---error 1453 +--error 1427 create table t1 (s1 float(1,2)); diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index f2a91d5b88b..d3964fe6e52 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5366,12 +5366,12 @@ ER_TOO_BIG_SCALE 42000 S1009 eng "Too big scale %d specified for column '%-.64s'. Maximum is %d." ER_TOO_BIG_PRECISION 42000 S1009 eng "Too big precision %d specified for column '%-.64s'. Maximum is %d." -ER_SCALE_BIGGER_THAN_PRECISION 42000 S1009 - eng "Scale may not be larger than the precision (column '%-.64s')." +ER_M_BIGGER_THAN_D 42000 S1009 + eng "For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.64s')." ER_WRONG_LOCK_OF_SYSTEM_TABLE eng "You can't combine write-locking of system '%-.64s.%-.64s' table with other tables" ER_CONNECT_TO_FOREIGN_DATA_SOURCE - eng "Unable to connect to foreign data source - database '%s'!" + eng "Unable to connect to foreign data source - database '%.64s'!" ER_QUERY_ON_FOREIGN_DATA_SOURCE eng "There was a problem processing the query on the foreign data source. Data source error: '%-.64s'" ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST @@ -5400,7 +5400,7 @@ ER_DATETIME_FUNCTION_OVERFLOW 22008 ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG eng "Can't update table '%-.64s' in stored function/trigger because it is already used by statement which invoked this stored function/trigger." ER_VIEW_PREVENT_UPDATE - eng "The definition of table '%-.64s' prevents operation %s on table '%-.64s'." + eng "The definition of table '%-.64s' prevents operation %.64s on table '%-.64s'." ER_PS_NO_RECURSION eng "The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive manner" ER_SP_CANT_SET_AUTOCOMMIT @@ -5419,5 +5419,3 @@ ER_ROW_IS_REFERENCED_2 23000 eng "Cannot delete or update a parent row: a foreign key constraint fails (%.192s)" ER_NO_REFERENCED_ROW_2 23000 eng "Cannot add or update a child row: a foreign key constraint fails (%.192s)" -ER_M_BIGGER_THAN_D 42000 S1009 - eng "For float(M,D) or double(M,D), M must be >= D (column '%-.64s')." diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 46740460526..71bb86d4233 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5751,7 +5751,7 @@ new_create_field(THD *thd, char *field_name, enum_field_types type, } if (new_field->length < new_field->decimals) { - my_error(ER_SCALE_BIGGER_THAN_PRECISION, MYF(0), field_name); + my_error(ER_M_BIGGER_THAN_D, MYF(0), field_name); DBUG_RETURN(NULL); } new_field->length= From dbc721452094d903f6209e1751a1e29569a06f7e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 12:19:15 +0200 Subject: [PATCH 186/225] ndb Add support/test for using my.cnf [cluster_config] mysql-test/r/ndb_config.result: Add support for ndb_config to read my.cnf mysql-test/t/ndb_config.test: Add support for ndb_config to read my.cnf ndb/src/mgmsrv/InitConfigFileParser.cpp: merge ndb/tools/ndb_config.cpp: Add support for ndb_config to read my.cnf mysql-test/std_data/ndb_config_mycnf1.cnf: New BitKeeper file ``mysql-test/std_data/ndb_config_mycnf1.cnf'' --- mysql-test/r/ndb_config.result | 3 ++- mysql-test/std_data/ndb_config_mycnf1.cnf | 15 +++++++++++++ mysql-test/t/ndb_config.test | 2 ++ ndb/src/mgmsrv/InitConfigFileParser.cpp | 2 +- ndb/tools/ndb_config.cpp | 27 +++++++++++++++++++---- 5 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 mysql-test/std_data/ndb_config_mycnf1.cnf diff --git a/mysql-test/r/ndb_config.result b/mysql-test/r/ndb_config.result index d8e1dc2aad2..629d37f1e5e 100644 --- a/mysql-test/r/ndb_config.result +++ b/mysql-test/r/ndb_config.result @@ -3,4 +3,5 @@ ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysql 1 localhost 41943040 12582912 2 localhost 41943040 12582912 1 2 -ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3, mysqld,4, mysqld,5, mysqld,6, mysqld,7, +ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysqld,6, mysqld,7, +ndbd,1,localhost,52428800,26214400 ndbd,2,localhost,52428800,36700160 ndbd,3,localhost,52428800,52428800 ndbd,4,localhost,52428800,52428800 ndb_mgmd,5,localhost,, mysqld,6,localhost,, diff --git a/mysql-test/std_data/ndb_config_mycnf1.cnf b/mysql-test/std_data/ndb_config_mycnf1.cnf new file mode 100644 index 00000000000..c680bfd8fa3 --- /dev/null +++ b/mysql-test/std_data/ndb_config_mycnf1.cnf @@ -0,0 +1,15 @@ +[cluster_config] +NoOfReplicas=1 +DataMemory=50M + +[cluster_config.jonas] +IndexMemory=50M +ndbd = localhost,localhost,localhost,localhost +ndb_mgmd = localhost +mysqld = localhost + +[cluster_config.ndbd.1] +DataMemory=25M + +[cluster_config.ndbd.2.jonas] +DataMemory=35M diff --git a/mysql-test/t/ndb_config.test b/mysql-test/t/ndb_config.test index 2c919fbd70c..9d1c107472f 100644 --- a/mysql-test/t/ndb_config.test +++ b/mysql-test/t/ndb_config.test @@ -9,3 +9,5 @@ --exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=type,nodeid,host --config-file=$NDB_BACKUP_DIR/config.ini 2> /dev/null # End of 4.1 tests + +--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.jonas --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf1.cnf --query=type,nodeid,host,IndexMemory,DataMemory --mycnf 2> /dev/null diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index 00c094f83ad..233458ddf83 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -843,7 +843,7 @@ InitConfigFileParser::parse_mycnf() } - Context ctx(m_info); + Context ctx(m_info, m_errstream); const char *groups[]= { "cluster_config", 0 }; if (load_defaults(options, groups)) goto end; diff --git a/ndb/tools/ndb_config.cpp b/ndb/tools/ndb_config.cpp index 457021a4ec4..c7c87f8cc37 100644 --- a/ndb/tools/ndb_config.cpp +++ b/ndb/tools/ndb_config.cpp @@ -41,6 +41,7 @@ static const char * g_host = 0; static const char * g_field_delimiter=","; static const char * g_row_delimiter=" "; static const char * g_config_file = 0; +static int g_mycnf = 0; int g_print_full_config, opt_ndb_shm; my_bool opt_core; @@ -94,6 +95,9 @@ static struct my_option my_long_options[] = { "config-file", 256, "Path to config.ini", (gptr*) &g_config_file, (gptr*) &g_config_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + { "mycnf", 256, "Read config from my.cnf", + (gptr*) &g_mycnf, (gptr*) &g_mycnf, + 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -163,11 +167,16 @@ main(int argc, char** argv){ ndb_mgm_configuration * conf = 0; - if (g_config_file) + if (g_config_file || g_mycnf) conf = load_configuration(); else conf = fetch_configuration(); + if (conf == 0) + { + return -1; + } + Vector select_list; Vector where_clause; @@ -437,10 +446,20 @@ ndb_mgm_configuration* load_configuration() { InitConfigFileParser parser(stderr); - if (g_verbose) - fprintf(stderr, "Using config.ini : %s", g_config_file); + if (g_config_file) + { + if (g_verbose) + fprintf(stderr, "Using config.ini : %s", g_config_file); + + Config* conf = parser.parseConfig(g_config_file); + if (conf) + return conf->m_configValues; + } - Config* conf = parser.parseConfig(g_config_file); + if (g_verbose) + fprintf(stderr, "Using my.cnf"); + + Config* conf = parser.parse_mycnf(); if (conf) return conf->m_configValues; From b8ad9d14612234b7c6e30302359a8c1054bf5a3c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 14:20:15 +0400 Subject: [PATCH 187/225] BUG#13081: Disable ROR-index_merge for NDB tables (by adding a HA_KEY_SCAN_NOT_ROR index flag) as NDB index scans are not guaranteed to be ROR scans. --- sql/ha_ndbcluster.cc | 3 ++- sql/handler.h | 7 +++++++ sql/opt_range.cc | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 709a7ed14e0..5018aa2990e 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -1209,7 +1209,8 @@ inline ulong ha_ndbcluster::index_flags(uint idx_no, uint part, DBUG_ENTER("ha_ndbcluster::index_flags"); DBUG_PRINT("info", ("idx_no: %d", idx_no)); DBUG_ASSERT(get_index_type_from_table(idx_no) < index_flags_size); - DBUG_RETURN(index_type_flags[get_index_type_from_table(idx_no)]); + DBUG_RETURN(index_type_flags[get_index_type_from_table(idx_no)] | + HA_KEY_SCAN_NOT_ROR); } static void shrink_varchar(Field* field, const byte* & ptr, char* buf) diff --git a/sql/handler.h b/sql/handler.h index f4f6a8592bb..50f697bc980 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -98,6 +98,13 @@ #define HA_ONLY_WHOLE_INDEX 16 /* Can't use part key searches */ #define HA_KEYREAD_ONLY 64 /* Support HA_EXTRA_KEYREAD */ +/* + Index scan will not return records in rowid order. Not guaranteed to be + set for unordered (e.g. HASH) indexes. +*/ +#define HA_KEY_SCAN_NOT_ROR 128 + + /* operations for disable/enable indexes */ #define HA_KEY_SWITCH_NONUNIQ 0 #define HA_KEY_SWITCH_ALL 1 diff --git a/sql/opt_range.cc b/sql/opt_range.cc index caefdf92633..d6b9ec282e0 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -5117,6 +5117,8 @@ check_quick_select(PARAM *param,uint idx,SEL_ARG *tree) if (cpk_scan) param->is_ror_scan= TRUE; } + if (param->table->file->index_flags(key, 0, TRUE) & HA_KEY_SCAN_NOT_ROR) + param->is_ror_scan= FALSE; DBUG_PRINT("exit", ("Records: %lu", (ulong) records)); DBUG_RETURN(records); } From 7337ba761ed1942888909f6587b2aa9d6d5bb0be Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 12:22:00 +0200 Subject: [PATCH 188/225] ndb_config Check returnvalue on load/fetch configuration ndb/tools/ndb_config.cpp: Check returnvalue on load/fetch configuration --- ndb/tools/ndb_config.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ndb/tools/ndb_config.cpp b/ndb/tools/ndb_config.cpp index 457021a4ec4..78a2fa38fba 100644 --- a/ndb/tools/ndb_config.cpp +++ b/ndb/tools/ndb_config.cpp @@ -168,6 +168,11 @@ main(int argc, char** argv){ else conf = fetch_configuration(); + if (conf == 0) + { + return -1; + } + Vector select_list; Vector where_clause; From cc430c68b09380371b7dc259c3fc954d607eda8d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 12:44:45 +0200 Subject: [PATCH 189/225] Change "mf_keycache.c" so that it can be compiled without thread support (bug#11680): "configure --without-server" (without giving "--enable-thread-safe-client"). mysys/mf_keycache.c: This module is needed both in the server (multi-threaded) and in some myisam tools (single-threaded). For the latter use, compilation failed in a "configure --without-server" as thread support was not defined then (unless "--enable-thread-safe-client" was also given, but this should not be required). The solution is to guard all threading operations in "#ifdef THREAD", and in the "#else" case adding assertions where appropriate. This fixes bug#11680. Also minor cleanup: Delete an unused variable, change "return" -> "DBUG_RETURN" in one place. --- mysys/mf_keycache.c | 72 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 70 insertions(+), 2 deletions(-) diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index cb2e0c98e8a..35cd65f759d 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -161,10 +161,12 @@ KEY_CACHE *dflt_key_cache= &dflt_key_cache_var; #define FLUSH_CACHE 2000 /* sort this many blocks at once */ static int flush_all_key_blocks(KEY_CACHE *keycache); +#ifdef THREAD static void link_into_queue(KEYCACHE_WQUEUE *wqueue, struct st_my_thread_var *thread); static void unlink_from_queue(KEYCACHE_WQUEUE *wqueue, struct st_my_thread_var *thread); +#endif static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block); static void test_key_cache(KEY_CACHE *keycache, const char *where, my_bool lock); @@ -215,6 +217,7 @@ static void keycache_debug_print _VARARGS((const char *fmt,...)); #endif /* defined(KEYCACHE_DEBUG_LOG) && defined(KEYCACHE_DEBUG) */ #if defined(KEYCACHE_DEBUG) || !defined(DBUG_OFF) +#ifdef THREAD static long keycache_thread_id; #define KEYCACHE_THREAD_TRACE(l) \ KEYCACHE_DBUG_PRINT(l,("|thread %ld",keycache_thread_id)) @@ -226,6 +229,11 @@ static long keycache_thread_id; #define KEYCACHE_THREAD_TRACE_END(l) \ KEYCACHE_DBUG_PRINT(l,("]thread %ld",keycache_thread_id)) +#else /* THREAD */ +#define KEYCACHE_THREAD_TRACE(l) KEYCACHE_DBUG_PRINT(l,("")) +#define KEYCACHE_THREAD_TRACE_BEGIN(l) KEYCACHE_DBUG_PRINT(l,("")) +#define KEYCACHE_THREAD_TRACE_END(l) KEYCACHE_DBUG_PRINT(l,("")) +#endif /* THREAD */ #else #define KEYCACHE_THREAD_TRACE_BEGIN(l) #define KEYCACHE_THREAD_TRACE_END(l) @@ -492,6 +500,7 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, keycache_pthread_mutex_lock(&keycache->cache_lock); +#ifdef THREAD wqueue= &keycache->resize_queue; thread= my_thread_var; link_into_queue(wqueue, thread); @@ -500,6 +509,7 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, { keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock); } +#endif keycache->resize_in_flush= 1; if (flush_all_key_blocks(keycache)) @@ -512,12 +522,16 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, } keycache->resize_in_flush= 0; keycache->can_be_used= 0; +#ifdef THREAD while (keycache->cnt_for_resize_op) { KEYCACHE_DBUG_PRINT("resize_key_cache: wait", ("suspend thread %ld", thread->id)); keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock); } +#else + KEYCACHE_DBUG_ASSERT(keycache->cnt_for_resize_op == 0); +#endif end_key_cache(keycache, 0); /* Don't free mutex */ /* The following will work even if use_mem is 0 */ @@ -525,6 +539,7 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, division_limit, age_threshold); finish: +#ifdef THREAD unlink_from_queue(wqueue, thread); /* Signal for the next resize request to proceeed if any */ if (wqueue->last_thread) @@ -533,6 +548,7 @@ finish: ("thread %ld", wqueue->last_thread->next->id)); keycache_pthread_cond_signal(&wqueue->last_thread->next->suspend); } +#endif keycache_pthread_mutex_unlock(&keycache->cache_lock); return blocks; } @@ -553,6 +569,7 @@ static inline void inc_counter_for_resize_op(KEY_CACHE *keycache) */ static inline void dec_counter_for_resize_op(KEY_CACHE *keycache) { +#ifdef THREAD struct st_my_thread_var *last_thread; if (!--keycache->cnt_for_resize_op && (last_thread= keycache->resize_queue.last_thread)) @@ -561,6 +578,9 @@ static inline void dec_counter_for_resize_op(KEY_CACHE *keycache) ("thread %ld", last_thread->next->id)); keycache_pthread_cond_signal(&last_thread->next->suspend); } +#else + keycache->cnt_for_resize_op--; +#endif } /* @@ -649,6 +669,7 @@ writes: %ld r_requests: %ld reads: %ld", } /* end_key_cache */ +#ifdef THREAD /* Link a thread into double-linked queue of waiting threads. @@ -785,6 +806,7 @@ static void release_queue(KEYCACHE_WQUEUE *wqueue) while (thread != last); wqueue->last_thread= NULL; } +#endif /* @@ -892,6 +914,7 @@ static void link_block(KEY_CACHE *keycache, BLOCK_LINK *block, my_bool hot, BLOCK_LINK **pins; KEYCACHE_DBUG_ASSERT(! (block->hash_link && block->hash_link->requests)); +#ifdef THREAD if (!hot && keycache->waiting_for_block.last_thread) { /* Signal that in the LRU warm sub-chain an available block has appeared */ @@ -928,6 +951,10 @@ static void link_block(KEY_CACHE *keycache, BLOCK_LINK *block, my_bool hot, #endif return; } +#else /* THREAD */ + KEYCACHE_DBUG_ASSERT(! (!hot && keycache->waiting_for_block.last_thread)); + /* Condition not transformed using DeMorgan, to keep the text identical */ +#endif /* THREAD */ pins= hot ? &keycache->used_ins : &keycache->used_last; ins= *pins; if (ins) @@ -1100,6 +1127,7 @@ static inline void remove_reader(BLOCK_LINK *block) static inline void wait_for_readers(KEY_CACHE *keycache, BLOCK_LINK *block) { +#ifdef THREAD struct st_my_thread_var *thread= my_thread_var; while (block->hash_link->requests) { @@ -1110,6 +1138,9 @@ static inline void wait_for_readers(KEY_CACHE *keycache, BLOCK_LINK *block) keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock); block->condvar= NULL; } +#else + KEYCACHE_DBUG_ASSERT(block->hash_link->requests == 0); +#endif } @@ -1139,6 +1170,7 @@ static void unlink_hash(KEY_CACHE *keycache, HASH_LINK *hash_link) if ((*hash_link->prev= hash_link->next)) hash_link->next->prev= hash_link->prev; hash_link->block= NULL; +#ifdef THREAD if (keycache->waiting_for_hash_link.last_thread) { /* Signal that a free hash link has appeared */ @@ -1174,6 +1206,9 @@ static void unlink_hash(KEY_CACHE *keycache, HASH_LINK *hash_link) hash_link); return; } +#else /* THREAD */ + KEYCACHE_DBUG_ASSERT(! (keycache->waiting_for_hash_link.last_thread)); +#endif /* THREAD */ hash_link->next= keycache->free_hash_list; keycache->free_hash_list= hash_link; } @@ -1239,6 +1274,7 @@ restart: } else { +#ifdef THREAD /* Wait for a free hash link */ struct st_my_thread_var *thread= my_thread_var; KEYCACHE_DBUG_PRINT("get_hash_link", ("waiting")); @@ -1251,6 +1287,9 @@ restart: keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock); thread->opt_info= NULL; +#else + KEYCACHE_DBUG_ASSERT(0); +#endif goto restart; } hash_link->file= file; @@ -1362,6 +1401,7 @@ restart: /* Wait intil the page is flushed on disk */ hash_link->requests--; { +#ifdef THREAD struct st_my_thread_var *thread= my_thread_var; add_to_queue(&block->wqueue[COND_FOR_SAVED], thread); do @@ -1372,6 +1412,16 @@ restart: &keycache->cache_lock); } while(thread->next); +#else + KEYCACHE_DBUG_ASSERT(0); + /* + Given the use of "resize_in_flush", it seems impossible + that this whole branch is ever entered in single-threaded case + because "(wrmode && keycache->resize_in_flush)" cannot be true. + TODO: Check this, and then put the whole branch into the + "#ifdef THREAD" guard. + */ +#endif } /* Invalidate page in the block if it has not been done yet */ if (block->status) @@ -1400,6 +1450,7 @@ restart: KEYCACHE_DBUG_PRINT("find_key_block", ("request waiting for old page to be saved")); { +#ifdef THREAD struct st_my_thread_var *thread= my_thread_var; /* Put the request into the queue of those waiting for the old page */ add_to_queue(&block->wqueue[COND_FOR_SAVED], thread); @@ -1412,6 +1463,10 @@ restart: &keycache->cache_lock); } while(thread->next); +#else + KEYCACHE_DBUG_ASSERT(0); + /* No parallel requests in single-threaded case */ +#endif } KEYCACHE_DBUG_PRINT("find_key_block", ("request for old page resubmitted")); @@ -1470,6 +1525,7 @@ restart: all of them must get the same block */ +#ifdef THREAD if (! keycache->used_last) { struct st_my_thread_var *thread= my_thread_var; @@ -1485,6 +1541,9 @@ restart: while (thread->next); thread->opt_info= NULL; } +#else + KEYCACHE_DBUG_ASSERT(keycache->used_last); +#endif block= hash_link->block; if (! block) { @@ -1673,6 +1732,7 @@ static void read_block(KEY_CACHE *keycache, KEYCACHE_DBUG_PRINT("read_block", ("secondary request waiting for new page to be read")); { +#ifdef THREAD struct st_my_thread_var *thread= my_thread_var; /* Put the request into a queue and wait until it can be processed */ add_to_queue(&block->wqueue[COND_FOR_REQUESTED], thread); @@ -1684,6 +1744,10 @@ static void read_block(KEY_CACHE *keycache, &keycache->cache_lock); } while (thread->next); +#else + KEYCACHE_DBUG_ASSERT(0); + /* No parallel requests in single-threaded case */ +#endif } KEYCACHE_DBUG_PRINT("read_block", ("secondary request: new page in cache")); @@ -1821,7 +1885,7 @@ byte *key_cache_read(KEY_CACHE *keycache, #ifndef THREAD /* This is only true if we where able to read everything in one block */ if (return_buffer) - return (block->buffer); + DBUG_RETURN(block->buffer); #endif buff+= read_length; filepos+= read_length+offset; @@ -2397,6 +2461,7 @@ restart: #endif block= first_in_switch; { +#ifdef THREAD struct st_my_thread_var *thread= my_thread_var; add_to_queue(&block->wqueue[COND_FOR_SAVED], thread); do @@ -2407,6 +2472,10 @@ restart: &keycache->cache_lock); } while (thread->next); +#else + KEYCACHE_DBUG_ASSERT(0); + /* No parallel requests in single-threaded case */ +#endif } #if defined(KEYCACHE_DEBUG) cnt++; @@ -2573,7 +2642,6 @@ static void test_key_cache(KEY_CACHE *keycache __attribute__((unused)), static void keycache_dump(KEY_CACHE *keycache) { FILE *keycache_dump_file=fopen(KEYCACHE_DUMP_FILE, "w"); - struct st_my_thread_var *thread_var= my_thread_var; struct st_my_thread_var *last; struct st_my_thread_var *thread; BLOCK_LINK *block; From a14a34be6c48624af7d03faf8631a5c794cce9be Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 13:58:00 +0300 Subject: [PATCH 190/225] InnoDB: On UPDATE, trim UCS2 columns correctly. (Bug #12178) sql/ha_innodb.cc: innobase_convert_and_store_changed_col(), calc_row_difference(): Replace parameter "is_unsigned" with "prtype". innobase_convert_and_store_changed_col(): When trimming spaces, note that UCS2 spaces are 0x0020, not 0x20. --- sql/ha_innodb.cc | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 1312b645017..ddda83d6ad9 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2614,7 +2614,7 @@ innobase_convert_and_store_changed_col( mysql_byte* data, /* in: column data to store */ ulint len, /* in: data len */ ulint col_type,/* in: data type in InnoDB type numbers */ - ulint is_unsigned)/* in: != 0 if an unsigned integer type */ + ulint prtype) /* InnoDB precise data type and flags */ { uint i; @@ -2622,10 +2622,31 @@ innobase_convert_and_store_changed_col( data = NULL; } else if (col_type == DATA_VARCHAR || col_type == DATA_BINARY || col_type == DATA_VARMYSQL) { - /* Remove trailing spaces */ - while (len > 0 && data[len - 1] == ' ') { - len--; - } + /* Remove trailing spaces. */ + + /* Handle UCS2 strings differently. As no new + collations will be introduced in 4.1, we hardcode the + charset-collation codes here. In 5.0, the logic will + be based on mbminlen. */ + ulint cset = dtype_get_charset_coll_noninline(prtype); + if (cset == 35/*ucs2_general_ci*/ + || cset == 90/*ucs2_bin*/ + || (cset >= 128/*ucs2_unicode_ci*/ + && cset <= 144/*ucs2_persian_ci*/)) { + /* space=0x0020 */ + /* Trim "half-chars", just in case. */ + len &= ~1; + + while (len && data[len - 2] == 0x00 + && data[len - 1] == 0x20) { + len -= 2; + } + } else { + /* space=0x20 */ + while (len && data[len - 1] == 0x20) { + len--; + } + } } else if (col_type == DATA_INT) { /* Store integer data in InnoDB in a big-endian format, sign bit negated, if signed */ @@ -2634,7 +2655,7 @@ innobase_convert_and_store_changed_col( buf[len - 1 - i] = data[i]; } - if (!is_unsigned) { + if (!(prtype & DATA_UNSIGNED)) { buf[0] = buf[0] ^ 128; } @@ -2677,7 +2698,7 @@ calc_row_difference( byte* buf; upd_field_t* ufield; ulint col_type; - ulint is_unsigned; + ulint prtype; ulint n_changed = 0; uint i; @@ -2702,8 +2723,7 @@ calc_row_difference( n_len = field->pack_length(); col_type = prebuilt->table->cols[i].type.mtype; - is_unsigned = prebuilt->table->cols[i].type.prtype & - DATA_UNSIGNED; + prtype = prebuilt->table->cols[i].type.prtype; switch (col_type) { case DATA_BLOB: @@ -2743,7 +2763,7 @@ calc_row_difference( innobase_convert_and_store_changed_col(ufield, (mysql_byte*)buf, (mysql_byte*)n_ptr, n_len, col_type, - is_unsigned); + prtype); ufield->exp = NULL; ufield->field_no = prebuilt->table->cols[i].clust_pos; n_changed++; From d1538465e058ba861ca95b5fab8d56ced350a21f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 14:02:31 +0300 Subject: [PATCH 191/225] Fix for Bug#12629, "mysqld_multi produces syntax error". Quote here is unneccessary as it should all be handled in quote_opt_arg(). --- scripts/mysqld_multi.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 098cd894916..b2b85018d7a 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -4,7 +4,7 @@ use Getopt::Long; use POSIX qw(strftime); $|=1; -$VER="2.14"; +$VER="2.15"; $opt_config_file = undef(); $opt_example = 0; @@ -326,7 +326,6 @@ sub start_mysqlds() } else { - $options[$j]=~ s/;/\\;/g; $options[$j]= quote_opt_arg($options[$j]); $tmp.= " $options[$j]"; } From d04eb6511a17501809beaa769fb6a955c9ecb8e0 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 13:37:19 +0200 Subject: [PATCH 192/225] Raise the version. --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 7fec0d7a637..92ce66849ac 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.0.14-rc) +AM_INIT_AUTOMAKE(mysql, 5.0.15-rc) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 @@ -18,7 +18,7 @@ SHARED_LIB_VERSION=15:0:0 # ndb version NDB_VERSION_MAJOR=5 NDB_VERSION_MINOR=0 -NDB_VERSION_BUILD=14 +NDB_VERSION_BUILD=15 NDB_VERSION_STATUS="rc" # Set all version vars based on $VERSION. How do we do this more elegant ? From 937de41ae8a397174a5d3919276ababd54fbecb4 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 13:40:02 +0200 Subject: [PATCH 193/225] ndb - Fix compile error with gcc296 ndb/src/common/util/SimpleProperties.cpp: Fix compile error with gcc296 --- ndb/src/common/util/SimpleProperties.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ndb/src/common/util/SimpleProperties.cpp b/ndb/src/common/util/SimpleProperties.cpp index c25aaea491a..c9251c6a854 100644 --- a/ndb/src/common/util/SimpleProperties.cpp +++ b/ndb/src/common/util/SimpleProperties.cpp @@ -51,11 +51,12 @@ SimpleProperties::Writer::add(const char * value, int len){ union { Uint32 lastWord; char lastBytes[4]; - }; - memcpy(lastBytes, + } tmp; + tmp.lastWord =0 ; + memcpy(tmp.lastBytes, value + putLen*4, len - putLen*4); - return putWord(lastWord); + return putWord(tmp.lastWord); } bool From b446550e2c6447ebc7ac827ab775473f125405e4 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 14:03:55 +0200 Subject: [PATCH 194/225] Many files: New VC7 project files des_key_file.cc: Visual C++ wants '"' for local include mysql.cc: Cast my_cgets() argument for VC6 and VC7 dummy.cpp: Added to convince VS .Net generate a lib for mysqlserver VC++Files/mysqlserver/dummy.cpp: Added to convince VS .Net generate a lib for mysqlserver VC++Files/bdb/bdb.vcproj: New VC7 project files VC++Files/client/mysql.vcproj: New VC7 project files VC++Files/client/mysqladmin.vcproj: New VC7 project files VC++Files/client/mysqlclient.vcproj: New VC7 project files VC++Files/client/mysqldump.vcproj: New VC7 project files VC++Files/client/mysqlimport.vcproj: New VC7 project files VC++Files/client/mysqlshow.vcproj: New VC7 project files VC++Files/client/mysqltest.vcproj: New VC7 project files VC++Files/comp_err/comp_err.vcproj: New VC7 project files VC++Files/dbug/dbug.vcproj: New VC7 project files VC++Files/heap/heap.vcproj: New VC7 project files VC++Files/innobase/innobase.vcproj: New VC7 project files VC++Files/libmysql/libmysql.vcproj: New VC7 project files VC++Files/libmysqld/examples/test_libmysqld.vcproj: New VC7 project files VC++Files/libmysqld/libmysqld.vcproj: New VC7 project files VC++Files/libmysqltest/myTest.vcproj: New VC7 project files VC++Files/my_print_defaults/my_print_defaults.vcproj: New VC7 project files VC++Files/myisam/myisam.vcproj: New VC7 project files VC++Files/myisam_ftdump/myisam_ftdump.vcproj: New VC7 project files VC++Files/myisamchk/myisamchk.vcproj: New VC7 project files VC++Files/myisamlog/myisamlog.vcproj: New VC7 project files VC++Files/myisammrg/myisammrg.vcproj: New VC7 project files VC++Files/myisampack/myisampack.vcproj: New VC7 project files VC++Files/mysql-test/mysql_test_run_new.vcproj: New VC7 project files VC++Files/mysql.sln: New VC7 project files VC++Files/mysqlbinlog/mysqlbinlog.vcproj: New VC7 project files VC++Files/mysqlcheck/mysqlcheck.vcproj: New VC7 project files VC++Files/mysqldemb/mysqldemb.vcproj: New VC7 project files VC++Files/mysqlserver/mysqlserver.vcproj: New VC7 project files VC++Files/mysys/mysys.vcproj: New VC7 project files VC++Files/perror/perror.vcproj: New VC7 project files VC++Files/regex/regex.vcproj: New VC7 project files VC++Files/replace/replace.vcproj: New VC7 project files VC++Files/sql/mysqld.vcproj: New VC7 project files VC++Files/strings/strings.vcproj: New VC7 project files VC++Files/test1/test1.vcproj: New VC7 project files VC++Files/tests/mysql_client_test.vcproj: New VC7 project files VC++Files/thr_test/thr_test.vcproj: New VC7 project files VC++Files/vio/vio.vcproj: New VC7 project files VC++Files/zlib/zlib.vcproj: New VC7 project files client/mysql.cc: Cast my_cgets() argument for VC6 and VC7 sql/des_key_file.cc: Visual C++ wants '"' for local include scripts/make_win_src_distribution.sh: New VC7 project files --- VC++Files/bdb/bdb.vcproj | 3227 +++++++ VC++Files/client/mysql.vcproj | 318 + VC++Files/client/mysqladmin.vcproj | 232 + VC++Files/client/mysqlclient.vcproj | 3330 +++++++ VC++Files/client/mysqldump.vcproj | 232 + VC++Files/client/mysqlimport.vcproj | 232 + VC++Files/client/mysqlshow.vcproj | 232 + VC++Files/client/mysqltest.vcproj | 264 + VC++Files/comp_err/comp_err.vcproj | 93 + VC++Files/dbug/dbug.vcproj | 249 + VC++Files/heap/heap.vcproj | 1061 +++ VC++Files/innobase/innobase.vcproj | 2958 +++++++ VC++Files/libmysql/libmysql.vcproj | 2260 +++++ .../libmysqld/examples/test_libmysqld.vcproj | 130 + VC++Files/libmysqld/libmysqld.vcproj | 4104 +++++++++ VC++Files/libmysqltest/myTest.vcproj | 162 + .../my_print_defaults.vcproj | 245 + VC++Files/myisam/myisam.vcproj | 2094 +++++ VC++Files/myisam_ftdump/myisam_ftdump.vcproj | 174 + VC++Files/myisamchk/myisamchk.vcproj | 244 + VC++Files/myisamlog/myisamlog.vcproj | 244 + VC++Files/myisammrg/myisammrg.vcproj | 968 ++ VC++Files/myisampack/myisampack.vcproj | 247 + .../mysql-test/mysql_test_run_new.vcproj | 204 + VC++Files/mysql.sln | 1159 +++ VC++Files/mysqlbinlog/mysqlbinlog.vcproj | 271 + VC++Files/mysqlcheck/mysqlcheck.vcproj | 244 + VC++Files/mysqldemb/mysqldemb.vcproj | 2960 +++++++ VC++Files/mysqlserver/dummy.cpp | 0 VC++Files/mysqlserver/mysqlserver.vcproj | 126 + VC++Files/mysys/mysys.vcproj | 4792 ++++++++++ VC++Files/perror/perror.vcproj | 255 + VC++Files/regex/regex.vcproj | 252 + VC++Files/replace/replace.vcproj | 229 + VC++Files/sql/mysqld.vcproj | 7834 +++++++++++++++++ VC++Files/strings/strings.vcproj | 993 +++ VC++Files/test1/test1.vcproj | 161 + VC++Files/tests/mysql_client_test.vcproj | 163 + VC++Files/thr_test/thr_test.vcproj | 162 + VC++Files/vio/vio.vcproj | 204 + VC++Files/zlib/zlib.vcproj | 483 + client/mysql.cc | 2 +- scripts/make_win_src_distribution.sh | 16 +- sql/des_key_file.cc | 2 +- 44 files changed, 43804 insertions(+), 8 deletions(-) create mode 100644 VC++Files/bdb/bdb.vcproj create mode 100644 VC++Files/client/mysql.vcproj create mode 100644 VC++Files/client/mysqladmin.vcproj create mode 100644 VC++Files/client/mysqlclient.vcproj create mode 100644 VC++Files/client/mysqldump.vcproj create mode 100644 VC++Files/client/mysqlimport.vcproj create mode 100644 VC++Files/client/mysqlshow.vcproj create mode 100644 VC++Files/client/mysqltest.vcproj create mode 100644 VC++Files/comp_err/comp_err.vcproj create mode 100644 VC++Files/dbug/dbug.vcproj create mode 100644 VC++Files/heap/heap.vcproj create mode 100644 VC++Files/innobase/innobase.vcproj create mode 100644 VC++Files/libmysql/libmysql.vcproj create mode 100644 VC++Files/libmysqld/examples/test_libmysqld.vcproj create mode 100644 VC++Files/libmysqld/libmysqld.vcproj create mode 100644 VC++Files/libmysqltest/myTest.vcproj create mode 100644 VC++Files/my_print_defaults/my_print_defaults.vcproj create mode 100644 VC++Files/myisam/myisam.vcproj create mode 100644 VC++Files/myisam_ftdump/myisam_ftdump.vcproj create mode 100644 VC++Files/myisamchk/myisamchk.vcproj create mode 100644 VC++Files/myisamlog/myisamlog.vcproj create mode 100644 VC++Files/myisammrg/myisammrg.vcproj create mode 100644 VC++Files/myisampack/myisampack.vcproj create mode 100644 VC++Files/mysql-test/mysql_test_run_new.vcproj create mode 100644 VC++Files/mysql.sln create mode 100644 VC++Files/mysqlbinlog/mysqlbinlog.vcproj create mode 100644 VC++Files/mysqlcheck/mysqlcheck.vcproj create mode 100644 VC++Files/mysqldemb/mysqldemb.vcproj create mode 100644 VC++Files/mysqlserver/dummy.cpp create mode 100644 VC++Files/mysqlserver/mysqlserver.vcproj create mode 100644 VC++Files/mysys/mysys.vcproj create mode 100644 VC++Files/perror/perror.vcproj create mode 100644 VC++Files/regex/regex.vcproj create mode 100644 VC++Files/replace/replace.vcproj create mode 100644 VC++Files/sql/mysqld.vcproj create mode 100644 VC++Files/strings/strings.vcproj create mode 100644 VC++Files/test1/test1.vcproj create mode 100644 VC++Files/tests/mysql_client_test.vcproj create mode 100644 VC++Files/thr_test/thr_test.vcproj create mode 100644 VC++Files/vio/vio.vcproj create mode 100644 VC++Files/zlib/zlib.vcproj diff --git a/VC++Files/bdb/bdb.vcproj b/VC++Files/bdb/bdb.vcproj new file mode 100644 index 00000000000..6258da3cb3a --- /dev/null +++ b/VC++Files/bdb/bdb.vcproj @@ -0,0 +1,3227 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/client/mysql.vcproj b/VC++Files/client/mysql.vcproj new file mode 100644 index 00000000000..72cc4ba6b89 --- /dev/null +++ b/VC++Files/client/mysql.vcproj @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/client/mysqladmin.vcproj b/VC++Files/client/mysqladmin.vcproj new file mode 100644 index 00000000000..188bf61dff7 --- /dev/null +++ b/VC++Files/client/mysqladmin.vcproj @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/client/mysqlclient.vcproj b/VC++Files/client/mysqlclient.vcproj new file mode 100644 index 00000000000..105bf4b84e2 --- /dev/null +++ b/VC++Files/client/mysqlclient.vcproj @@ -0,0 +1,3330 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/client/mysqldump.vcproj b/VC++Files/client/mysqldump.vcproj new file mode 100644 index 00000000000..b6a33596083 --- /dev/null +++ b/VC++Files/client/mysqldump.vcproj @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/client/mysqlimport.vcproj b/VC++Files/client/mysqlimport.vcproj new file mode 100644 index 00000000000..ef440c2fe5a --- /dev/null +++ b/VC++Files/client/mysqlimport.vcproj @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/client/mysqlshow.vcproj b/VC++Files/client/mysqlshow.vcproj new file mode 100644 index 00000000000..a0707680728 --- /dev/null +++ b/VC++Files/client/mysqlshow.vcproj @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/client/mysqltest.vcproj b/VC++Files/client/mysqltest.vcproj new file mode 100644 index 00000000000..5c075740fbd --- /dev/null +++ b/VC++Files/client/mysqltest.vcproj @@ -0,0 +1,264 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/comp_err/comp_err.vcproj b/VC++Files/comp_err/comp_err.vcproj new file mode 100644 index 00000000000..b12ef8b0af1 --- /dev/null +++ b/VC++Files/comp_err/comp_err.vcproj @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/dbug/dbug.vcproj b/VC++Files/dbug/dbug.vcproj new file mode 100644 index 00000000000..57257451aea --- /dev/null +++ b/VC++Files/dbug/dbug.vcproj @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/heap/heap.vcproj b/VC++Files/heap/heap.vcproj new file mode 100644 index 00000000000..b2afd752acf --- /dev/null +++ b/VC++Files/heap/heap.vcproj @@ -0,0 +1,1061 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/innobase/innobase.vcproj b/VC++Files/innobase/innobase.vcproj new file mode 100644 index 00000000000..9d972366440 --- /dev/null +++ b/VC++Files/innobase/innobase.vcproj @@ -0,0 +1,2958 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/libmysql/libmysql.vcproj b/VC++Files/libmysql/libmysql.vcproj new file mode 100644 index 00000000000..1cda7d7653b --- /dev/null +++ b/VC++Files/libmysql/libmysql.vcproj @@ -0,0 +1,2260 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/libmysqld/examples/test_libmysqld.vcproj b/VC++Files/libmysqld/examples/test_libmysqld.vcproj new file mode 100644 index 00000000000..bf26fbd6588 --- /dev/null +++ b/VC++Files/libmysqld/examples/test_libmysqld.vcproj @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/libmysqld/libmysqld.vcproj b/VC++Files/libmysqld/libmysqld.vcproj new file mode 100644 index 00000000000..f9074e4079e --- /dev/null +++ b/VC++Files/libmysqld/libmysqld.vcproj @@ -0,0 +1,4104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/libmysqltest/myTest.vcproj b/VC++Files/libmysqltest/myTest.vcproj new file mode 100644 index 00000000000..afc44b482c9 --- /dev/null +++ b/VC++Files/libmysqltest/myTest.vcproj @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/my_print_defaults/my_print_defaults.vcproj b/VC++Files/my_print_defaults/my_print_defaults.vcproj new file mode 100644 index 00000000000..e49039b6a1e --- /dev/null +++ b/VC++Files/my_print_defaults/my_print_defaults.vcproj @@ -0,0 +1,245 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/myisam/myisam.vcproj b/VC++Files/myisam/myisam.vcproj new file mode 100644 index 00000000000..b63b7ffaccc --- /dev/null +++ b/VC++Files/myisam/myisam.vcproj @@ -0,0 +1,2094 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/myisam_ftdump/myisam_ftdump.vcproj b/VC++Files/myisam_ftdump/myisam_ftdump.vcproj new file mode 100644 index 00000000000..4d1013775fa --- /dev/null +++ b/VC++Files/myisam_ftdump/myisam_ftdump.vcproj @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/myisamchk/myisamchk.vcproj b/VC++Files/myisamchk/myisamchk.vcproj new file mode 100644 index 00000000000..33f813024b5 --- /dev/null +++ b/VC++Files/myisamchk/myisamchk.vcproj @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/myisamlog/myisamlog.vcproj b/VC++Files/myisamlog/myisamlog.vcproj new file mode 100644 index 00000000000..6189a54d33b --- /dev/null +++ b/VC++Files/myisamlog/myisamlog.vcproj @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/myisammrg/myisammrg.vcproj b/VC++Files/myisammrg/myisammrg.vcproj new file mode 100644 index 00000000000..3075f8ef9f6 --- /dev/null +++ b/VC++Files/myisammrg/myisammrg.vcproj @@ -0,0 +1,968 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/myisampack/myisampack.vcproj b/VC++Files/myisampack/myisampack.vcproj new file mode 100644 index 00000000000..27a8653cc5a --- /dev/null +++ b/VC++Files/myisampack/myisampack.vcproj @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/mysql-test/mysql_test_run_new.vcproj b/VC++Files/mysql-test/mysql_test_run_new.vcproj new file mode 100644 index 00000000000..12d502e5768 --- /dev/null +++ b/VC++Files/mysql-test/mysql_test_run_new.vcproj @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/mysql.sln b/VC++Files/mysql.sln new file mode 100644 index 00000000000..56919806840 --- /dev/null +++ b/VC++Files/mysql.sln @@ -0,0 +1,1159 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bdb", "bdb\bdb.vcproj", "{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "comp_err", "comp_err\comp_err.vcproj", "{1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dbug", "dbug\dbug.vcproj", "{FC369DF4-AEB7-4531-BF34-A638C4363BFE}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "heap", "heap\heap.vcproj", "{C70A6DC7-7D45-4C16-8654-7E57713A4C04}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "innobase", "innobase\innobase.vcproj", "{13D37150-54D0-46C5-9519-03923243C7C7}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmysql", "libmysql\libmysql.vcproj", "{1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmysqld", "libmysqld\libmysqld.vcproj", "{93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} = {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} + {13D37150-54D0-46C5-9519-03923243C7C7} = {13D37150-54D0-46C5-9519-03923243C7C7} + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3} = {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3} + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0} = {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0} + {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {C70A6DC7-7D45-4C16-8654-7E57713A4C04} = {C70A6DC7-7D45-4C16-8654-7E57713A4C04} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myTest", "libmysqltest\myTest.vcproj", "{2794E434-7CCE-44DB-B2FB-789ABE53D6B9}" + ProjectSection(ProjectDependencies) = postProject + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F} = {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "my_print_defaults", "my_print_defaults\my_print_defaults.vcproj", "{B0EC3594-CD67-4364-826E-BA75EF2050F8}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisam", "myisam\myisam.vcproj", "{262280A8-37D5-4037-BDFB-242468DFB3D2}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisam_ftdump", "myisam_ftdump\myisam_ftdump.vcproj", "{4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisamchk", "myisamchk\myisamchk.vcproj", "{87CD9881-D234-4306-BBC6-0668C6168C0F}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisamlog", "myisamlog\myisamlog.vcproj", "{194F5EE6-9440-4298-A6FE-A9B4B480B44C}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisammrg", "myisammrg\myisammrg.vcproj", "{D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisampack", "myisampack\myisampack.vcproj", "{EF833A1E-E358-4B6C-9C27-9489E85041CC}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysql", "client\mysql.vcproj", "{F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}" + ProjectSection(ProjectDependencies) = postProject + {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqladmin", "client\mysqladmin.vcproj", "{D2B00DE0-F6E9-40AF-B90D-A257D014F098}" + ProjectSection(ProjectDependencies) = postProject + {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlbinlog", "mysqlbinlog\mysqlbinlog.vcproj", "{DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}" + ProjectSection(ProjectDependencies) = postProject + {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlcheck", "mysqlcheck\mysqlcheck.vcproj", "{67154F28-D076-419E-B149-819EF548E670}" + ProjectSection(ProjectDependencies) = postProject + {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlclient", "client\mysqlclient.vcproj", "{26383276-4843-494B-8BE0-8936ED3EBAAB}" + ProjectSection(ProjectDependencies) = postProject + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqld", "sql\mysqld.vcproj", "{62E85884-3ACF-4F4C-873B-60B878147890}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} = {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} + {13D37150-54D0-46C5-9519-03923243C7C7} = {13D37150-54D0-46C5-9519-03923243C7C7} + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3} = {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3} + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0} = {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0} + {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B} = {F74653C4-8003-4A79-8F53-FC69E0AD7A9B} + {C70A6DC7-7D45-4C16-8654-7E57713A4C04} = {C70A6DC7-7D45-4C16-8654-7E57713A4C04} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqldemb", "mysqldemb\mysqldemb.vcproj", "{37D9BA79-302E-4582-A545-CB5FF7982EA3}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqldump", "client\mysqldump.vcproj", "{89F24ECE-9953-40EF-BDF4-B41F5631E92B}" + ProjectSection(ProjectDependencies) = postProject + {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlimport", "client\mysqlimport.vcproj", "{AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}" + ProjectSection(ProjectDependencies) = postProject + {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlserver", "mysqlserver\mysqlserver.vcproj", "{94B86159-C581-42CD-825D-C69CBC237E5C}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} = {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} + {13D37150-54D0-46C5-9519-03923243C7C7} = {13D37150-54D0-46C5-9519-03923243C7C7} + {37D9BA79-302E-4582-A545-CB5FF7982EA3} = {37D9BA79-302E-4582-A545-CB5FF7982EA3} + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0} = {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0} + {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {C70A6DC7-7D45-4C16-8654-7E57713A4C04} = {C70A6DC7-7D45-4C16-8654-7E57713A4C04} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlshow", "client\mysqlshow.vcproj", "{3737BFE2-EF25-464F-994D-BD28A9F84528}" + ProjectSection(ProjectDependencies) = postProject + {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysys", "mysys\mysys.vcproj", "{44D9C7DC-6636-4B82-BD01-6876C64017DF}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "perror", "perror\perror.vcproj", "{AC47623D-933C-4A80-83BB-B6AF7CB28B4B}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "regex", "regex\regex.vcproj", "{207E9014-C4D1-4F6D-B76F-BC7DD7E31113}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "replace", "replace\replace.vcproj", "{16699B52-ECC6-4A96-A99F-A043059BA2E7}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "strings", "strings\strings.vcproj", "{EEC1300B-85A5-497C-B3E1-F708021DF859}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test1", "test1\test1.vcproj", "{8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}" + ProjectSection(ProjectDependencies) = postProject + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F} = {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_libmysqld", "libmysqld\examples\test_libmysqld.vcproj", "{6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}" + ProjectSection(ProjectDependencies) = postProject + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9} = {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "thr_test", "thr_test\thr_test.vcproj", "{7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vio", "vio\vio.vcproj", "{F74653C4-8003-4A79-8F53-FC69E0AD7A9B}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib\zlib.vcproj", "{8762A9B8-72A9-462E-A9A2-F3265081F8AF}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqltest", "client\mysqltest.vcproj", "{8961F149-C68A-4154-A499-A2AB39E607E8}" + ProjectSection(ProjectDependencies) = postProject + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} = {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} + {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysql_client_test", "tests\mysql_client_test.vcproj", "{DA224DAB-5006-42BE-BB77-16E8BE5326D5}" + ProjectSection(ProjectDependencies) = postProject + {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysql_test_run_new", "mysql-test\mysql_test_run_new.vcproj", "{6189F838-21C6-42A1-B2D0-9146316573F7}" + ProjectSection(ProjectDependencies) = postProject + {8961F149-C68A-4154-A499-A2AB39E607E8} = {8961F149-C68A-4154-A499-A2AB39E607E8} + {DA224DAB-5006-42BE-BB77-16E8BE5326D5} = {DA224DAB-5006-42BE-BB77-16E8BE5326D5} + {D2B00DE0-F6E9-40AF-B90D-A257D014F098} = {D2B00DE0-F6E9-40AF-B90D-A257D014F098} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + classic = classic + classic nt = classic nt + Debug = Debug + Embedded_Classic = Embedded_Classic + Embedded_Debug = Embedded_Debug + Embedded_Pro = Embedded_Pro + Embedded_Release = Embedded_Release + Max = Max + Max nt = Max nt + nt = nt + pro = pro + pro nt = pro nt + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.classic.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.classic.Build.0 = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.classic nt.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.classic nt.Build.0 = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Debug.ActiveCfg = Debug|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Debug.Build.0 = Debug|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Classic.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Classic.Build.0 = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Debug.ActiveCfg = Debug|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Debug.Build.0 = Debug|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Pro.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Pro.Build.0 = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Release.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Release.Build.0 = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Max.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Max.Build.0 = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Max nt.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Max nt.Build.0 = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.nt.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.nt.Build.0 = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro.Build.0 = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro nt.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro nt.Build.0 = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Release.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Release.Build.0 = Max|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.classic.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.classic nt.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.classic nt.Build.0 = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Debug.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Classic.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Debug.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Pro.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Release.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Max.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Max.Build.0 = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Max nt.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Max nt.Build.0 = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.nt.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.nt.Build.0 = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro.Build.0 = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro nt.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro nt.Build.0 = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Release.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Release.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.classic.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.classic.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.classic nt.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.classic nt.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Debug.ActiveCfg = Debug|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Debug.Build.0 = Debug|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Classic.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Classic.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Debug.ActiveCfg = TLS_DEBUG|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Debug.Build.0 = TLS_DEBUG|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Pro.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Pro.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Release.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Release.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Max.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Max.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Max nt.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Max nt.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.nt.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.nt.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro nt.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro nt.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Release.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Release.Build.0 = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.classic.ActiveCfg = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.classic.Build.0 = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.classic nt.ActiveCfg = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.classic nt.Build.0 = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Debug.ActiveCfg = Debug|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Debug.Build.0 = Debug|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Classic.ActiveCfg = TLS|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Classic.Build.0 = TLS|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Debug.ActiveCfg = TLS_DEBUG|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Debug.Build.0 = TLS_DEBUG|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Pro.ActiveCfg = TLS|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Pro.Build.0 = TLS|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Release.ActiveCfg = TLS|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Release.Build.0 = TLS|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Max.ActiveCfg = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Max.Build.0 = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Max nt.ActiveCfg = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Max nt.Build.0 = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.nt.ActiveCfg = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.nt.Build.0 = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro.ActiveCfg = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro.Build.0 = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro nt.ActiveCfg = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro nt.Build.0 = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Release.ActiveCfg = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Release.Build.0 = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.classic.ActiveCfg = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.classic.Build.0 = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.classic nt.ActiveCfg = nt|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.classic nt.Build.0 = nt|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Debug.ActiveCfg = Debug|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Debug.Build.0 = Debug|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Classic.ActiveCfg = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Classic.Build.0 = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Debug.ActiveCfg = Debug|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Debug.Build.0 = Debug|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Pro.ActiveCfg = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Pro.Build.0 = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Release.ActiveCfg = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Release.Build.0 = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Max.ActiveCfg = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Max.Build.0 = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Max nt.ActiveCfg = Max nt|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Max nt.Build.0 = Max nt|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.nt.ActiveCfg = nt|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.nt.Build.0 = nt|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.pro.ActiveCfg = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.pro.Build.0 = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.pro nt.ActiveCfg = nt|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.pro nt.Build.0 = nt|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Release.ActiveCfg = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Release.Build.0 = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.classic.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.classic.Build.0 = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.classic nt.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.classic nt.Build.0 = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Debug.ActiveCfg = Debug|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Debug.Build.0 = Debug|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Classic.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Debug.ActiveCfg = Debug|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Pro.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Release.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Max.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Max.Build.0 = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Max nt.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Max nt.Build.0 = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.nt.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.nt.Build.0 = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro.Build.0 = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro nt.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro nt.Build.0 = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Release.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Release.Build.0 = Release|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.classic.ActiveCfg = classic|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.classic nt.ActiveCfg = classic|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Debug.ActiveCfg = Debug|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Classic.ActiveCfg = classic|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Classic.Build.0 = classic|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Debug.ActiveCfg = Debug|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Debug.Build.0 = Debug|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Pro.ActiveCfg = pro|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Pro.Build.0 = pro|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Release.ActiveCfg = Release|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Release.Build.0 = Release|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Max.ActiveCfg = classic|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Max nt.ActiveCfg = classic|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.nt.ActiveCfg = classic|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.pro.ActiveCfg = pro|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.pro nt.ActiveCfg = pro|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Release.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.classic.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.classic.Build.0 = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.classic nt.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.classic nt.Build.0 = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Debug.ActiveCfg = Debug|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Debug.Build.0 = Debug|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Classic.ActiveCfg = Debug|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Debug.ActiveCfg = Debug|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Pro.ActiveCfg = Debug|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Release.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Max.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Max.Build.0 = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Max nt.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Max nt.Build.0 = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.nt.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.nt.Build.0 = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro.Build.0 = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro nt.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro nt.Build.0 = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Release.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Release.Build.0 = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.classic.ActiveCfg = classic|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.classic.Build.0 = classic|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.classic nt.ActiveCfg = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.classic nt.Build.0 = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Debug.ActiveCfg = Debug|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Debug.Build.0 = Debug|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Classic.ActiveCfg = Debug|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Debug.ActiveCfg = Debug|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Pro.ActiveCfg = Debug|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Release.ActiveCfg = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Max.ActiveCfg = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Max.Build.0 = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Max nt.ActiveCfg = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Max nt.Build.0 = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.nt.ActiveCfg = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.nt.Build.0 = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro.ActiveCfg = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro.Build.0 = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro nt.ActiveCfg = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro nt.Build.0 = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Release.ActiveCfg = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Release.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.classic.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.classic.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.classic nt.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.classic nt.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Debug.ActiveCfg = Debug|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Debug.Build.0 = Debug|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Classic.ActiveCfg = TLS|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Classic.Build.0 = TLS|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Debug.ActiveCfg = Debug|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Debug.Build.0 = Debug|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Pro.ActiveCfg = TLS|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Pro.Build.0 = TLS|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Release.ActiveCfg = TLS|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Release.Build.0 = TLS|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Max.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Max.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Max nt.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Max nt.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.nt.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.nt.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro nt.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro nt.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Release.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Release.Build.0 = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic.Build.0 = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic nt.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic nt.Build.0 = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Debug.ActiveCfg = Debug|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Debug.Build.0 = Debug|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Classic.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Debug.ActiveCfg = Debug|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Pro.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Release.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Max.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Max.Build.0 = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Max nt.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Max nt.Build.0 = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.nt.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.nt.Build.0 = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro.Build.0 = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro nt.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro nt.Build.0 = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Release.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Release.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.classic.ActiveCfg = classic|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.classic.Build.0 = classic|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.classic nt.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.classic nt.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Debug.ActiveCfg = Debug|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Debug.Build.0 = Debug|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Classic.ActiveCfg = Debug|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Debug.ActiveCfg = Debug|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Pro.ActiveCfg = Debug|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Release.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Max.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Max.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Max nt.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Max nt.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.nt.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.nt.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro nt.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro nt.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Release.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Release.Build.0 = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic.ActiveCfg = classic|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic.Build.0 = classic|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic nt.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic nt.Build.0 = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Debug.ActiveCfg = Debug|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Debug.Build.0 = Debug|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Classic.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Debug.ActiveCfg = Debug|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Pro.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Release.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Max.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Max.Build.0 = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Max nt.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Max nt.Build.0 = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.nt.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.nt.Build.0 = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro.Build.0 = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro nt.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro nt.Build.0 = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Release.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Release.Build.0 = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.classic.ActiveCfg = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.classic.Build.0 = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.classic nt.ActiveCfg = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.classic nt.Build.0 = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Debug.ActiveCfg = Debug|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Debug.Build.0 = Debug|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Classic.ActiveCfg = TLS|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Classic.Build.0 = TLS|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Debug.ActiveCfg = Debug|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Debug.Build.0 = Debug|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Pro.ActiveCfg = TLS|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Pro.Build.0 = TLS|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Release.ActiveCfg = TLS|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Release.Build.0 = TLS|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Max.ActiveCfg = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Max.Build.0 = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Max nt.ActiveCfg = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Max nt.Build.0 = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.nt.ActiveCfg = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.nt.Build.0 = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro.ActiveCfg = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro.Build.0 = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro nt.ActiveCfg = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro nt.Build.0 = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Release.ActiveCfg = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Release.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.classic.ActiveCfg = classic|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.classic.Build.0 = classic|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.classic nt.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.classic nt.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Debug.ActiveCfg = Debug|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Debug.Build.0 = Debug|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Classic.ActiveCfg = classic|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Debug.ActiveCfg = Debug|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Pro.ActiveCfg = classic|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Release.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Max.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Max.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Max nt.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Max nt.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.nt.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.nt.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro nt.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro nt.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Release.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Release.Build.0 = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic.ActiveCfg = classic|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic.Build.0 = classic|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic nt.ActiveCfg = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic nt.Build.0 = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Debug.ActiveCfg = Debug|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Debug.Build.0 = Debug|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Classic.ActiveCfg = Debug|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Debug.ActiveCfg = Debug|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Pro.ActiveCfg = Debug|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Release.ActiveCfg = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Max.ActiveCfg = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Max.Build.0 = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Max nt.ActiveCfg = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Max nt.Build.0 = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.nt.ActiveCfg = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.nt.Build.0 = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro.ActiveCfg = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro.Build.0 = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro nt.ActiveCfg = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro nt.Build.0 = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Release.ActiveCfg = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Release.Build.0 = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.classic.ActiveCfg = classic|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.classic.Build.0 = classic|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.classic nt.ActiveCfg = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.classic nt.Build.0 = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Debug.ActiveCfg = Debug|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Debug.Build.0 = Debug|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Classic.ActiveCfg = Debug|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Debug.ActiveCfg = Debug|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Pro.ActiveCfg = Debug|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Release.ActiveCfg = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Max.ActiveCfg = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Max.Build.0 = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Max nt.ActiveCfg = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Max nt.Build.0 = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.nt.ActiveCfg = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.nt.Build.0 = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro.ActiveCfg = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro.Build.0 = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro nt.ActiveCfg = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro nt.Build.0 = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Release.ActiveCfg = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Release.Build.0 = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.classic.ActiveCfg = classic|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.classic.Build.0 = classic|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.classic nt.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.classic nt.Build.0 = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Debug.ActiveCfg = Debug|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Debug.Build.0 = Debug|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Classic.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Debug.ActiveCfg = Debug|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Pro.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Release.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Max.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Max.Build.0 = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Max nt.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Max nt.Build.0 = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.nt.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.nt.Build.0 = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro.Build.0 = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro nt.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro nt.Build.0 = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Release.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Release.Build.0 = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.classic.ActiveCfg = classic|Win32 + {67154F28-D076-419E-B149-819EF548E670}.classic.Build.0 = classic|Win32 + {67154F28-D076-419E-B149-819EF548E670}.classic nt.ActiveCfg = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.classic nt.Build.0 = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Debug.ActiveCfg = Debug|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Debug.Build.0 = Debug|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Embedded_Classic.ActiveCfg = Debug|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Embedded_Debug.ActiveCfg = Debug|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Embedded_Pro.ActiveCfg = Debug|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Embedded_Release.ActiveCfg = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Max.ActiveCfg = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Max.Build.0 = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Max nt.ActiveCfg = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Max nt.Build.0 = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.nt.ActiveCfg = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.nt.Build.0 = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.pro.ActiveCfg = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.pro.Build.0 = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.pro nt.ActiveCfg = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.pro nt.Build.0 = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Release.ActiveCfg = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Release.Build.0 = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.classic.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.classic.Build.0 = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.classic nt.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.classic nt.Build.0 = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Debug.ActiveCfg = Debug|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Debug.Build.0 = Debug|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Classic.ActiveCfg = Debug|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Debug.ActiveCfg = Debug|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Pro.ActiveCfg = Debug|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Release.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Max.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Max.Build.0 = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Max nt.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Max nt.Build.0 = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.nt.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.nt.Build.0 = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro.Build.0 = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro nt.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro nt.Build.0 = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Release.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Release.Build.0 = Release|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.classic.ActiveCfg = classic|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.classic.Build.0 = classic|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.classic nt.ActiveCfg = classic nt|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.classic nt.Build.0 = classic nt|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Debug.ActiveCfg = Debug|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Debug.Build.0 = Debug|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Classic.ActiveCfg = Release|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Debug.ActiveCfg = Debug|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Pro.ActiveCfg = Release|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Release.ActiveCfg = Release|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Max.ActiveCfg = Max|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Max.Build.0 = Max|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Max nt.ActiveCfg = Max nt|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Max nt.Build.0 = Max nt|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.nt.ActiveCfg = nt|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.nt.Build.0 = nt|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.pro.ActiveCfg = pro|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.pro.Build.0 = pro|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.pro nt.ActiveCfg = pro nt|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.pro nt.Build.0 = pro nt|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Release.ActiveCfg = Release|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Release.Build.0 = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.classic.ActiveCfg = classic|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.classic.Build.0 = classic|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.classic nt.ActiveCfg = classic|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.classic nt.Build.0 = classic|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Debug.ActiveCfg = Debug|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Debug.Build.0 = Debug|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Classic.ActiveCfg = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Debug.ActiveCfg = Debug|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Pro.ActiveCfg = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Release.ActiveCfg = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max.ActiveCfg = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max.Build.0 = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max nt.ActiveCfg = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max nt.Build.0 = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.nt.ActiveCfg = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.nt.Build.0 = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro.ActiveCfg = pro|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro.Build.0 = pro|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro nt.ActiveCfg = pro|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro nt.Build.0 = pro|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Release.ActiveCfg = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Release.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.classic.ActiveCfg = classic|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.classic.Build.0 = classic|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.classic nt.ActiveCfg = classic|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.classic nt.Build.0 = classic|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Debug.ActiveCfg = Debug|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Debug.Build.0 = Debug|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Classic.ActiveCfg = classic|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Debug.ActiveCfg = Debug|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Pro.ActiveCfg = classic|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Release.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Max.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Max.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Max nt.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Max nt.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.nt.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.nt.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro nt.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro nt.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Release.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Release.Build.0 = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic.ActiveCfg = classic|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic.Build.0 = classic|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic nt.ActiveCfg = classic|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic nt.Build.0 = classic|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Debug.ActiveCfg = Debug|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Debug.Build.0 = Debug|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Classic.ActiveCfg = classic|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Debug.ActiveCfg = Debug|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Pro.ActiveCfg = classic|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Release.ActiveCfg = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Max.ActiveCfg = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Max.Build.0 = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Max nt.ActiveCfg = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Max nt.Build.0 = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.nt.ActiveCfg = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.nt.Build.0 = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro.ActiveCfg = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro.Build.0 = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro nt.ActiveCfg = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro nt.Build.0 = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Release.ActiveCfg = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Release.Build.0 = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.classic.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.classic.Build.0 = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.classic nt.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.classic nt.Build.0 = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Debug.ActiveCfg = Debug|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Debug.Build.0 = Debug|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Classic.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Debug.ActiveCfg = Debug|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Pro.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Release.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Max.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Max.Build.0 = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Max nt.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Max nt.Build.0 = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.nt.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.nt.Build.0 = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.pro.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.pro.Build.0 = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.pro nt.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.pro nt.Build.0 = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Release.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Release.Build.0 = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.classic.ActiveCfg = classic|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.classic.Build.0 = classic|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.classic nt.ActiveCfg = classic|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.classic nt.Build.0 = classic|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Debug.ActiveCfg = Debug|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Debug.Build.0 = Debug|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Classic.ActiveCfg = Debug|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Debug.ActiveCfg = Debug|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Pro.ActiveCfg = Debug|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Release.ActiveCfg = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Max.ActiveCfg = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Max.Build.0 = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Max nt.ActiveCfg = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Max nt.Build.0 = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.nt.ActiveCfg = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.nt.Build.0 = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro.ActiveCfg = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro.Build.0 = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro nt.ActiveCfg = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro nt.Build.0 = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Release.ActiveCfg = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Release.Build.0 = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic.ActiveCfg = TLS|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic.Build.0 = TLS|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic nt.ActiveCfg = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic nt.Build.0 = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Debug.ActiveCfg = Debug|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Debug.Build.0 = Debug|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Classic.ActiveCfg = TLS|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Classic.Build.0 = TLS|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Debug.ActiveCfg = TLS_DEBUG|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Debug.Build.0 = TLS_DEBUG|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Pro.ActiveCfg = TLS|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Pro.Build.0 = TLS|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Release.ActiveCfg = TLS|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Release.Build.0 = TLS|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max.ActiveCfg = Max|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max.Build.0 = Max|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max nt.ActiveCfg = Max|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max nt.Build.0 = Max|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.nt.ActiveCfg = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.nt.Build.0 = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro.ActiveCfg = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro.Build.0 = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro nt.ActiveCfg = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro nt.Build.0 = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Release.ActiveCfg = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Release.Build.0 = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.classic.ActiveCfg = classic|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.classic.Build.0 = classic|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.classic nt.ActiveCfg = classic|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.classic nt.Build.0 = classic|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Debug.ActiveCfg = Debug|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Debug.Build.0 = Debug|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Classic.ActiveCfg = Debug|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Debug.ActiveCfg = Debug|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Pro.ActiveCfg = Debug|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Release.ActiveCfg = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Max.ActiveCfg = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Max.Build.0 = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Max nt.ActiveCfg = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Max nt.Build.0 = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.nt.ActiveCfg = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.nt.Build.0 = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro.ActiveCfg = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro.Build.0 = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro nt.ActiveCfg = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro nt.Build.0 = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Release.ActiveCfg = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Release.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.classic.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.classic.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.classic nt.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.classic nt.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Debug.ActiveCfg = Debug|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Debug.Build.0 = Debug|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Classic.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Classic.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Debug.ActiveCfg = Debug|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Debug.Build.0 = Debug|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Pro.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Pro.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Release.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Release.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Max.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Max.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Max nt.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Max nt.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.nt.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.nt.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro nt.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro nt.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Release.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Release.Build.0 = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.classic.ActiveCfg = classic|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.classic.Build.0 = classic|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.classic nt.ActiveCfg = classic|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.classic nt.Build.0 = classic|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Debug.ActiveCfg = Debug|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Debug.Build.0 = Debug|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Classic.ActiveCfg = classic|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Debug.ActiveCfg = Debug|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Pro.ActiveCfg = classic|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Release.ActiveCfg = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Max.ActiveCfg = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Max.Build.0 = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Max nt.ActiveCfg = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Max nt.Build.0 = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.nt.ActiveCfg = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.nt.Build.0 = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro.ActiveCfg = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro.Build.0 = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro nt.ActiveCfg = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro nt.Build.0 = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Release.ActiveCfg = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Release.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.classic.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.classic.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.classic nt.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.classic nt.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Debug.ActiveCfg = Debug|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Debug.Build.0 = Debug|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Classic.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Classic.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Debug.ActiveCfg = Debug|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Debug.Build.0 = Debug|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Pro.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Pro.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Release.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Release.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Max.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Max.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Max nt.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Max nt.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.nt.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.nt.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro nt.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro nt.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Release.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Release.Build.0 = Release|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.classic.ActiveCfg = Release|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.classic.Build.0 = Release|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.classic nt.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Debug.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Debug.Build.0 = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Classic.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Debug.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Pro.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Release.ActiveCfg = Release|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Max.ActiveCfg = Release|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Max nt.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.nt.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro nt.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Release.ActiveCfg = Release|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Release.Build.0 = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.classic.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.classic nt.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Debug.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Classic.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Debug.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Pro.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Release.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Max.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Max nt.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.nt.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.pro.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.pro nt.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Release.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.classic.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.classic.Build.0 = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.classic nt.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.classic nt.Build.0 = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Debug.ActiveCfg = Debug|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Debug.Build.0 = Debug|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Classic.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Debug.ActiveCfg = Debug|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Pro.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Release.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Max.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Max.Build.0 = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Max nt.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Max nt.Build.0 = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.nt.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.nt.Build.0 = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro.Build.0 = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro nt.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro nt.Build.0 = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Release.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Release.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.classic.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.classic.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.classic nt.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.classic nt.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Debug.ActiveCfg = Debug|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Debug.Build.0 = Debug|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Classic.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Classic.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Debug.ActiveCfg = Debug|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Debug.Build.0 = Debug|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Pro.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Pro.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Release.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Release.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Max.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Max.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Max nt.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Max nt.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.nt.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.nt.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro nt.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro nt.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Release.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Release.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.classic.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.classic.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.classic nt.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.classic nt.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Debug.ActiveCfg = Debug|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Debug.Build.0 = Debug|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Classic.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Classic.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Debug.ActiveCfg = Debug|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Debug.Build.0 = Debug|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Pro.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Pro.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Release.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Release.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Max.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Max.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Max nt.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Max nt.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.nt.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.nt.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro nt.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro nt.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Release.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Release.Build.0 = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.classic.ActiveCfg = classic|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.classic.Build.0 = classic|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.classic nt.ActiveCfg = classic|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.classic nt.Build.0 = classic|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Debug.ActiveCfg = Debug|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Debug.Build.0 = Debug|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Classic.ActiveCfg = Debug|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Debug.ActiveCfg = Debug|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Pro.ActiveCfg = Debug|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Release.ActiveCfg = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Max.ActiveCfg = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Max.Build.0 = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Max nt.ActiveCfg = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Max nt.Build.0 = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.nt.ActiveCfg = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.nt.Build.0 = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.pro.ActiveCfg = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.pro.Build.0 = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.pro nt.ActiveCfg = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.pro nt.Build.0 = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Release.ActiveCfg = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Release.Build.0 = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.classic.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.classic.Build.0 = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.classic nt.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.classic nt.Build.0 = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Debug.ActiveCfg = Debug|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Debug.Build.0 = Debug|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Classic.ActiveCfg = Debug|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Debug.ActiveCfg = Debug|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Pro.ActiveCfg = Debug|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Release.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Max.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Max.Build.0 = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Max nt.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.nt.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.nt.Build.0 = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro.Build.0 = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro nt.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro nt.Build.0 = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Release.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Release.Build.0 = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.classic.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.classic.Build.0 = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.classic nt.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.classic nt.Build.0 = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Debug.ActiveCfg = Debug|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Debug.Build.0 = Debug|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Classic.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Debug.ActiveCfg = Debug|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Pro.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Release.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Max.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Max.Build.0 = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Max nt.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Max nt.Build.0 = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.nt.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.nt.Build.0 = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.pro.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.pro.Build.0 = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.pro nt.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.pro nt.Build.0 = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Release.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/VC++Files/mysqlbinlog/mysqlbinlog.vcproj b/VC++Files/mysqlbinlog/mysqlbinlog.vcproj new file mode 100644 index 00000000000..9d5d4db2565 --- /dev/null +++ b/VC++Files/mysqlbinlog/mysqlbinlog.vcproj @@ -0,0 +1,271 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/mysqlcheck/mysqlcheck.vcproj b/VC++Files/mysqlcheck/mysqlcheck.vcproj new file mode 100644 index 00000000000..f47e171fd65 --- /dev/null +++ b/VC++Files/mysqlcheck/mysqlcheck.vcproj @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/mysqldemb/mysqldemb.vcproj b/VC++Files/mysqldemb/mysqldemb.vcproj new file mode 100644 index 00000000000..52081adb214 --- /dev/null +++ b/VC++Files/mysqldemb/mysqldemb.vcproj @@ -0,0 +1,2960 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/mysqlserver/dummy.cpp b/VC++Files/mysqlserver/dummy.cpp new file mode 100644 index 00000000000..e69de29bb2d diff --git a/VC++Files/mysqlserver/mysqlserver.vcproj b/VC++Files/mysqlserver/mysqlserver.vcproj new file mode 100644 index 00000000000..43988b8489c --- /dev/null +++ b/VC++Files/mysqlserver/mysqlserver.vcproj @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/mysys/mysys.vcproj b/VC++Files/mysys/mysys.vcproj new file mode 100644 index 00000000000..d0a1fb5755d --- /dev/null +++ b/VC++Files/mysys/mysys.vcproj @@ -0,0 +1,4792 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/perror/perror.vcproj b/VC++Files/perror/perror.vcproj new file mode 100644 index 00000000000..2a7bb6407c0 --- /dev/null +++ b/VC++Files/perror/perror.vcproj @@ -0,0 +1,255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/regex/regex.vcproj b/VC++Files/regex/regex.vcproj new file mode 100644 index 00000000000..1b52017ca3b --- /dev/null +++ b/VC++Files/regex/regex.vcproj @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/replace/replace.vcproj b/VC++Files/replace/replace.vcproj new file mode 100644 index 00000000000..270ff494539 --- /dev/null +++ b/VC++Files/replace/replace.vcproj @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/sql/mysqld.vcproj b/VC++Files/sql/mysqld.vcproj new file mode 100644 index 00000000000..61b201693c0 --- /dev/null +++ b/VC++Files/sql/mysqld.vcproj @@ -0,0 +1,7834 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/strings/strings.vcproj b/VC++Files/strings/strings.vcproj new file mode 100644 index 00000000000..50063044692 --- /dev/null +++ b/VC++Files/strings/strings.vcproj @@ -0,0 +1,993 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/test1/test1.vcproj b/VC++Files/test1/test1.vcproj new file mode 100644 index 00000000000..6a850f7b2e3 --- /dev/null +++ b/VC++Files/test1/test1.vcproj @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/tests/mysql_client_test.vcproj b/VC++Files/tests/mysql_client_test.vcproj new file mode 100644 index 00000000000..89a9b71e60a --- /dev/null +++ b/VC++Files/tests/mysql_client_test.vcproj @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/thr_test/thr_test.vcproj b/VC++Files/thr_test/thr_test.vcproj new file mode 100644 index 00000000000..ede9bd04de8 --- /dev/null +++ b/VC++Files/thr_test/thr_test.vcproj @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/vio/vio.vcproj b/VC++Files/vio/vio.vcproj new file mode 100644 index 00000000000..3f50c1546fb --- /dev/null +++ b/VC++Files/vio/vio.vcproj @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/zlib/zlib.vcproj b/VC++Files/zlib/zlib.vcproj new file mode 100644 index 00000000000..ee17d915a1a --- /dev/null +++ b/VC++Files/zlib/zlib.vcproj @@ -0,0 +1,483 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/mysql.cc b/client/mysql.cc index e73d627d67a..155c4217146 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -993,7 +993,7 @@ static int read_lines(bool execute_commands) unsigned long clen; do { - line= my_cgets(tmpbuf.ptr(), tmpbuf.alloced_length()-1, &clen); + line= my_cgets((char*)tmpbuf.ptr(), tmpbuf.alloced_length()-1, &clen); buffer.append(line, clen); /* if we got buffer fully filled than there is a chance that diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 71d61b7a02d..15e9b106da8 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -199,11 +199,10 @@ copy_dir_files() print_debug "Creating directory '$arg'" mkdir $BASE/$arg fi - for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.dsp \ - README INSTALL* LICENSE *.inc *.test *.result \ - *.pem Moscow_leap des_key_file *.dat *.000001 \ - *.require *.opt - + for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.dsp *.dsw \ + README INSTALL* LICENSE AUTHORS NEWS ChangeLog \ + *.inc *.test *.result *.pem Moscow_leap des_key_file \ + *.vcproj *.sln *.dat *.000001 *.require *.opt do if [ -f $i ] then @@ -234,6 +233,7 @@ copy_dir_dirs() { find $arg -type d \ -and -not -path \*SCCS\* \ -and -not -path \*.deps\* \ + -and -not -path \*.libs\* \ -and -not -path \*autom4te.cache -print )|( while read v @@ -326,6 +326,8 @@ do $CP -R $i $BASE/$i fi fi + # But remove object files from destination + find $BASE/$i -type f -name \*.o | xargs rm -f done # @@ -339,7 +341,9 @@ mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp # Search the tree for plain text files and adapt the line end marker # find $BASE \( -name "*.dsp" -o -name "*.dsw" -o -name "*.cnf" -o -name "*.ini" \ - -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \) -type f -print \ + -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT \ + -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \ + -o -name "*.vcproj" -o -name "*.sln" \) -type f -print \ | while read v do unix_to_dos $v diff --git a/sql/des_key_file.cc b/sql/des_key_file.cc index 342939ad8ba..77cb0c8de0f 100644 --- a/sql/des_key_file.cc +++ b/sql/des_key_file.cc @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include "mysql_priv.h" #include #ifdef HAVE_OPENSSL From afed50ae53a3464a6e7814d64126d53c19892089 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 15:06:41 +0300 Subject: [PATCH 195/225] InnoDB: After review fix sql/ha_innodb.cc: Avoid bitwise arithmetics, as it might be difficult to read. The added readability costs one register and two instructions on x86. --- sql/ha_innodb.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index ddda83d6ad9..5b0e5377962 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2635,7 +2635,7 @@ innobase_convert_and_store_changed_col( && cset <= 144/*ucs2_persian_ci*/)) { /* space=0x0020 */ /* Trim "half-chars", just in case. */ - len &= ~1; + len = len - (len % 2); /* len &= ~1; */ while (len && data[len - 2] == 0x00 && data[len - 1] == 0x20) { From 9b7e4a2aae5dd6ebe380f242d9d6caf295359115 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 17:30:33 +0400 Subject: [PATCH 196/225] Fix for bug #13629 "view test crashes for debug build" (also includes better fix for bug #13451 "view test produces warning about unfreed memory"). sql/sql_view.cc: mysql_rename_view(): Intead of doing full-blown opening of view and then doing extensive cleanup of its and main LEXes afterwards, let us just read and parse its .FRM file. --- sql/sql_view.cc | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 36b49196456..f956d9d4928 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -482,8 +482,6 @@ err: /* index of revision number in following table */ static const int revision_number_position= 8; -/* index of source */ -static const int source_number_position= 11; /* index of last required parameter for making view */ static const int required_view_parameters= 10; /* number of backups */ @@ -1414,17 +1412,27 @@ mysql_rename_view(THD *thd, if ((parser= sql_parse_prepare(&pathstr, thd->mem_root, 1)) && is_equal(&view_type, parser->type())) { + TABLE_LIST view_def; char dir_buff[FN_REFLEN], file_buff[FN_REFLEN]; + /* + To be PS-friendly we should either to restore state of + TABLE_LIST object pointed by 'view' after using it for + view definition parsing or use temporary 'view_def' + object for it. + */ + bzero(&view_def, sizeof(view_def)); + view_def.timestamp.str= view_def.timestamp_buffer; + view_def.view_suid= TRUE; + /* get view definition and source */ - if (mysql_make_view(parser, view) || - parser->parse((gptr)view, thd->mem_root, - view_parameters + source_number_position, 1)) + if (parser->parse((gptr)&view_def, thd->mem_root, view_parameters, + sizeof(view_parameters)/sizeof(view_parameters[0])-1)) goto err; /* rename view and it's backups */ if (rename_in_schema_file(view->db, view->table_name, new_name, - view->revision - 1, num_view_backups)) + view_def.revision - 1, num_view_backups)) goto err; strxnmov(dir_buff, FN_REFLEN, mysql_data_home, "/", view->db, "/", NullS); @@ -1438,12 +1446,12 @@ mysql_rename_view(THD *thd, - file_buff); if (sql_create_definition_file(&pathstr, &file, view_file_type, - (gptr)view, view_parameters, + (gptr)&view_def, view_parameters, num_view_backups)) { /* restore renamed view in case of error */ rename_in_schema_file(view->db, new_name, view->table_name, - view->revision - 1, num_view_backups); + view_def.revision - 1, num_view_backups); goto err; } } else @@ -1455,10 +1463,5 @@ mysql_rename_view(THD *thd, error= FALSE; err: - /* - We have to explicitly call destructor for view's LEX since it won't - be called otherwise. - */ - delete view->view; DBUG_RETURN(error); } From 2477092651ab4d9b2bd0cb47b938cfe948f2b1d8 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 16:33:27 +0200 Subject: [PATCH 197/225] Removed all Visual Studio .Net .vcproj files to be able to back-port to 4.1 and merge forward to 5.x again properly. BitKeeper/deleted/.del-bdb.vcproj~ed8534936e40cefb: Delete: VC++Files/bdb/bdb.vcproj BitKeeper/deleted/.del-mysql.vcproj~f542eaa36b79459d: Delete: VC++Files/client/mysql.vcproj BitKeeper/deleted/.del-mysqladmin.vcproj~4735738126ddd45f: Delete: VC++Files/client/mysqladmin.vcproj BitKeeper/deleted/.del-mysqlclient.vcproj~4e8fd6c239c455e7: Delete: VC++Files/client/mysqlclient.vcproj BitKeeper/deleted/.del-mysqldump.vcproj~72e1d52e8264ee24: Delete: VC++Files/client/mysqldump.vcproj BitKeeper/deleted/.del-mysqlimport.vcproj~f3413e59c84590a6: Delete: VC++Files/client/mysqlimport.vcproj BitKeeper/deleted/.del-mysqlshow.vcproj~89671830c737ad67: Delete: VC++Files/client/mysqlshow.vcproj BitKeeper/deleted/.del-comp_err.vcproj~43c2674631ff6dcd: Delete: VC++Files/comp_err/comp_err.vcproj BitKeeper/deleted/.del-dbug.vcproj~cec9ed672efe1999: Delete: VC++Files/dbug/dbug.vcproj BitKeeper/deleted/.del-heap.vcproj~70c0cc1d680a51c1: Delete: VC++Files/heap/heap.vcproj BitKeeper/deleted/.del-innobase.vcproj~71e1de81f11138bf: Delete: VC++Files/innobase/innobase.vcproj BitKeeper/deleted/.del-mysqltest.vcproj~bba9139c2e68286a: Delete: VC++Files/client/mysqltest.vcproj BitKeeper/deleted/.del-libmysql.vcproj~76b7601f350cd80c: Delete: VC++Files/libmysql/libmysql.vcproj BitKeeper/deleted/.del-libmysqld.vcproj~a1d46f8635014df2: Delete: VC++Files/libmysqld/libmysqld.vcproj BitKeeper/deleted/.del-myTest.vcproj~9dcbfc99784da76d: Delete: VC++Files/libmysqltest/myTest.vcproj BitKeeper/deleted/.del-my_print_defaults.vcproj~805e02c029c13a3d: Delete: VC++Files/my_print_defaults/my_print_defaults.vcproj BitKeeper/deleted/.del-test_libmysqld.vcproj~8ff2f936c65b4814: Delete: VC++Files/libmysqld/examples/test_libmysqld.vcproj BitKeeper/deleted/.del-myisam.vcproj~32bb9e4a163fcb5a: Delete: VC++Files/myisam/myisam.vcproj BitKeeper/deleted/.del-myisam_ftdump.vcproj~cf156af17f00e691: Delete: VC++Files/myisam_ftdump/myisam_ftdump.vcproj BitKeeper/deleted/.del-myisamchk.vcproj~ca51391a749b5066: Delete: VC++Files/myisamchk/myisamchk.vcproj BitKeeper/deleted/.del-myisamlog.vcproj~b642178bf2a443e: Delete: VC++Files/myisamlog/myisamlog.vcproj BitKeeper/deleted/.del-myisammrg.vcproj~6534e59acbfbb63: Delete: VC++Files/myisammrg/myisammrg.vcproj BitKeeper/deleted/.del-myisampack.vcproj~3df8a31f3b603a8: Delete: VC++Files/myisampack/myisampack.vcproj BitKeeper/deleted/.del-mysql.sln~f2120278f8a437be: Delete: VC++Files/mysql.sln BitKeeper/deleted/.del-mysql_test_run_new.vcproj~c953b417c83523a0: Delete: VC++Files/mysql-test/mysql_test_run_new.vcproj BitKeeper/deleted/.del-mysqlbinlog.vcproj~d3fd2c6ed118cd99: Delete: VC++Files/mysqlbinlog/mysqlbinlog.vcproj BitKeeper/deleted/.del-mysqlcheck.vcproj~562fe5a45c9337df: Delete: VC++Files/mysqlcheck/mysqlcheck.vcproj BitKeeper/deleted/.del-mysqldemb.vcproj~a3e9e254c6b572ff: Delete: VC++Files/mysqldemb/mysqldemb.vcproj BitKeeper/deleted/.del-mysqlserver.vcproj~31349c409587c097: Delete: VC++Files/mysqlserver/mysqlserver.vcproj BitKeeper/deleted/.del-mysys.vcproj~6be390f26fc5539a: Delete: VC++Files/mysys/mysys.vcproj BitKeeper/deleted/.del-perror.vcproj~622c06abaff48379: Delete: VC++Files/perror/perror.vcproj BitKeeper/deleted/.del-regex.vcproj~9dfe1e8c7395a8e5: Delete: VC++Files/regex/regex.vcproj BitKeeper/deleted/.del-replace.vcproj~921ddc8d8383ffc6: Delete: VC++Files/replace/replace.vcproj BitKeeper/deleted/.del-mysql_client_test.vcproj~624117036ff1d17c: Delete: VC++Files/tests/mysql_client_test.vcproj BitKeeper/deleted/.del-mysqld.vcproj~703886a28862bb2: Delete: VC++Files/sql/mysqld.vcproj BitKeeper/deleted/.del-strings.vcproj~62578a38fd9e976: Delete: VC++Files/strings/strings.vcproj BitKeeper/deleted/.del-test1.vcproj~f47ec733f5da69d5: Delete: VC++Files/test1/test1.vcproj BitKeeper/deleted/.del-thr_test.vcproj~f5b31bfbc5366334: Delete: VC++Files/thr_test/thr_test.vcproj BitKeeper/deleted/.del-dummy.cpp~d1d2a28e28f91f20: Delete: VC++Files/mysqlserver/dummy.cpp BitKeeper/deleted/.del-vio.vcproj~f575b4666be84569: Delete: VC++Files/vio/vio.vcproj BitKeeper/deleted/.del-zlib.vcproj~997ad815f1f4b73: Delete: VC++Files/zlib/zlib.vcproj --- VC++Files/bdb/bdb.vcproj | 3227 ------ VC++Files/client/mysql.vcproj | 318 - VC++Files/client/mysqladmin.vcproj | 232 - VC++Files/client/mysqlclient.vcproj | 3333 ------- VC++Files/client/mysqldump.vcproj | 232 - VC++Files/client/mysqlimport.vcproj | 232 - VC++Files/client/mysqlshow.vcproj | 232 - VC++Files/client/mysqltest.vcproj | 264 - VC++Files/comp_err/comp_err.vcproj | 93 - VC++Files/dbug/dbug.vcproj | 249 - VC++Files/heap/heap.vcproj | 1061 -- VC++Files/innobase/innobase.vcproj | 2958 ------ VC++Files/libmysql/libmysql.vcproj | 2298 ----- .../libmysqld/examples/test_libmysqld.vcproj | 130 - VC++Files/libmysqld/libmysqld.vcproj | 4500 --------- VC++Files/libmysqltest/myTest.vcproj | 162 - .../my_print_defaults.vcproj | 245 - VC++Files/myisam/myisam.vcproj | 2094 ---- VC++Files/myisam_ftdump/myisam_ftdump.vcproj | 174 - VC++Files/myisamchk/myisamchk.vcproj | 244 - VC++Files/myisamlog/myisamlog.vcproj | 244 - VC++Files/myisammrg/myisammrg.vcproj | 968 -- VC++Files/myisampack/myisampack.vcproj | 247 - .../mysql-test/mysql_test_run_new.vcproj | 204 - VC++Files/mysql.sln | 1272 --- VC++Files/mysqlbinlog/mysqlbinlog.vcproj | 271 - VC++Files/mysqlcheck/mysqlcheck.vcproj | 244 - VC++Files/mysqldemb/mysqldemb.vcproj | 2960 ------ VC++Files/mysqlserver/dummy.cpp | 0 VC++Files/mysqlserver/mysqlserver.vcproj | 126 - VC++Files/mysys/mysys.vcproj | 4792 --------- VC++Files/perror/perror.vcproj | 255 - VC++Files/regex/regex.vcproj | 252 - VC++Files/replace/replace.vcproj | 229 - VC++Files/sql/mysqld.vcproj | 8659 ----------------- VC++Files/strings/strings.vcproj | 1034 -- VC++Files/test1/test1.vcproj | 161 - VC++Files/tests/mysql_client_test.vcproj | 163 - VC++Files/thr_test/thr_test.vcproj | 162 - VC++Files/vio/vio.vcproj | 204 - VC++Files/zlib/zlib.vcproj | 483 - 41 files changed, 45208 deletions(-) delete mode 100755 VC++Files/bdb/bdb.vcproj delete mode 100755 VC++Files/client/mysql.vcproj delete mode 100755 VC++Files/client/mysqladmin.vcproj delete mode 100755 VC++Files/client/mysqlclient.vcproj delete mode 100755 VC++Files/client/mysqldump.vcproj delete mode 100755 VC++Files/client/mysqlimport.vcproj delete mode 100755 VC++Files/client/mysqlshow.vcproj delete mode 100755 VC++Files/client/mysqltest.vcproj delete mode 100755 VC++Files/comp_err/comp_err.vcproj delete mode 100755 VC++Files/dbug/dbug.vcproj delete mode 100755 VC++Files/heap/heap.vcproj delete mode 100755 VC++Files/innobase/innobase.vcproj delete mode 100755 VC++Files/libmysql/libmysql.vcproj delete mode 100755 VC++Files/libmysqld/examples/test_libmysqld.vcproj delete mode 100755 VC++Files/libmysqld/libmysqld.vcproj delete mode 100755 VC++Files/libmysqltest/myTest.vcproj delete mode 100755 VC++Files/my_print_defaults/my_print_defaults.vcproj delete mode 100755 VC++Files/myisam/myisam.vcproj delete mode 100755 VC++Files/myisam_ftdump/myisam_ftdump.vcproj delete mode 100755 VC++Files/myisamchk/myisamchk.vcproj delete mode 100755 VC++Files/myisamlog/myisamlog.vcproj delete mode 100755 VC++Files/myisammrg/myisammrg.vcproj delete mode 100755 VC++Files/myisampack/myisampack.vcproj delete mode 100755 VC++Files/mysql-test/mysql_test_run_new.vcproj delete mode 100755 VC++Files/mysql.sln delete mode 100755 VC++Files/mysqlbinlog/mysqlbinlog.vcproj delete mode 100755 VC++Files/mysqlcheck/mysqlcheck.vcproj delete mode 100755 VC++Files/mysqldemb/mysqldemb.vcproj delete mode 100755 VC++Files/mysqlserver/dummy.cpp delete mode 100755 VC++Files/mysqlserver/mysqlserver.vcproj delete mode 100755 VC++Files/mysys/mysys.vcproj delete mode 100755 VC++Files/perror/perror.vcproj delete mode 100755 VC++Files/regex/regex.vcproj delete mode 100755 VC++Files/replace/replace.vcproj delete mode 100755 VC++Files/sql/mysqld.vcproj delete mode 100755 VC++Files/strings/strings.vcproj delete mode 100755 VC++Files/test1/test1.vcproj delete mode 100755 VC++Files/tests/mysql_client_test.vcproj delete mode 100755 VC++Files/thr_test/thr_test.vcproj delete mode 100755 VC++Files/vio/vio.vcproj delete mode 100755 VC++Files/zlib/zlib.vcproj diff --git a/VC++Files/bdb/bdb.vcproj b/VC++Files/bdb/bdb.vcproj deleted file mode 100755 index 6258da3cb3a..00000000000 --- a/VC++Files/bdb/bdb.vcproj +++ /dev/null @@ -1,3227 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/client/mysql.vcproj b/VC++Files/client/mysql.vcproj deleted file mode 100755 index 72cc4ba6b89..00000000000 --- a/VC++Files/client/mysql.vcproj +++ /dev/null @@ -1,318 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/client/mysqladmin.vcproj b/VC++Files/client/mysqladmin.vcproj deleted file mode 100755 index 188bf61dff7..00000000000 --- a/VC++Files/client/mysqladmin.vcproj +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/client/mysqlclient.vcproj b/VC++Files/client/mysqlclient.vcproj deleted file mode 100755 index eebba9ebe0e..00000000000 --- a/VC++Files/client/mysqlclient.vcproj +++ /dev/null @@ -1,3333 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/client/mysqldump.vcproj b/VC++Files/client/mysqldump.vcproj deleted file mode 100755 index b6a33596083..00000000000 --- a/VC++Files/client/mysqldump.vcproj +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/client/mysqlimport.vcproj b/VC++Files/client/mysqlimport.vcproj deleted file mode 100755 index ef440c2fe5a..00000000000 --- a/VC++Files/client/mysqlimport.vcproj +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/client/mysqlshow.vcproj b/VC++Files/client/mysqlshow.vcproj deleted file mode 100755 index a0707680728..00000000000 --- a/VC++Files/client/mysqlshow.vcproj +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/client/mysqltest.vcproj b/VC++Files/client/mysqltest.vcproj deleted file mode 100755 index 5c075740fbd..00000000000 --- a/VC++Files/client/mysqltest.vcproj +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/comp_err/comp_err.vcproj b/VC++Files/comp_err/comp_err.vcproj deleted file mode 100755 index b12ef8b0af1..00000000000 --- a/VC++Files/comp_err/comp_err.vcproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/dbug/dbug.vcproj b/VC++Files/dbug/dbug.vcproj deleted file mode 100755 index 57257451aea..00000000000 --- a/VC++Files/dbug/dbug.vcproj +++ /dev/null @@ -1,249 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/heap/heap.vcproj b/VC++Files/heap/heap.vcproj deleted file mode 100755 index b2afd752acf..00000000000 --- a/VC++Files/heap/heap.vcproj +++ /dev/null @@ -1,1061 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/innobase/innobase.vcproj b/VC++Files/innobase/innobase.vcproj deleted file mode 100755 index 9d972366440..00000000000 --- a/VC++Files/innobase/innobase.vcproj +++ /dev/null @@ -1,2958 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/libmysql/libmysql.vcproj b/VC++Files/libmysql/libmysql.vcproj deleted file mode 100755 index 9ba877e0520..00000000000 --- a/VC++Files/libmysql/libmysql.vcproj +++ /dev/null @@ -1,2298 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/libmysqld/examples/test_libmysqld.vcproj b/VC++Files/libmysqld/examples/test_libmysqld.vcproj deleted file mode 100755 index bf26fbd6588..00000000000 --- a/VC++Files/libmysqld/examples/test_libmysqld.vcproj +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/libmysqld/libmysqld.vcproj b/VC++Files/libmysqld/libmysqld.vcproj deleted file mode 100755 index eb411f79362..00000000000 --- a/VC++Files/libmysqld/libmysqld.vcproj +++ /dev/null @@ -1,4500 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/libmysqltest/myTest.vcproj b/VC++Files/libmysqltest/myTest.vcproj deleted file mode 100755 index afc44b482c9..00000000000 --- a/VC++Files/libmysqltest/myTest.vcproj +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/my_print_defaults/my_print_defaults.vcproj b/VC++Files/my_print_defaults/my_print_defaults.vcproj deleted file mode 100755 index e49039b6a1e..00000000000 --- a/VC++Files/my_print_defaults/my_print_defaults.vcproj +++ /dev/null @@ -1,245 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/myisam/myisam.vcproj b/VC++Files/myisam/myisam.vcproj deleted file mode 100755 index b63b7ffaccc..00000000000 --- a/VC++Files/myisam/myisam.vcproj +++ /dev/null @@ -1,2094 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/myisam_ftdump/myisam_ftdump.vcproj b/VC++Files/myisam_ftdump/myisam_ftdump.vcproj deleted file mode 100755 index 4d1013775fa..00000000000 --- a/VC++Files/myisam_ftdump/myisam_ftdump.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/myisamchk/myisamchk.vcproj b/VC++Files/myisamchk/myisamchk.vcproj deleted file mode 100755 index 33f813024b5..00000000000 --- a/VC++Files/myisamchk/myisamchk.vcproj +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/myisamlog/myisamlog.vcproj b/VC++Files/myisamlog/myisamlog.vcproj deleted file mode 100755 index 6189a54d33b..00000000000 --- a/VC++Files/myisamlog/myisamlog.vcproj +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/myisammrg/myisammrg.vcproj b/VC++Files/myisammrg/myisammrg.vcproj deleted file mode 100755 index 3075f8ef9f6..00000000000 --- a/VC++Files/myisammrg/myisammrg.vcproj +++ /dev/null @@ -1,968 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/myisampack/myisampack.vcproj b/VC++Files/myisampack/myisampack.vcproj deleted file mode 100755 index 27a8653cc5a..00000000000 --- a/VC++Files/myisampack/myisampack.vcproj +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/mysql-test/mysql_test_run_new.vcproj b/VC++Files/mysql-test/mysql_test_run_new.vcproj deleted file mode 100755 index 12d502e5768..00000000000 --- a/VC++Files/mysql-test/mysql_test_run_new.vcproj +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/mysql.sln b/VC++Files/mysql.sln deleted file mode 100755 index ffa2050bbed..00000000000 --- a/VC++Files/mysql.sln +++ /dev/null @@ -1,1272 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bdb", "bdb\bdb.vcproj", "{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "comp_err", "comp_err\comp_err.vcproj", "{1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}" - ProjectSection(ProjectDependencies) = postProject - {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dbug", "dbug\dbug.vcproj", "{FC369DF4-AEB7-4531-BF34-A638C4363BFE}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "heap", "heap\heap.vcproj", "{C70A6DC7-7D45-4C16-8654-7E57713A4C04}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "innobase", "innobase\innobase.vcproj", "{13D37150-54D0-46C5-9519-03923243C7C7}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmysql", "libmysql\libmysql.vcproj", "{1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}" - ProjectSection(ProjectDependencies) = postProject - {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmysqld", "libmysqld\libmysqld.vcproj", "{93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}" - ProjectSection(ProjectDependencies) = postProject - {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} = {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} - {13D37150-54D0-46C5-9519-03923243C7C7} = {13D37150-54D0-46C5-9519-03923243C7C7} - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3} = {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3} - {DB28DE80-837F-4497-9AA9-CC0A20584C98} = {DB28DE80-837F-4497-9AA9-CC0A20584C98} - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0} = {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0} - {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - {C70A6DC7-7D45-4C16-8654-7E57713A4C04} = {C70A6DC7-7D45-4C16-8654-7E57713A4C04} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myTest", "libmysqltest\myTest.vcproj", "{2794E434-7CCE-44DB-B2FB-789ABE53D6B9}" - ProjectSection(ProjectDependencies) = postProject - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F} = {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "my_print_defaults", "my_print_defaults\my_print_defaults.vcproj", "{B0EC3594-CD67-4364-826E-BA75EF2050F8}" - ProjectSection(ProjectDependencies) = postProject - {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisam", "myisam\myisam.vcproj", "{262280A8-37D5-4037-BDFB-242468DFB3D2}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisam_ftdump", "myisam_ftdump\myisam_ftdump.vcproj", "{4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}" - ProjectSection(ProjectDependencies) = postProject - {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} - {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisamchk", "myisamchk\myisamchk.vcproj", "{87CD9881-D234-4306-BBC6-0668C6168C0F}" - ProjectSection(ProjectDependencies) = postProject - {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} - {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisamlog", "myisamlog\myisamlog.vcproj", "{194F5EE6-9440-4298-A6FE-A9B4B480B44C}" - ProjectSection(ProjectDependencies) = postProject - {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} - {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisammrg", "myisammrg\myisammrg.vcproj", "{D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisampack", "myisampack\myisampack.vcproj", "{EF833A1E-E358-4B6C-9C27-9489E85041CC}" - ProjectSection(ProjectDependencies) = postProject - {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} - {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysql", "client\mysql.vcproj", "{F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}" - ProjectSection(ProjectDependencies) = postProject - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} - {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqladmin", "client\mysqladmin.vcproj", "{D2B00DE0-F6E9-40AF-B90D-A257D014F098}" - ProjectSection(ProjectDependencies) = postProject - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} - {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlbinlog", "mysqlbinlog\mysqlbinlog.vcproj", "{DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}" - ProjectSection(ProjectDependencies) = postProject - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} - {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlcheck", "mysqlcheck\mysqlcheck.vcproj", "{67154F28-D076-419E-B149-819EF548E670}" - ProjectSection(ProjectDependencies) = postProject - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} - {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlclient", "client\mysqlclient.vcproj", "{26383276-4843-494B-8BE0-8936ED3EBAAB}" - ProjectSection(ProjectDependencies) = postProject - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqld", "sql\mysqld.vcproj", "{62E85884-3ACF-4F4C-873B-60B878147890}" - ProjectSection(ProjectDependencies) = postProject - {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} = {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} - {13D37150-54D0-46C5-9519-03923243C7C7} = {13D37150-54D0-46C5-9519-03923243C7C7} - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3} = {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3} - {DB28DE80-837F-4497-9AA9-CC0A20584C98} = {DB28DE80-837F-4497-9AA9-CC0A20584C98} - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0} = {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0} - {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B} = {F74653C4-8003-4A79-8F53-FC69E0AD7A9B} - {C70A6DC7-7D45-4C16-8654-7E57713A4C04} = {C70A6DC7-7D45-4C16-8654-7E57713A4C04} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqldemb", "mysqldemb\mysqldemb.vcproj", "{37D9BA79-302E-4582-A545-CB5FF7982EA3}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqldump", "client\mysqldump.vcproj", "{89F24ECE-9953-40EF-BDF4-B41F5631E92B}" - ProjectSection(ProjectDependencies) = postProject - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} - {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlimport", "client\mysqlimport.vcproj", "{AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}" - ProjectSection(ProjectDependencies) = postProject - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} - {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlserver", "mysqlserver\mysqlserver.vcproj", "{94B86159-C581-42CD-825D-C69CBC237E5C}" - ProjectSection(ProjectDependencies) = postProject - {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} = {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} - {13D37150-54D0-46C5-9519-03923243C7C7} = {13D37150-54D0-46C5-9519-03923243C7C7} - {37D9BA79-302E-4582-A545-CB5FF7982EA3} = {37D9BA79-302E-4582-A545-CB5FF7982EA3} - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0} = {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0} - {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - {C70A6DC7-7D45-4C16-8654-7E57713A4C04} = {C70A6DC7-7D45-4C16-8654-7E57713A4C04} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlshow", "client\mysqlshow.vcproj", "{3737BFE2-EF25-464F-994D-BD28A9F84528}" - ProjectSection(ProjectDependencies) = postProject - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} - {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yassl", "extra\yassl\yassl.vcproj", "{BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}" - ProjectSection(ProjectDependencies) = postProject - {DB28DE80-837F-4497-9AA9-CC0A20584C98} = {DB28DE80-837F-4497-9AA9-CC0A20584C98} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "taocrypt", "extra\yassl\taocrypt\taocrypt.vcproj", "{DB28DE80-837F-4497-9AA9-CC0A20584C98}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysys", "mysys\mysys.vcproj", "{44D9C7DC-6636-4B82-BD01-6876C64017DF}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "perror", "perror\perror.vcproj", "{AC47623D-933C-4A80-83BB-B6AF7CB28B4B}" - ProjectSection(ProjectDependencies) = postProject - {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "regex", "regex\regex.vcproj", "{207E9014-C4D1-4F6D-B76F-BC7DD7E31113}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "replace", "replace\replace.vcproj", "{16699B52-ECC6-4A96-A99F-A043059BA2E7}" - ProjectSection(ProjectDependencies) = postProject - {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "strings", "strings\strings.vcproj", "{EEC1300B-85A5-497C-B3E1-F708021DF859}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test1", "test1\test1.vcproj", "{8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}" - ProjectSection(ProjectDependencies) = postProject - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F} = {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_libmysqld", "libmysqld\examples\test_libmysqld.vcproj", "{6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}" - ProjectSection(ProjectDependencies) = postProject - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} - {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9} = {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "thr_test", "thr_test\thr_test.vcproj", "{7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}" - ProjectSection(ProjectDependencies) = postProject - {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vio", "vio\vio.vcproj", "{F74653C4-8003-4A79-8F53-FC69E0AD7A9B}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib\zlib.vcproj", "{8762A9B8-72A9-462E-A9A2-F3265081F8AF}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqltest", "client\mysqltest.vcproj", "{8961F149-C68A-4154-A499-A2AB39E607E8}" - ProjectSection(ProjectDependencies) = postProject - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} = {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} - {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysql_client_test", "tests\mysql_client_test.vcproj", "{DA224DAB-5006-42BE-BB77-16E8BE5326D5}" - ProjectSection(ProjectDependencies) = postProject - {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysql_test_run_new", "mysql-test\mysql_test_run_new.vcproj", "{6189F838-21C6-42A1-B2D0-9146316573F7}" - ProjectSection(ProjectDependencies) = postProject - {8961F149-C68A-4154-A499-A2AB39E607E8} = {8961F149-C68A-4154-A499-A2AB39E607E8} - {DA224DAB-5006-42BE-BB77-16E8BE5326D5} = {DA224DAB-5006-42BE-BB77-16E8BE5326D5} - {D2B00DE0-F6E9-40AF-B90D-A257D014F098} = {D2B00DE0-F6E9-40AF-B90D-A257D014F098} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlmanager", "server-tools\instance-manager\mysqlmanager.vcproj", "{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}" - ProjectSection(ProjectDependencies) = postProject - {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} - {DB28DE80-837F-4497-9AA9-CC0A20584C98} = {DB28DE80-837F-4497-9AA9-CC0A20584C98} - {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B} = {F74653C4-8003-4A79-8F53-FC69E0AD7A9B} - {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} - {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - classic = classic - classic nt = classic nt - Debug = Debug - Embedded_Classic = Embedded_Classic - Embedded_Debug = Embedded_Debug - Embedded_Pro = Embedded_Pro - Embedded_Release = Embedded_Release - Max = Max - Max nt = Max nt - nt = nt - pro = pro - pro nt = pro nt - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.classic.ActiveCfg = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.classic.Build.0 = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.classic nt.ActiveCfg = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.classic nt.Build.0 = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Debug.ActiveCfg = Debug|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Debug.Build.0 = Debug|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Classic.ActiveCfg = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Classic.Build.0 = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Debug.ActiveCfg = Debug|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Debug.Build.0 = Debug|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Pro.ActiveCfg = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Pro.Build.0 = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Release.ActiveCfg = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Release.Build.0 = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Max.ActiveCfg = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Max.Build.0 = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Max nt.ActiveCfg = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Max nt.Build.0 = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.nt.ActiveCfg = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.nt.Build.0 = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro.ActiveCfg = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro.Build.0 = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro nt.ActiveCfg = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro nt.Build.0 = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Release.ActiveCfg = Max|Win32 - {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Release.Build.0 = Max|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.classic.ActiveCfg = Release|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.classic nt.ActiveCfg = Release|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.classic nt.Build.0 = Release|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Debug.ActiveCfg = Release|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Classic.ActiveCfg = Release|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Debug.ActiveCfg = Release|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Pro.ActiveCfg = Release|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Release.ActiveCfg = Release|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Max.ActiveCfg = Release|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Max.Build.0 = Release|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Max nt.ActiveCfg = Release|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Max nt.Build.0 = Release|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.nt.ActiveCfg = Release|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.nt.Build.0 = Release|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro.ActiveCfg = Release|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro.Build.0 = Release|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro nt.ActiveCfg = Release|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro nt.Build.0 = Release|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Release.ActiveCfg = Release|Win32 - {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Release.Build.0 = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.classic.ActiveCfg = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.classic.Build.0 = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.classic nt.ActiveCfg = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.classic nt.Build.0 = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Debug.ActiveCfg = Debug|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Debug.Build.0 = Debug|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Classic.ActiveCfg = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Classic.Build.0 = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Debug.ActiveCfg = TLS_DEBUG|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Debug.Build.0 = TLS_DEBUG|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Pro.ActiveCfg = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Pro.Build.0 = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Release.ActiveCfg = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Release.Build.0 = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Max.ActiveCfg = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Max.Build.0 = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Max nt.ActiveCfg = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Max nt.Build.0 = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.nt.ActiveCfg = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.nt.Build.0 = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro.ActiveCfg = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro.Build.0 = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro nt.ActiveCfg = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro nt.Build.0 = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Release.ActiveCfg = Release|Win32 - {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Release.Build.0 = Release|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.classic.ActiveCfg = Release|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.classic.Build.0 = Release|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.classic nt.ActiveCfg = Release|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.classic nt.Build.0 = Release|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Debug.ActiveCfg = Debug|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Debug.Build.0 = Debug|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Classic.ActiveCfg = TLS|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Classic.Build.0 = TLS|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Debug.ActiveCfg = TLS_DEBUG|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Debug.Build.0 = TLS_DEBUG|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Pro.ActiveCfg = TLS|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Pro.Build.0 = TLS|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Release.ActiveCfg = TLS|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Release.Build.0 = TLS|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Max.ActiveCfg = Release|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Max.Build.0 = Release|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Max nt.ActiveCfg = Release|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Max nt.Build.0 = Release|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.nt.ActiveCfg = Release|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.nt.Build.0 = Release|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro.ActiveCfg = Release|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro.Build.0 = Release|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro nt.ActiveCfg = Release|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro nt.Build.0 = Release|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Release.ActiveCfg = Release|Win32 - {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Release.Build.0 = Release|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.classic.ActiveCfg = Release|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.classic.Build.0 = Release|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.classic nt.ActiveCfg = nt|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.classic nt.Build.0 = nt|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.Debug.ActiveCfg = Debug|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.Debug.Build.0 = Debug|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Classic.ActiveCfg = Release|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Classic.Build.0 = Release|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Debug.ActiveCfg = Debug|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Debug.Build.0 = Debug|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Pro.ActiveCfg = Release|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Pro.Build.0 = Release|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Release.ActiveCfg = Release|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Release.Build.0 = Release|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.Max.ActiveCfg = Release|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.Max.Build.0 = Release|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.Max nt.ActiveCfg = Max nt|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.Max nt.Build.0 = Max nt|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.nt.ActiveCfg = nt|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.nt.Build.0 = nt|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.pro.ActiveCfg = Release|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.pro.Build.0 = Release|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.pro nt.ActiveCfg = nt|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.pro nt.Build.0 = nt|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.Release.ActiveCfg = Release|Win32 - {13D37150-54D0-46C5-9519-03923243C7C7}.Release.Build.0 = Release|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.classic.ActiveCfg = Release|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.classic.Build.0 = Release|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.classic nt.ActiveCfg = Release|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.classic nt.Build.0 = Release|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Debug.ActiveCfg = Debug|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Debug.Build.0 = Debug|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Classic.ActiveCfg = Release|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Debug.ActiveCfg = Debug|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Pro.ActiveCfg = Release|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Release.ActiveCfg = Release|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Max.ActiveCfg = Release|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Max.Build.0 = Release|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Max nt.ActiveCfg = Release|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Max nt.Build.0 = Release|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.nt.ActiveCfg = Release|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.nt.Build.0 = Release|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro.ActiveCfg = Release|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro.Build.0 = Release|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro nt.ActiveCfg = Release|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro nt.Build.0 = Release|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Release.ActiveCfg = Release|Win32 - {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Release.Build.0 = Release|Win32 - {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.classic.ActiveCfg = classic|Win32 - {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.classic nt.ActiveCfg = classic|Win32 - {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Debug.ActiveCfg = Debug|Win32 - {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Classic.ActiveCfg = classic|Win32 - {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Classic.Build.0 = classic|Win32 - {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Debug.ActiveCfg = Debug|Win32 - {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Debug.Build.0 = Debug|Win32 - {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Pro.ActiveCfg = pro|Win32 - {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Pro.Build.0 = pro|Win32 - {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Release.ActiveCfg = Release|Win32 - {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Release.Build.0 = Release|Win32 - {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Max.ActiveCfg = classic|Win32 - {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Max nt.ActiveCfg = classic|Win32 - {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.nt.ActiveCfg = classic|Win32 - {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.pro.ActiveCfg = pro|Win32 - {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.pro nt.ActiveCfg = pro|Win32 - {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Release.ActiveCfg = Release|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.classic.ActiveCfg = Release|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.classic.Build.0 = Release|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.classic nt.ActiveCfg = Release|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.classic nt.Build.0 = Release|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Debug.ActiveCfg = Debug|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Debug.Build.0 = Debug|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Classic.ActiveCfg = Debug|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Debug.ActiveCfg = Debug|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Pro.ActiveCfg = Debug|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Release.ActiveCfg = Release|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Max.ActiveCfg = Release|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Max.Build.0 = Release|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Max nt.ActiveCfg = Release|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Max nt.Build.0 = Release|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.nt.ActiveCfg = Release|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.nt.Build.0 = Release|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro.ActiveCfg = Release|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro.Build.0 = Release|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro nt.ActiveCfg = Release|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro nt.Build.0 = Release|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Release.ActiveCfg = Release|Win32 - {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Release.Build.0 = Release|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.classic.ActiveCfg = classic|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.classic.Build.0 = classic|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.classic nt.ActiveCfg = Release|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.classic nt.Build.0 = Release|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Debug.ActiveCfg = Debug|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Debug.Build.0 = Debug|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Classic.ActiveCfg = Debug|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Debug.ActiveCfg = Debug|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Pro.ActiveCfg = Debug|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Release.ActiveCfg = Release|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Max.ActiveCfg = Release|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Max.Build.0 = Release|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Max nt.ActiveCfg = Release|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Max nt.Build.0 = Release|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.nt.ActiveCfg = Release|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.nt.Build.0 = Release|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro.ActiveCfg = Release|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro.Build.0 = Release|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro nt.ActiveCfg = Release|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro nt.Build.0 = Release|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Release.ActiveCfg = Release|Win32 - {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Release.Build.0 = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.classic.ActiveCfg = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.classic.Build.0 = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.classic nt.ActiveCfg = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.classic nt.Build.0 = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.Debug.ActiveCfg = Debug|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.Debug.Build.0 = Debug|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Classic.ActiveCfg = TLS|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Classic.Build.0 = TLS|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Debug.ActiveCfg = Debug|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Debug.Build.0 = Debug|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Pro.ActiveCfg = TLS|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Pro.Build.0 = TLS|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Release.ActiveCfg = TLS|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Release.Build.0 = TLS|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.Max.ActiveCfg = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.Max.Build.0 = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.Max nt.ActiveCfg = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.Max nt.Build.0 = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.nt.ActiveCfg = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.nt.Build.0 = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro.ActiveCfg = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro.Build.0 = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro nt.ActiveCfg = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro nt.Build.0 = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.Release.ActiveCfg = Release|Win32 - {262280A8-37D5-4037-BDFB-242468DFB3D2}.Release.Build.0 = Release|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic.ActiveCfg = Release|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic.Build.0 = Release|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic nt.ActiveCfg = Release|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic nt.Build.0 = Release|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Debug.ActiveCfg = Debug|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Debug.Build.0 = Debug|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Classic.ActiveCfg = Release|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Debug.ActiveCfg = Debug|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Pro.ActiveCfg = Release|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Release.ActiveCfg = Release|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Max.ActiveCfg = Release|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Max.Build.0 = Release|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Max nt.ActiveCfg = Release|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Max nt.Build.0 = Release|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.nt.ActiveCfg = Release|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.nt.Build.0 = Release|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro.ActiveCfg = Release|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro.Build.0 = Release|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro nt.ActiveCfg = Release|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro nt.Build.0 = Release|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Release.ActiveCfg = Release|Win32 - {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Release.Build.0 = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.classic.ActiveCfg = classic|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.classic.Build.0 = classic|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.classic nt.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.classic nt.Build.0 = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.Debug.ActiveCfg = Debug|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.Debug.Build.0 = Debug|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Classic.ActiveCfg = Debug|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Debug.ActiveCfg = Debug|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Pro.ActiveCfg = Debug|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Release.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.Max.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.Max.Build.0 = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.Max nt.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.Max nt.Build.0 = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.nt.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.nt.Build.0 = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro.Build.0 = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro nt.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro nt.Build.0 = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.Release.ActiveCfg = Release|Win32 - {87CD9881-D234-4306-BBC6-0668C6168C0F}.Release.Build.0 = Release|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic.ActiveCfg = classic|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic.Build.0 = classic|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic nt.ActiveCfg = Release|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic nt.Build.0 = Release|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Debug.ActiveCfg = Debug|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Debug.Build.0 = Debug|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Classic.ActiveCfg = Release|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Debug.ActiveCfg = Debug|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Pro.ActiveCfg = Release|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Release.ActiveCfg = Release|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Max.ActiveCfg = Release|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Max.Build.0 = Release|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Max nt.ActiveCfg = Release|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Max nt.Build.0 = Release|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.nt.ActiveCfg = Release|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.nt.Build.0 = Release|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro.ActiveCfg = Release|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro.Build.0 = Release|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro nt.ActiveCfg = Release|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro nt.Build.0 = Release|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Release.ActiveCfg = Release|Win32 - {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Release.Build.0 = Release|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.classic.ActiveCfg = Release|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.classic.Build.0 = Release|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.classic nt.ActiveCfg = Release|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.classic nt.Build.0 = Release|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Debug.ActiveCfg = Debug|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Debug.Build.0 = Debug|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Classic.ActiveCfg = TLS|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Classic.Build.0 = TLS|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Debug.ActiveCfg = Debug|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Debug.Build.0 = Debug|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Pro.ActiveCfg = TLS|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Pro.Build.0 = TLS|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Release.ActiveCfg = TLS|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Release.Build.0 = TLS|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Max.ActiveCfg = Release|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Max.Build.0 = Release|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Max nt.ActiveCfg = Release|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Max nt.Build.0 = Release|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.nt.ActiveCfg = Release|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.nt.Build.0 = Release|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro.ActiveCfg = Release|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro.Build.0 = Release|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro nt.ActiveCfg = Release|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro nt.Build.0 = Release|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Release.ActiveCfg = Release|Win32 - {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Release.Build.0 = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.classic.ActiveCfg = classic|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.classic.Build.0 = classic|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.classic nt.ActiveCfg = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.classic nt.Build.0 = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Debug.ActiveCfg = Debug|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Debug.Build.0 = Debug|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Classic.ActiveCfg = classic|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Debug.ActiveCfg = Debug|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Pro.ActiveCfg = classic|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Release.ActiveCfg = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Max.ActiveCfg = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Max.Build.0 = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Max nt.ActiveCfg = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Max nt.Build.0 = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.nt.ActiveCfg = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.nt.Build.0 = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro.ActiveCfg = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro.Build.0 = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro nt.ActiveCfg = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro nt.Build.0 = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Release.ActiveCfg = Release|Win32 - {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Release.Build.0 = Release|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic.ActiveCfg = classic|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic.Build.0 = classic|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic nt.ActiveCfg = Release|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic nt.Build.0 = Release|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Debug.ActiveCfg = Debug|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Debug.Build.0 = Debug|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Classic.ActiveCfg = Debug|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Debug.ActiveCfg = Debug|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Pro.ActiveCfg = Debug|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Release.ActiveCfg = Release|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Max.ActiveCfg = Release|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Max.Build.0 = Release|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Max nt.ActiveCfg = Release|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Max nt.Build.0 = Release|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.nt.ActiveCfg = Release|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.nt.Build.0 = Release|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro.ActiveCfg = Release|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro.Build.0 = Release|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro nt.ActiveCfg = Release|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro nt.Build.0 = Release|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Release.ActiveCfg = Release|Win32 - {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Release.Build.0 = Release|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.classic.ActiveCfg = classic|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.classic.Build.0 = classic|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.classic nt.ActiveCfg = Release|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.classic nt.Build.0 = Release|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Debug.ActiveCfg = Debug|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Debug.Build.0 = Debug|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Classic.ActiveCfg = Debug|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Debug.ActiveCfg = Debug|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Pro.ActiveCfg = Debug|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Release.ActiveCfg = Release|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Max.ActiveCfg = Release|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Max.Build.0 = Release|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Max nt.ActiveCfg = Release|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Max nt.Build.0 = Release|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.nt.ActiveCfg = Release|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.nt.Build.0 = Release|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro.ActiveCfg = Release|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro.Build.0 = Release|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro nt.ActiveCfg = Release|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro nt.Build.0 = Release|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Release.ActiveCfg = Release|Win32 - {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Release.Build.0 = Release|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.classic.ActiveCfg = classic|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.classic.Build.0 = classic|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.classic nt.ActiveCfg = Release|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.classic nt.Build.0 = Release|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Debug.ActiveCfg = Debug|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Debug.Build.0 = Debug|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Classic.ActiveCfg = Release|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Debug.ActiveCfg = Debug|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Pro.ActiveCfg = Release|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Release.ActiveCfg = Release|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Max.ActiveCfg = Release|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Max.Build.0 = Release|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Max nt.ActiveCfg = Release|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Max nt.Build.0 = Release|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.nt.ActiveCfg = Release|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.nt.Build.0 = Release|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro.ActiveCfg = Release|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro.Build.0 = Release|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro nt.ActiveCfg = Release|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro nt.Build.0 = Release|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Release.ActiveCfg = Release|Win32 - {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Release.Build.0 = Release|Win32 - {67154F28-D076-419E-B149-819EF548E670}.classic.ActiveCfg = classic|Win32 - {67154F28-D076-419E-B149-819EF548E670}.classic.Build.0 = classic|Win32 - {67154F28-D076-419E-B149-819EF548E670}.classic nt.ActiveCfg = Release|Win32 - {67154F28-D076-419E-B149-819EF548E670}.classic nt.Build.0 = Release|Win32 - {67154F28-D076-419E-B149-819EF548E670}.Debug.ActiveCfg = Debug|Win32 - {67154F28-D076-419E-B149-819EF548E670}.Debug.Build.0 = Debug|Win32 - {67154F28-D076-419E-B149-819EF548E670}.Embedded_Classic.ActiveCfg = Debug|Win32 - {67154F28-D076-419E-B149-819EF548E670}.Embedded_Debug.ActiveCfg = Debug|Win32 - {67154F28-D076-419E-B149-819EF548E670}.Embedded_Pro.ActiveCfg = Debug|Win32 - {67154F28-D076-419E-B149-819EF548E670}.Embedded_Release.ActiveCfg = Release|Win32 - {67154F28-D076-419E-B149-819EF548E670}.Max.ActiveCfg = Release|Win32 - {67154F28-D076-419E-B149-819EF548E670}.Max.Build.0 = Release|Win32 - {67154F28-D076-419E-B149-819EF548E670}.Max nt.ActiveCfg = Release|Win32 - {67154F28-D076-419E-B149-819EF548E670}.Max nt.Build.0 = Release|Win32 - {67154F28-D076-419E-B149-819EF548E670}.nt.ActiveCfg = Release|Win32 - {67154F28-D076-419E-B149-819EF548E670}.nt.Build.0 = Release|Win32 - {67154F28-D076-419E-B149-819EF548E670}.pro.ActiveCfg = Release|Win32 - {67154F28-D076-419E-B149-819EF548E670}.pro.Build.0 = Release|Win32 - {67154F28-D076-419E-B149-819EF548E670}.pro nt.ActiveCfg = Release|Win32 - {67154F28-D076-419E-B149-819EF548E670}.pro nt.Build.0 = Release|Win32 - {67154F28-D076-419E-B149-819EF548E670}.Release.ActiveCfg = Release|Win32 - {67154F28-D076-419E-B149-819EF548E670}.Release.Build.0 = Release|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.classic.ActiveCfg = Release|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.classic.Build.0 = Release|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.classic nt.ActiveCfg = Release|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.classic nt.Build.0 = Release|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.Debug.ActiveCfg = Debug|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.Debug.Build.0 = Debug|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Classic.ActiveCfg = Debug|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Debug.ActiveCfg = Debug|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Pro.ActiveCfg = Debug|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Release.ActiveCfg = Release|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.Max.ActiveCfg = Release|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.Max.Build.0 = Release|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.Max nt.ActiveCfg = Release|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.Max nt.Build.0 = Release|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.nt.ActiveCfg = Release|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.nt.Build.0 = Release|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro.ActiveCfg = Release|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro.Build.0 = Release|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro nt.ActiveCfg = Release|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro nt.Build.0 = Release|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.Release.ActiveCfg = Release|Win32 - {26383276-4843-494B-8BE0-8936ED3EBAAB}.Release.Build.0 = Release|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.classic.ActiveCfg = classic|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.classic.Build.0 = classic|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.classic nt.ActiveCfg = classic nt|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.classic nt.Build.0 = classic nt|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.Debug.ActiveCfg = Debug|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.Debug.Build.0 = Debug|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Classic.ActiveCfg = Release|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Debug.ActiveCfg = Debug|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Pro.ActiveCfg = Release|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Release.ActiveCfg = Release|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.Max.ActiveCfg = Max|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.Max.Build.0 = Max|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.Max nt.ActiveCfg = Max nt|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.Max nt.Build.0 = Max nt|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.nt.ActiveCfg = nt|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.nt.Build.0 = nt|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.pro.ActiveCfg = pro|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.pro.Build.0 = pro|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.pro nt.ActiveCfg = pro nt|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.pro nt.Build.0 = pro nt|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.Release.ActiveCfg = Release|Win32 - {62E85884-3ACF-4F4C-873B-60B878147890}.Release.Build.0 = Release|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.classic.ActiveCfg = classic|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.classic.Build.0 = classic|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.classic nt.ActiveCfg = classic|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.classic nt.Build.0 = classic|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Debug.ActiveCfg = Debug|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Debug.Build.0 = Debug|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Classic.ActiveCfg = Release|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Debug.ActiveCfg = Debug|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Pro.ActiveCfg = Release|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Release.ActiveCfg = Release|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max.ActiveCfg = Release|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max.Build.0 = Release|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max nt.ActiveCfg = Release|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max nt.Build.0 = Release|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.nt.ActiveCfg = Release|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.nt.Build.0 = Release|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro.ActiveCfg = pro|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro.Build.0 = pro|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro nt.ActiveCfg = pro|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro nt.Build.0 = pro|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Release.ActiveCfg = Release|Win32 - {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Release.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.classic.ActiveCfg = classic|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.classic.Build.0 = classic|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.classic nt.ActiveCfg = classic|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.classic nt.Build.0 = classic|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Debug.ActiveCfg = Debug|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Debug.Build.0 = Debug|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Classic.ActiveCfg = classic|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Debug.ActiveCfg = Debug|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Pro.ActiveCfg = classic|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Release.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Max.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Max.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Max nt.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Max nt.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.nt.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.nt.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro nt.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro nt.Build.0 = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Release.ActiveCfg = Release|Win32 - {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Release.Build.0 = Release|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic.ActiveCfg = classic|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic.Build.0 = classic|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic nt.ActiveCfg = classic|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic nt.Build.0 = classic|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Debug.ActiveCfg = Debug|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Debug.Build.0 = Debug|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Classic.ActiveCfg = classic|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Debug.ActiveCfg = Debug|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Pro.ActiveCfg = classic|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Release.ActiveCfg = Release|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Max.ActiveCfg = Release|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Max.Build.0 = Release|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Max nt.ActiveCfg = Release|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Max nt.Build.0 = Release|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.nt.ActiveCfg = Release|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.nt.Build.0 = Release|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro.ActiveCfg = Release|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro.Build.0 = Release|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro nt.ActiveCfg = Release|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro nt.Build.0 = Release|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Release.ActiveCfg = Release|Win32 - {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Release.Build.0 = Release|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.classic.ActiveCfg = Release|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.classic.Build.0 = Release|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.classic nt.ActiveCfg = Release|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.classic nt.Build.0 = Release|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.Debug.ActiveCfg = Debug|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.Debug.Build.0 = Debug|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Classic.ActiveCfg = Release|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Debug.ActiveCfg = Debug|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Pro.ActiveCfg = Release|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Release.ActiveCfg = Release|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.Max.ActiveCfg = Release|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.Max.Build.0 = Release|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.Max nt.ActiveCfg = Release|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.Max nt.Build.0 = Release|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.nt.ActiveCfg = Release|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.nt.Build.0 = Release|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.pro.ActiveCfg = Release|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.pro.Build.0 = Release|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.pro nt.ActiveCfg = Release|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.pro nt.Build.0 = Release|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.Release.ActiveCfg = Release|Win32 - {94B86159-C581-42CD-825D-C69CBC237E5C}.Release.Build.0 = Release|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.classic.ActiveCfg = classic|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.classic.Build.0 = classic|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.classic nt.ActiveCfg = classic|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.classic nt.Build.0 = classic|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.Debug.ActiveCfg = Debug|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.Debug.Build.0 = Debug|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Classic.ActiveCfg = Debug|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Debug.ActiveCfg = Debug|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Pro.ActiveCfg = Debug|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Release.ActiveCfg = Release|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.Max.ActiveCfg = Release|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.Max.Build.0 = Release|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.Max nt.ActiveCfg = Release|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.Max nt.Build.0 = Release|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.nt.ActiveCfg = Release|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.nt.Build.0 = Release|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro.ActiveCfg = Release|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro.Build.0 = Release|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro nt.ActiveCfg = Release|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro nt.Build.0 = Release|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.Release.ActiveCfg = Release|Win32 - {3737BFE2-EF25-464F-994D-BD28A9F84528}.Release.Build.0 = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.classic.ActiveCfg = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.classic.Build.0 = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.classic nt.ActiveCfg = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.classic nt.Build.0 = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Debug.ActiveCfg = Debug|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Debug.Build.0 = Debug|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Classic.ActiveCfg = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Classic.Build.0 = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Debug.ActiveCfg = Debug|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Debug.Build.0 = Debug|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Pro.ActiveCfg = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Pro.Build.0 = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Release.ActiveCfg = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Release.Build.0 = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Max.ActiveCfg = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Max.Build.0 = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Max nt.ActiveCfg = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Max nt.Build.0 = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.nt.ActiveCfg = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.nt.Build.0 = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro.ActiveCfg = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro.Build.0 = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro nt.ActiveCfg = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro nt.Build.0 = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Release.ActiveCfg = Release|Win32 - {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Release.Build.0 = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.classic.ActiveCfg = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.classic.Build.0 = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.classic nt.ActiveCfg = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.classic nt.Build.0 = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Debug.ActiveCfg = Debug|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Debug.Build.0 = Debug|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Classic.ActiveCfg = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Classic.Build.0 = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Debug.ActiveCfg = Debug|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Debug.Build.0 = Debug|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Pro.ActiveCfg = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Pro.Build.0 = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Release.ActiveCfg = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Release.Build.0 = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Max.ActiveCfg = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Max.Build.0 = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Max nt.ActiveCfg = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Max nt.Build.0 = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.nt.ActiveCfg = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.nt.Build.0 = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro.ActiveCfg = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro.Build.0 = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro nt.ActiveCfg = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro nt.Build.0 = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Release.ActiveCfg = Release|Win32 - {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Release.Build.0 = Release|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic.ActiveCfg = TLS|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic.Build.0 = TLS|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic nt.ActiveCfg = Release|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic nt.Build.0 = Release|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Debug.ActiveCfg = Debug|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Debug.Build.0 = Debug|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Classic.ActiveCfg = TLS|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Classic.Build.0 = TLS|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Debug.ActiveCfg = TLS_DEBUG|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Debug.Build.0 = TLS_DEBUG|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Pro.ActiveCfg = TLS|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Pro.Build.0 = TLS|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Release.ActiveCfg = TLS|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Release.Build.0 = TLS|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max.ActiveCfg = Max|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max.Build.0 = Max|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max nt.ActiveCfg = Max|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max nt.Build.0 = Max|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.nt.ActiveCfg = Release|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.nt.Build.0 = Release|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro.ActiveCfg = Release|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro.Build.0 = Release|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro nt.ActiveCfg = Release|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro nt.Build.0 = Release|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Release.ActiveCfg = Release|Win32 - {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Release.Build.0 = Release|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.classic.ActiveCfg = classic|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.classic.Build.0 = classic|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.classic nt.ActiveCfg = classic|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.classic nt.Build.0 = classic|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Debug.ActiveCfg = Debug|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Debug.Build.0 = Debug|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Classic.ActiveCfg = Debug|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Debug.ActiveCfg = Debug|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Pro.ActiveCfg = Debug|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Release.ActiveCfg = Release|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Max.ActiveCfg = Release|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Max.Build.0 = Release|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Max nt.ActiveCfg = Release|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Max nt.Build.0 = Release|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.nt.ActiveCfg = Release|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.nt.Build.0 = Release|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro.ActiveCfg = Release|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro.Build.0 = Release|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro nt.ActiveCfg = Release|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro nt.Build.0 = Release|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Release.ActiveCfg = Release|Win32 - {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Release.Build.0 = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.classic.ActiveCfg = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.classic.Build.0 = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.classic nt.ActiveCfg = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.classic nt.Build.0 = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Debug.ActiveCfg = Debug|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Debug.Build.0 = Debug|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Classic.ActiveCfg = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Classic.Build.0 = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Debug.ActiveCfg = Debug|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Debug.Build.0 = Debug|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Pro.ActiveCfg = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Pro.Build.0 = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Release.ActiveCfg = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Release.Build.0 = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Max.ActiveCfg = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Max.Build.0 = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Max nt.ActiveCfg = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Max nt.Build.0 = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.nt.ActiveCfg = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.nt.Build.0 = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro.ActiveCfg = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro.Build.0 = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro nt.ActiveCfg = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro nt.Build.0 = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Release.ActiveCfg = Release|Win32 - {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Release.Build.0 = Release|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.classic.ActiveCfg = classic|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.classic.Build.0 = classic|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.classic nt.ActiveCfg = classic|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.classic nt.Build.0 = classic|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Debug.ActiveCfg = Debug|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Debug.Build.0 = Debug|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Classic.ActiveCfg = classic|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Debug.ActiveCfg = Debug|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Pro.ActiveCfg = classic|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Release.ActiveCfg = Release|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Max.ActiveCfg = Release|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Max.Build.0 = Release|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Max nt.ActiveCfg = Release|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Max nt.Build.0 = Release|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.nt.ActiveCfg = Release|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.nt.Build.0 = Release|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro.ActiveCfg = Release|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro.Build.0 = Release|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro nt.ActiveCfg = Release|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro nt.Build.0 = Release|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Release.ActiveCfg = Release|Win32 - {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Release.Build.0 = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.classic.ActiveCfg = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.classic.Build.0 = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.classic nt.ActiveCfg = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.classic nt.Build.0 = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.Debug.ActiveCfg = Debug|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.Debug.Build.0 = Debug|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Classic.ActiveCfg = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Classic.Build.0 = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Debug.ActiveCfg = Debug|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Debug.Build.0 = Debug|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Pro.ActiveCfg = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Pro.Build.0 = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Release.ActiveCfg = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Release.Build.0 = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.Max.ActiveCfg = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.Max.Build.0 = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.Max nt.ActiveCfg = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.Max nt.Build.0 = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.nt.ActiveCfg = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.nt.Build.0 = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro.ActiveCfg = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro.Build.0 = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro nt.ActiveCfg = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro nt.Build.0 = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.Release.ActiveCfg = Release|Win32 - {EEC1300B-85A5-497C-B3E1-F708021DF859}.Release.Build.0 = Release|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.classic.ActiveCfg = Release|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.classic.Build.0 = Release|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.classic nt.ActiveCfg = Debug|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Debug.ActiveCfg = Debug|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Debug.Build.0 = Debug|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Classic.ActiveCfg = Debug|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Debug.ActiveCfg = Debug|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Pro.ActiveCfg = Debug|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Release.ActiveCfg = Release|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Max.ActiveCfg = Release|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Max nt.ActiveCfg = Debug|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.nt.ActiveCfg = Debug|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro.ActiveCfg = Debug|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro nt.ActiveCfg = Debug|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Release.ActiveCfg = Release|Win32 - {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Release.Build.0 = Release|Win32 - {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.classic.ActiveCfg = Release|Win32 - {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.classic nt.ActiveCfg = Release|Win32 - {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Debug.ActiveCfg = Release|Win32 - {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Classic.ActiveCfg = Release|Win32 - {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Debug.ActiveCfg = Release|Win32 - {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Pro.ActiveCfg = Release|Win32 - {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Release.ActiveCfg = Release|Win32 - {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Max.ActiveCfg = Release|Win32 - {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Max nt.ActiveCfg = Release|Win32 - {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.nt.ActiveCfg = Release|Win32 - {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.pro.ActiveCfg = Release|Win32 - {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.pro nt.ActiveCfg = Release|Win32 - {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Release.ActiveCfg = Release|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.classic.ActiveCfg = Release|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.classic.Build.0 = Release|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.classic nt.ActiveCfg = Release|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.classic nt.Build.0 = Release|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Debug.ActiveCfg = Debug|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Debug.Build.0 = Debug|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Classic.ActiveCfg = Release|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Debug.ActiveCfg = Debug|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Pro.ActiveCfg = Release|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Release.ActiveCfg = Release|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Max.ActiveCfg = Release|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Max.Build.0 = Release|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Max nt.ActiveCfg = Release|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Max nt.Build.0 = Release|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.nt.ActiveCfg = Release|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.nt.Build.0 = Release|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro.ActiveCfg = Release|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro.Build.0 = Release|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro nt.ActiveCfg = Release|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro nt.Build.0 = Release|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Release.ActiveCfg = Release|Win32 - {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Release.Build.0 = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.classic.ActiveCfg = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.classic.Build.0 = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.classic nt.ActiveCfg = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.classic nt.Build.0 = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Debug.ActiveCfg = Debug|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Debug.Build.0 = Debug|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Classic.ActiveCfg = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Classic.Build.0 = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Debug.ActiveCfg = Debug|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Debug.Build.0 = Debug|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Pro.ActiveCfg = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Pro.Build.0 = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Release.ActiveCfg = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Release.Build.0 = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Max.ActiveCfg = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Max.Build.0 = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Max nt.ActiveCfg = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Max nt.Build.0 = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.nt.ActiveCfg = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.nt.Build.0 = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro.ActiveCfg = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro.Build.0 = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro nt.ActiveCfg = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro nt.Build.0 = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Release.ActiveCfg = Release|Win32 - {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Release.Build.0 = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.classic.ActiveCfg = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.classic.Build.0 = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.classic nt.ActiveCfg = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.classic nt.Build.0 = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Debug.ActiveCfg = Debug|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Debug.Build.0 = Debug|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Classic.ActiveCfg = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Classic.Build.0 = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Debug.ActiveCfg = Debug|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Debug.Build.0 = Debug|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Pro.ActiveCfg = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Pro.Build.0 = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Release.ActiveCfg = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Release.Build.0 = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Max.ActiveCfg = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Max.Build.0 = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Max nt.ActiveCfg = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Max nt.Build.0 = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.nt.ActiveCfg = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.nt.Build.0 = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro.ActiveCfg = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro.Build.0 = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro nt.ActiveCfg = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro nt.Build.0 = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Release.ActiveCfg = Release|Win32 - {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Release.Build.0 = Release|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.classic.ActiveCfg = classic|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.classic.Build.0 = classic|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.classic nt.ActiveCfg = classic|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.classic nt.Build.0 = classic|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.Debug.ActiveCfg = Debug|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.Debug.Build.0 = Debug|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Classic.ActiveCfg = Debug|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Debug.ActiveCfg = Debug|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Pro.ActiveCfg = Debug|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Release.ActiveCfg = Release|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.Max.ActiveCfg = Release|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.Max.Build.0 = Release|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.Max nt.ActiveCfg = Release|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.Max nt.Build.0 = Release|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.nt.ActiveCfg = Release|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.nt.Build.0 = Release|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.pro.ActiveCfg = Release|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.pro.Build.0 = Release|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.pro nt.ActiveCfg = Release|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.pro nt.Build.0 = Release|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.Release.ActiveCfg = Release|Win32 - {8961F149-C68A-4154-A499-A2AB39E607E8}.Release.Build.0 = Release|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.classic.ActiveCfg = Release|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.classic.Build.0 = Release|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.classic nt.ActiveCfg = Release|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.classic nt.Build.0 = Release|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Debug.ActiveCfg = Debug|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Debug.Build.0 = Debug|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Classic.ActiveCfg = Debug|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Debug.ActiveCfg = Debug|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Pro.ActiveCfg = Debug|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Release.ActiveCfg = Release|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Max.ActiveCfg = Release|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Max.Build.0 = Release|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Max nt.ActiveCfg = Release|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.nt.ActiveCfg = Release|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.nt.Build.0 = Release|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro.ActiveCfg = Release|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro.Build.0 = Release|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro nt.ActiveCfg = Release|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro nt.Build.0 = Release|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Release.ActiveCfg = Release|Win32 - {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Release.Build.0 = Release|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.classic.ActiveCfg = Release|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.classic.Build.0 = Release|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.classic nt.ActiveCfg = Release|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.classic nt.Build.0 = Release|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.Debug.ActiveCfg = Debug|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.Debug.Build.0 = Debug|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Classic.ActiveCfg = Release|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Debug.ActiveCfg = Debug|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Pro.ActiveCfg = Release|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Release.ActiveCfg = Release|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.Max.ActiveCfg = Release|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.Max.Build.0 = Release|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.Max nt.ActiveCfg = Release|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.Max nt.Build.0 = Release|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.nt.ActiveCfg = Release|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.nt.Build.0 = Release|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.pro.ActiveCfg = Release|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.pro.Build.0 = Release|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.pro nt.ActiveCfg = Release|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.pro nt.Build.0 = Release|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.Release.ActiveCfg = Release|Win32 - {6189F838-21C6-42A1-B2D0-9146316573F7}.Release.Build.0 = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.classic.ActiveCfg = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.classic.Build.0 = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.classic nt.ActiveCfg = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.classic nt.Build.0 = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Debug.ActiveCfg = Debug|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Debug.Build.0 = Debug|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Classic.ActiveCfg = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Classic.Build.0 = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Debug.ActiveCfg = Debug|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Debug.Build.0 = Debug|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Pro.ActiveCfg = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Pro.Build.0 = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Release.ActiveCfg = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Release.Build.0 = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Max.ActiveCfg = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Max.Build.0 = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Max nt.ActiveCfg = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Max nt.Build.0 = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.nt.ActiveCfg = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.nt.Build.0 = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro.ActiveCfg = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro.Build.0 = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro nt.ActiveCfg = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro nt.Build.0 = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Release.ActiveCfg = Release|Win32 - {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/VC++Files/mysqlbinlog/mysqlbinlog.vcproj b/VC++Files/mysqlbinlog/mysqlbinlog.vcproj deleted file mode 100755 index 9d5d4db2565..00000000000 --- a/VC++Files/mysqlbinlog/mysqlbinlog.vcproj +++ /dev/null @@ -1,271 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/mysqlcheck/mysqlcheck.vcproj b/VC++Files/mysqlcheck/mysqlcheck.vcproj deleted file mode 100755 index f47e171fd65..00000000000 --- a/VC++Files/mysqlcheck/mysqlcheck.vcproj +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/mysqldemb/mysqldemb.vcproj b/VC++Files/mysqldemb/mysqldemb.vcproj deleted file mode 100755 index 52081adb214..00000000000 --- a/VC++Files/mysqldemb/mysqldemb.vcproj +++ /dev/null @@ -1,2960 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/mysqlserver/dummy.cpp b/VC++Files/mysqlserver/dummy.cpp deleted file mode 100755 index e69de29bb2d..00000000000 diff --git a/VC++Files/mysqlserver/mysqlserver.vcproj b/VC++Files/mysqlserver/mysqlserver.vcproj deleted file mode 100755 index 43988b8489c..00000000000 --- a/VC++Files/mysqlserver/mysqlserver.vcproj +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/mysys/mysys.vcproj b/VC++Files/mysys/mysys.vcproj deleted file mode 100755 index 87e9338e811..00000000000 --- a/VC++Files/mysys/mysys.vcproj +++ /dev/null @@ -1,4792 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/perror/perror.vcproj b/VC++Files/perror/perror.vcproj deleted file mode 100755 index 2a7bb6407c0..00000000000 --- a/VC++Files/perror/perror.vcproj +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/regex/regex.vcproj b/VC++Files/regex/regex.vcproj deleted file mode 100755 index 1b52017ca3b..00000000000 --- a/VC++Files/regex/regex.vcproj +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/replace/replace.vcproj b/VC++Files/replace/replace.vcproj deleted file mode 100755 index 270ff494539..00000000000 --- a/VC++Files/replace/replace.vcproj +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/sql/mysqld.vcproj b/VC++Files/sql/mysqld.vcproj deleted file mode 100755 index 26d23022a50..00000000000 --- a/VC++Files/sql/mysqld.vcproj +++ /dev/null @@ -1,8659 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/strings/strings.vcproj b/VC++Files/strings/strings.vcproj deleted file mode 100755 index 8e16a0c7221..00000000000 --- a/VC++Files/strings/strings.vcproj +++ /dev/null @@ -1,1034 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/test1/test1.vcproj b/VC++Files/test1/test1.vcproj deleted file mode 100755 index 6a850f7b2e3..00000000000 --- a/VC++Files/test1/test1.vcproj +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/tests/mysql_client_test.vcproj b/VC++Files/tests/mysql_client_test.vcproj deleted file mode 100755 index 89a9b71e60a..00000000000 --- a/VC++Files/tests/mysql_client_test.vcproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/thr_test/thr_test.vcproj b/VC++Files/thr_test/thr_test.vcproj deleted file mode 100755 index ede9bd04de8..00000000000 --- a/VC++Files/thr_test/thr_test.vcproj +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/vio/vio.vcproj b/VC++Files/vio/vio.vcproj deleted file mode 100755 index 3f50c1546fb..00000000000 --- a/VC++Files/vio/vio.vcproj +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC++Files/zlib/zlib.vcproj b/VC++Files/zlib/zlib.vcproj deleted file mode 100755 index ee17d915a1a..00000000000 --- a/VC++Files/zlib/zlib.vcproj +++ /dev/null @@ -1,483 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 8e7fe376ff29a0a2c849ded1ab92545c65dedb91 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 16:44:31 +0200 Subject: [PATCH 198/225] Many files: Revert back 5.0 changes to Visual Studio .Net project files VC++Files/client/mysqlclient.vcproj: Revert back 5.0 changes to Visual Studio .Net project files VC++Files/libmysql/libmysql.vcproj: Revert back 5.0 changes to Visual Studio .Net project files VC++Files/libmysqld/libmysqld.vcproj: Revert back 5.0 changes to Visual Studio .Net project files VC++Files/mysql.sln: Revert back 5.0 changes to Visual Studio .Net project files VC++Files/mysys/mysys.vcproj: Revert back 5.0 changes to Visual Studio .Net project files VC++Files/sql/mysqld.vcproj: Revert back 5.0 changes to Visual Studio .Net project files VC++Files/strings/strings.vcproj: Revert back 5.0 changes to Visual Studio .Net project files --- VC++Files/client/mysqlclient.vcproj | 57 +- VC++Files/libmysql/libmysql.vcproj | 76 ++- VC++Files/libmysqld/libmysqld.vcproj | 396 +++++++++++++ VC++Files/mysql.sln | 113 ++++ VC++Files/mysys/mysys.vcproj | 129 +++-- VC++Files/sql/mysqld.vcproj | 831 ++++++++++++++++++++++++++- VC++Files/strings/strings.vcproj | 41 ++ 7 files changed, 1551 insertions(+), 92 deletions(-) diff --git a/VC++Files/client/mysqlclient.vcproj b/VC++Files/client/mysqlclient.vcproj index 105bf4b84e2..eebba9ebe0e 100644 --- a/VC++Files/client/mysqlclient.vcproj +++ b/VC++Files/client/mysqlclient.vcproj @@ -486,6 +486,33 @@ PreprocessorDefinitions=""/> + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Date: Fri, 30 Sep 2005 18:06:38 +0200 Subject: [PATCH 199/225] CygWin build fix (Bug #13640) --- extra/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/Makefile.am b/extra/Makefile.am index 457fddce673..91ec8318f08 100644 --- a/extra/Makefile.am +++ b/extra/Makefile.am @@ -26,7 +26,7 @@ CLEANFILES = $(BUILT_SOURCES) DIST_SUBDIRS= yassl # This will build mysqld_error.h and sql_state.h -$(top_builddir)/include/mysqld_error.h: comp_err +$(top_builddir)/include/mysqld_error.h: comp_err$(EXEEXT) $(top_builddir)/extra/comp_err \ --charset=$(top_srcdir)/sql/share/charsets \ --out-dir=$(top_builddir)/sql/share/ \ From 8f842e8fc9f304e4f95d81df3c222bab11ced391 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 20:20:10 +0200 Subject: [PATCH 200/225] Bug#11238 "SELECT ... FOR UPDATE executed as consistent read inside LOCK TABLES" Do not discard lock_type information as handler::start_stmt() may require knowledge. (fixed by Antony) --- mysql-test/r/innodb.result | 55 ++++++++++++++++++++++++------------ mysql-test/t/innodb.test | 57 +++++++++++++++++++++++++++++--------- sql/ha_berkeley.cc | 2 +- sql/ha_berkeley.h | 2 +- sql/ha_innodb.cc | 5 ++-- sql/ha_innodb.h | 2 +- sql/ha_ndbcluster.cc | 2 +- sql/ha_ndbcluster.h | 2 +- sql/handler.h | 2 +- sql/sql_base.cc | 2 +- 10 files changed, 91 insertions(+), 40 deletions(-) diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 3fcdccceed6..f634d0fc98b 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -2616,31 +2616,50 @@ SET FOREIGN_KEY_CHECKS=1; INSERT INTO t2 VALUES(3); ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test/t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`)) DROP TABLE t2; -create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; -insert into test_checksum values (1),(2); +create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into t1 values (1),(2); set autocommit=0; -checksum table test_checksum; +checksum table t1; Table Checksum -test.test_checksum 1531596814 -insert into test_checksum values(3); -checksum table test_checksum; +test.t1 1531596814 +insert into t1 values(3); +checksum table t1; Table Checksum -test.test_checksum 2605035534 +test.t1 2605035534 commit; -checksum table test_checksum; +checksum table t1; Table Checksum -test.test_checksum 127268899 +test.t1 127268899 commit; -drop table test_checksum; -create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; -insert into test_checksum values (1),(2); +drop table t1; +create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into t1 values (1),(2); set autocommit=1; -checksum table test_checksum; +checksum table t1; Table Checksum -test.test_checksum 1531596814 +test.t1 1531596814 set autocommit=1; -insert into test_checksum values(3); -checksum table test_checksum; +insert into t1 values(3); +checksum table t1; Table Checksum -test.test_checksum 127268899 -drop table test_checksum; +test.t1 127268899 +drop table t1; +create table t1 (col1 integer primary key, col2 integer) engine=innodb; +insert t1 values (1,100); +create function f1 () returns integer begin +declare var1 int; +select col2 into var1 from t1 where col1=1 for update; +return var1; +end| +start transaction; +select f1(); +f1() +100 + update t1 set col2=0 where col1=1; +select * from t1; +col1 col2 +1 100 +rollback; +rollback; +drop table t1; +drop function f1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 7d4e15163ef..5a45b3524ac 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1571,36 +1571,67 @@ DROP TABLE t2; connect (a,localhost,root,,); connect (b,localhost,root,,); connection a; -create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; -insert into test_checksum values (1),(2); +create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into t1 values (1),(2); set autocommit=0; -checksum table test_checksum; +checksum table t1; connection b; -insert into test_checksum values(3); +insert into t1 values(3); connection a; # # Here checksum should not see insert # -checksum table test_checksum; +checksum table t1; connection a; commit; -checksum table test_checksum; +checksum table t1; commit; -drop table test_checksum; +drop table t1; # # autocommit = 1 # connection a; -create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; -insert into test_checksum values (1),(2); +create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into t1 values (1),(2); set autocommit=1; -checksum table test_checksum; +checksum table t1; connection b; set autocommit=1; -insert into test_checksum values(3); +insert into t1 values(3); connection a; # # Here checksum sees insert # -checksum table test_checksum; -drop table test_checksum; +checksum table t1; +drop table t1; + +# +# BUG#11238 - in prelocking mode SELECT .. FOR UPDATE is changed to +# non-blocking SELECT +# +create table t1 (col1 integer primary key, col2 integer) engine=innodb; +insert t1 values (1,100); +delimiter |; +create function f1 () returns integer begin +declare var1 int; +select col2 into var1 from t1 where col1=1 for update; +return var1; +end| +delimiter ;| +start transaction; +select f1(); +connection b; +send update t1 set col2=0 where col1=1; +connection default; +select * from t1; +connection a; +rollback; +connection b; +reap; +rollback; +connection default; +drop table t1; +drop function f1; +disconnect a; +disconnect b; + diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 2f47b03de9d..a4c91c72368 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -1894,7 +1894,7 @@ int ha_berkeley::external_lock(THD *thd, int lock_type) Under LOCK TABLES, each used tables will force a call to start_stmt. */ -int ha_berkeley::start_stmt(THD *thd) +int ha_berkeley::start_stmt(THD *thd, thr_lock_type lock_type) { int error=0; DBUG_ENTER("ha_berkeley::start_stmt"); diff --git a/sql/ha_berkeley.h b/sql/ha_berkeley.h index 282641e3f25..f291fd7a668 100644 --- a/sql/ha_berkeley.h +++ b/sql/ha_berkeley.h @@ -124,7 +124,7 @@ class ha_berkeley: public handler int extra(enum ha_extra_function operation); int reset(void); int external_lock(THD *thd, int lock_type); - int start_stmt(THD *thd); + int start_stmt(THD *thd, thr_lock_type lock_type); void position(byte *record); int analyze(THD* thd,HA_CHECK_OPT* check_opt); int optimize(THD* thd, HA_CHECK_OPT* check_opt); diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index de458785534..b6737b3a991 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -6000,7 +6000,8 @@ int ha_innobase::start_stmt( /*====================*/ /* out: 0 or error code */ - THD* thd) /* in: handle to the user thread */ + THD* thd, /* in: handle to the user thread */ + thr_lock_type lock_type) { row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; trx_t* trx; @@ -6041,7 +6042,7 @@ ha_innobase::start_stmt( } else { if (trx->isolation_level != TRX_ISO_SERIALIZABLE && thd->lex->sql_command == SQLCOM_SELECT - && thd->lex->lock_option == TL_READ) { + && lock_type == TL_READ) { /* For other than temporary tables, we obtain no lock for consistent read (plain SELECT). */ diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index d3c7af432a0..0c2b6d0f71a 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -150,7 +150,7 @@ class ha_innobase: public handler int extra(enum ha_extra_function operation); int external_lock(THD *thd, int lock_type); int transactional_table_lock(THD *thd, int lock_type); - int start_stmt(THD *thd); + int start_stmt(THD *thd, thr_lock_type lock_type); void position(byte *record); ha_rows records_in_range(uint inx, key_range *min_key, key_range diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 709a7ed14e0..e22f0ecfbc2 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3400,7 +3400,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) startTransaction for each transaction/statement. */ -int ha_ndbcluster::start_stmt(THD *thd) +int ha_ndbcluster::start_stmt(THD *thd, thr_lock_type lock_type) { int error=0; DBUG_ENTER("start_stmt"); diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 2a1d51724d4..4bda78cf234 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -501,7 +501,7 @@ class ha_ndbcluster: public handler int extra(enum ha_extra_function operation); int extra_opt(enum ha_extra_function operation, ulong cache_size); int external_lock(THD *thd, int lock_type); - int start_stmt(THD *thd); + int start_stmt(THD *thd, thr_lock_type lock_type); const char * table_type() const; const char ** bas_ext() const; ulong table_flags(void) const; diff --git a/sql/handler.h b/sql/handler.h index f4f6a8592bb..c3a61d696f7 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -647,7 +647,7 @@ public: virtual int reset() { return extra(HA_EXTRA_RESET); } virtual int external_lock(THD *thd, int lock_type) { return 0; } virtual void unlock_row() {} - virtual int start_stmt(THD *thd) {return 0;} + virtual int start_stmt(THD *thd, thr_lock_type lock_type) {return 0;} /* This is called to delete all rows in a table If the handler don't support this, then this function will diff --git a/sql/sql_base.cc b/sql/sql_base.cc index bb14d22e493..7352940ee69 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2148,7 +2148,7 @@ static bool check_lock_and_start_stmt(THD *thd, TABLE *table, my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, MYF(0),table->alias); DBUG_RETURN(1); } - if ((error=table->file->start_stmt(thd))) + if ((error=table->file->start_stmt(thd, lock_type))) { table->file->print_error(error,MYF(0)); DBUG_RETURN(1); From 46d8163b1b53a61e75ff43cb140e6055dc7cad05 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 1 Oct 2005 01:12:14 +0400 Subject: [PATCH 201/225] WL#2789 "Instance Manager: test using mysql-test-run testing framework" 1) Add support to testing Instance Manager in daemon mode; 2) Don't run Instance Manager tests when running with --ps-protocol option; mysql-test/lib/mtr_cases.pl: WL#2789 "Instance Manager: test using mysql-test-run testing framework" Skip/disable Instance Manager tests in the following cases: - we are testing embedded server; - we are running with --ps-protocol; - Instance Manager executable does not exist; Report about the reason in the standard way. mysql-test/lib/mtr_process.pl: WL#2789 "Instance Manager: test using mysql-test-run testing framework" Make several attempts (i.e. send several signals to process) while trying to kill it. mysql-test/mysql-test-run.pl: WL#2789 "Instance Manager: test using mysql-test-run testing framework" Add support for testing Instance Manager in daemon mode. --- mysql-test/lib/mtr_cases.pl | 46 ++++++++++++++++++++++------------- mysql-test/lib/mtr_process.pl | 14 ++++++----- mysql-test/mysql-test-run.pl | 10 ++++++++ 3 files changed, 47 insertions(+), 23 deletions(-) diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index 250c3562227..ca984d37ecf 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -61,22 +61,6 @@ sub collect_test_cases ($) { $elem= $tname; $tname =~ s/\.imtest$//; $component_id= 'im'; - - if ( $::glob_use_embedded_server ) - { - mtr_report( - "Instance Manager's tests are not available in embedded mode." . - "Test case '$tname' is skipped."); - next; - } - - unless ( $::exe_im ) - { - mtr_report( - "Instance Manager executable is unavailable. " . - "Test case '$tname' is skipped."); - next; - } } # If target component is known, check that the specified test case @@ -115,7 +99,7 @@ sub collect_test_cases ($) { $component_id= 'im'; } } - + collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,{}, $component_id); } @@ -403,6 +387,34 @@ sub collect_one_test_case($$$$$$$) { $tinfo->{'comment'}= mtr_fromfile($disabled_file); } + if ( $component_id eq 'im' ) + { + if ( $::glob_use_embedded_server ) + { + $tinfo->{'skip'}= 1; + + mtr_report( + "Instance Manager tests are not available in embedded mode. " . + "Test case '$tname' is skipped."); + } + elsif ( $::opt_ps_protocol ) + { + $tinfo->{'skip'}= 1; + + mtr_report( + "Instance Manager tests are not run with --ps-protocol. " . + "Test case '$tname' is skipped."); + } + elsif ( !$::exe_im ) + { + $tinfo->{'skip'}= 1; + + mtr_report( + "Instance Manager executable is unavailable." . + "Test case '$tname' is skipped."); + } + } + # We can't restart a running server that may be in use if ( $::glob_use_running_server and diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index 0fb4282ce7f..eb60df4a5cb 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -848,14 +848,16 @@ sub sleep_until_file_created ($$$) { sub mtr_kill_processes ($) { my $pids = shift; - foreach my $sig (15,9) + foreach my $sig (15, 9) { - my $retries= 20; # FIXME 20 seconds, this is silly! - kill($sig, @{$pids}); - while ( $retries-- and kill(0, @{$pids}) ) + my $retries= 10; + while (1) { - mtr_debug("Sleep 1 second waiting for processes to die"); - sleep(1) # Wait one second + kill($sig, @{$pids}); + last unless kill (0, @{$pids}) and $retries--; + + mtr_debug("Sleep 2 second waiting for processes to die"); + sleep(2); } } } diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index b93a2d08262..05e6169b4c7 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1017,10 +1017,14 @@ sub environment_setup () { # $ENV{'MYSQL_TCP_PORT'}= '@MYSQL_TCP_PORT@'; # FIXME $ENV{'MYSQL_TCP_PORT'}= 3306; + $ENV{'IM_PATH_PID'}= $instance_manager->{path_pid}; + $ENV{'IM_MYSQLD1_SOCK'}= $instance_manager->{instances}->[0]->{path_sock}; $ENV{'IM_MYSQLD1_PORT'}= $instance_manager->{instances}->[0]->{port}; + $ENV{'IM_MYSQLD1_PATH_PID'}=$instance_manager->{instances}->[0]->{path_pid}; $ENV{'IM_MYSQLD2_SOCK'}= $instance_manager->{instances}->[1]->{path_sock}; $ENV{'IM_MYSQLD2_PORT'}= $instance_manager->{instances}->[1]->{port}; + $ENV{'IM_MYSQLD2_PATH_PID'}=$instance_manager->{instances}->[1]->{path_pid}; if ( $glob_cygwin_perl ) { @@ -2317,6 +2321,12 @@ sub im_stop($) { return; } + # Re-read pid from the file, since during tests Instance Manager could have + # been restarted, so its pid could have been changed. + + $instance_manager->{'pid'} = + mtr_get_pid_from_file($instance_manager->{'path_pid'}); + # Inspired from mtr_stop_mysqld_servers(). start_reap_all(); From 43c8f453e5353cf1d81368fdac732b6ff8519920 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 1 Oct 2005 01:14:50 +0400 Subject: [PATCH 202/225] WL#2789 "Instance Manager: test using mysql-test-run testing framework" Add Instance Manager tests. mysql-test/include/im_check_os.inc: Currently Instance Manager tests are known to work only on UNIX platform. This header file is included in each IM-test in order to skip the test on Windows. mysql-test/r/im_daemon_life_cycle.result: Results file for Instance Manager daemon test. mysql-test/r/im_life_cycle.result: Results file for Instance Manager life cycle test. mysql-test/r/im_options_set.result: Results file for Instance Manager SET statement test. mysql-test/r/im_options_unset.result: Results file for Instance Manager UNSET statement test. mysql-test/r/im_utils.result: Results file for Instance Manager utils test. mysql-test/t/im_daemon_life_cycle-im.opt: Options file for Instance Manager daemon test. mysql-test/t/im_daemon_life_cycle.imtest: Instance Manager daemon test (mysqltestrun-part). mysql-test/t/im_life_cycle.imtest: Instance Manager life cycle test. mysql-test/t/im_options_set.imtest: Instance Manager SET statement test. mysql-test/t/im_options_unset.imtest: Instance Manager UNSET statement test. mysql-test/t/im_utils.imtest: Instance Manager utils test. mysql-test/t/kill_n_check.sh: The helper script. Its main idea is to kill some process and check that the process will (or will not) be restarted. --- mysql-test/include/im_check_os.inc | 7 ++ mysql-test/r/im_daemon_life_cycle.result | 7 ++ mysql-test/r/im_life_cycle.result | 64 ++++++++++ mysql-test/r/im_options_set.result | 20 +++ mysql-test/r/im_options_unset.result | 15 +++ mysql-test/r/im_utils.result | 91 ++++++++++++++ mysql-test/t/im_daemon_life_cycle-im.opt | 2 + mysql-test/t/im_daemon_life_cycle.imtest | 15 +++ mysql-test/t/im_life_cycle.imtest | 141 +++++++++++++++++++++ mysql-test/t/im_options_set.imtest | 142 +++++++++++++++++++++ mysql-test/t/im_options_unset.imtest | 150 +++++++++++++++++++++++ mysql-test/t/im_utils.imtest | 115 +++++++++++++++++ mysql-test/t/kill_n_check.sh | 66 ++++++++++ 13 files changed, 835 insertions(+) create mode 100644 mysql-test/include/im_check_os.inc create mode 100644 mysql-test/r/im_daemon_life_cycle.result create mode 100644 mysql-test/r/im_life_cycle.result create mode 100644 mysql-test/r/im_options_set.result create mode 100644 mysql-test/r/im_options_unset.result create mode 100644 mysql-test/r/im_utils.result create mode 100644 mysql-test/t/im_daemon_life_cycle-im.opt create mode 100644 mysql-test/t/im_daemon_life_cycle.imtest create mode 100644 mysql-test/t/im_life_cycle.imtest create mode 100644 mysql-test/t/im_options_set.imtest create mode 100644 mysql-test/t/im_options_unset.imtest create mode 100644 mysql-test/t/im_utils.imtest create mode 100755 mysql-test/t/kill_n_check.sh diff --git a/mysql-test/include/im_check_os.inc b/mysql-test/include/im_check_os.inc new file mode 100644 index 00000000000..9465115feb5 --- /dev/null +++ b/mysql-test/include/im_check_os.inc @@ -0,0 +1,7 @@ +--connect (dflt_server_con,localhost,root,,mysql,$IM_MYSQLD1_PORT,$IM_MYSQLD1_SOCK) +--connection dflt_server_con + +--source include/not_windows.inc + +--connection default +--disconnect dflt_server_con diff --git a/mysql-test/r/im_daemon_life_cycle.result b/mysql-test/r/im_daemon_life_cycle.result new file mode 100644 index 00000000000..d0a76b450fe --- /dev/null +++ b/mysql-test/r/im_daemon_life_cycle.result @@ -0,0 +1,7 @@ +SHOW INSTANCES; +instance_name status +mysqld1 online +mysqld2 offline +Killing the process... +Sleeping... +Success: the process was restarted. diff --git a/mysql-test/r/im_life_cycle.result b/mysql-test/r/im_life_cycle.result new file mode 100644 index 00000000000..810953e0578 --- /dev/null +++ b/mysql-test/r/im_life_cycle.result @@ -0,0 +1,64 @@ +SHOW INSTANCES; +instance_name status +mysqld1 online +mysqld2 offline +SHOW INSTANCE STATUS mysqld1; +instance_name status version +mysqld1 online VERSION +SHOW INSTANCE STATUS mysqld2; +instance_name status version +mysqld2 offline VERSION +START INSTANCE mysqld2; +SHOW INSTANCES; +instance_name status +mysqld1 online +mysqld2 online +SHOW INSTANCE STATUS mysqld1; +instance_name status version +mysqld1 online VERSION +SHOW INSTANCE STATUS mysqld2; +instance_name status version +mysqld2 online VERSION +SHOW VARIABLES LIKE 'port'; +Variable_name Value +port 9312 +STOP INSTANCE mysqld2; +SHOW INSTANCES; +instance_name status +mysqld1 online +mysqld2 offline +SHOW INSTANCE STATUS mysqld1; +instance_name status version +mysqld1 online VERSION +SHOW INSTANCE STATUS mysqld2; +instance_name status version +mysqld2 offline VERSION +START INSTANCE mysqld3; +ERROR HY000: Bad instance name. Check that the instance with such a name exists +START INSTANCE mysqld1; +ERROR HY000: The instance is already started +STOP INSTANCE mysqld3; +ERROR HY000: Bad instance name. Check that the instance with such a name exists +SHOW INSTANCES; +instance_name status +mysqld1 online +mysqld2 offline +Killing the process... +Sleeping... +Success: the process was restarted. +SHOW INSTANCES; +instance_name status +mysqld1 online +mysqld2 offline +START INSTANCE mysqld2; +SHOW INSTANCES; +instance_name status +mysqld1 online +mysqld2 online +Killing the process... +Sleeping... +Success: the process was killed. +SHOW INSTANCES; +instance_name status +mysqld1 online +mysqld2 offline diff --git a/mysql-test/r/im_options_set.result b/mysql-test/r/im_options_set.result new file mode 100644 index 00000000000..0d2fa699fc7 --- /dev/null +++ b/mysql-test/r/im_options_set.result @@ -0,0 +1,20 @@ +server_id =1 +server_id =2 +SHOW VARIABLES LIKE 'server_id'; +Variable_name Value +server_id 1 +SET mysqld1.server_id = 11; +server_id =11 +server_id =2 +SHOW VARIABLES LIKE 'server_id'; +Variable_name Value +server_id 1 +SET mysqld2.server_id = 12; +server_id =11 +server_id =12 +FLUSH INSTANCES; +server_id =11 +server_id =12 +SHOW VARIABLES LIKE 'server_id'; +Variable_name Value +server_id 1 diff --git a/mysql-test/r/im_options_unset.result b/mysql-test/r/im_options_unset.result new file mode 100644 index 00000000000..834152c35d2 --- /dev/null +++ b/mysql-test/r/im_options_unset.result @@ -0,0 +1,15 @@ +server_id =1 +server_id =2 +SHOW VARIABLES LIKE 'server_id'; +Variable_name Value +server_id 1 +UNSET mysqld1.server_id; +server_id =2 +SHOW VARIABLES LIKE 'server_id'; +Variable_name Value +server_id 1 +UNSET mysqld2.server_id; +FLUSH INSTANCES; +SHOW VARIABLES LIKE 'server_id'; +Variable_name Value +server_id 1 diff --git a/mysql-test/r/im_utils.result b/mysql-test/r/im_utils.result new file mode 100644 index 00000000000..fbfaeaebcac --- /dev/null +++ b/mysql-test/r/im_utils.result @@ -0,0 +1,91 @@ +SHOW INSTANCES; +instance_name status +mysqld1 online +mysqld2 offline +SHOW INSTANCE OPTIONS mysqld1; +option_name value +instance_name VALUE +mysqld-path VALUE +socket VALUE +pid-file VALUE +port VALUE +datadir VALUE +log VALUE +log-error VALUE +log-slow-queries VALUE +language VALUE +character-sets-dir VALUE +basedir VALUE +server_id VALUE +skip-stack-trace VALUE +skip-innodb VALUE +skip-bdb VALUE +skip-ndbcluster VALUE +SHOW INSTANCE OPTIONS mysqld2; +option_name value +instance_name VALUE +mysqld-path VALUE +nonguarded VALUE +socket VALUE +pid-file VALUE +port VALUE +datadir VALUE +log VALUE +log-error VALUE +log-slow-queries VALUE +language VALUE +character-sets-dir VALUE +basedir VALUE +server_id VALUE +skip-stack-trace VALUE +skip-innodb VALUE +skip-bdb VALUE +skip-ndbcluster VALUE +START INSTANCE mysqld2; +STOP INSTANCE mysqld2; +SHOW mysqld1 LOG FILES; +Logfile Path File size +ERROR LOG PATH FILE_SIZE +GENERAL LOG PATH FILE_SIZE +SLOW LOG PATH FILE_SIZE +SHOW mysqld2 LOG FILES; +Logfile Path File size +ERROR LOG PATH FILE_SIZE +GENERAL LOG PATH FILE_SIZE +SLOW LOG PATH FILE_SIZE +SHOW mysqld1 LOG ERROR 10; +Log +LOG_DATA +SHOW mysqld1 LOG SLOW 10; +Log +LOG_DATA +SHOW mysqld1 LOG GENERAL 10; +Log +LOG_DATA +SHOW mysqld1 LOG ERROR 10, 2; +Log +LOG_DATA +SHOW mysqld1 LOG SLOW 10, 2; +Log +LOG_DATA +SHOW mysqld1 LOG GENERAL 10, 2; +Log +LOG_DATA +SHOW mysqld2 LOG ERROR 10; +Log +LOG_DATA +SHOW mysqld2 LOG SLOW 10; +Log +LOG_DATA +SHOW mysqld2 LOG GENERAL 10; +Log +LOG_DATA +SHOW mysqld2 LOG ERROR 10, 2; +Log +LOG_DATA +SHOW mysqld2 LOG SLOW 10, 2; +Log +LOG_DATA +SHOW mysqld2 LOG GENERAL 10, 2; +Log +LOG_DATA diff --git a/mysql-test/t/im_daemon_life_cycle-im.opt b/mysql-test/t/im_daemon_life_cycle-im.opt new file mode 100644 index 00000000000..6bfd9a24107 --- /dev/null +++ b/mysql-test/t/im_daemon_life_cycle-im.opt @@ -0,0 +1,2 @@ +--run-as-service +--log=$MYSQL_TEST_DIR/var/log/im.log diff --git a/mysql-test/t/im_daemon_life_cycle.imtest b/mysql-test/t/im_daemon_life_cycle.imtest new file mode 100644 index 00000000000..87388d7c1e6 --- /dev/null +++ b/mysql-test/t/im_daemon_life_cycle.imtest @@ -0,0 +1,15 @@ +########################################################################### +# +# This file contains test for (1.2) test suite. +# +# Consult WL#2789 for more information. +# +########################################################################### + +--source include/im_check_os.inc + +########################################################################### + +SHOW INSTANCES; + +--exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_PATH_PID restarted diff --git a/mysql-test/t/im_life_cycle.imtest b/mysql-test/t/im_life_cycle.imtest new file mode 100644 index 00000000000..fff57e16eab --- /dev/null +++ b/mysql-test/t/im_life_cycle.imtest @@ -0,0 +1,141 @@ +########################################################################### +# +# This file contains test for (1.1) test suite. +# +# Consult WL#2789 for more information. +# +########################################################################### + +--source include/im_check_os.inc + +########################################################################### +# +# 1.1.1. Check that Instance Manager is able: +# - to read definitions of two mysqld-instances; +# - to start the first instance; +# - to understand 'nonguarded' option and keep the second instance down; +# +########################################################################### + +SHOW INSTANCES; +--replace_column 3 VERSION +SHOW INSTANCE STATUS mysqld1; +--replace_column 3 VERSION +SHOW INSTANCE STATUS mysqld2; + +########################################################################### +# +# 1.1.2. Check 'START INSTANCE' command: +# - start the second instance; +# - check that it is reported as online; +# - execute some SQL-statement on mysqld2 to ensure that it is really up and +# running; +# +########################################################################### + +START INSTANCE mysqld2; +# FIXME +--sleep 3 + +SHOW INSTANCES; +--replace_column 3 VERSION +SHOW INSTANCE STATUS mysqld1; +--replace_column 3 VERSION +SHOW INSTANCE STATUS mysqld2; + +--connect (mysql_con,localhost,root,,mysql,$IM_MYSQLD1_PORT,$IM_MYSQLD1_SOCK) +--connection mysql_con + +SHOW VARIABLES LIKE 'port'; + +--connection default +--disconnect mysql_con + +########################################################################### +# +# 1.1.3. Check 'STOP INSTANCE' command: +# - stop the second instance; +# - check that it is reported as offline; +# - TODO: try to execute some SQL-statement to ensure that it is really down; +# +########################################################################### + +STOP INSTANCE mysqld2; +# FIXME +--sleep 3 + +SHOW INSTANCES; +--replace_column 3 VERSION +SHOW INSTANCE STATUS mysqld1; +--replace_column 3 VERSION +SHOW INSTANCE STATUS mysqld2; + +########################################################################### +# +# 1.1.4. Check that Instance Manager reports correct errors for 'START +# INSTANCE' command: +# - if the client tries to start unregistered instance; +# - if the client tries to start already started instance; +# - if the client submits invalid arguments; +# +########################################################################### + +--error 3000 +START INSTANCE mysqld3; + +--error 3002 +START INSTANCE mysqld1; + +# FIXME TODO +# BUG#12813: START/STOP INSTANCE commands accept a list as argument +# START INSTANCE mysqld1, mysqld2; + +########################################################################### +# +# 1.1.5. Check that Instance Manager reports correct errors for 'STOP INSTANCE' +# command: +# - if the client tries to start unregistered instance; +# - if the client tries to start already stopped instance; +# - if the client submits invalid arguments; +# +########################################################################### + +--error 3000 +STOP INSTANCE mysqld3; + +# TODO: IM should be fixed. +# BUG#12673: Instance Manager allows to stop the instance many times +# --error 3002 +# STOP INSTANCE mysqld2; + +# FIXME TODO +# BUG#12813: START/STOP INSTANCE commands accept a list as argument +# STOP INSTANCE mysqld1, mysqld2; + +########################################################################### +# +# 1.1.6. Check that Instance Manager is able to restart guarded instances. +# +########################################################################### + +SHOW INSTANCES; + +--exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_MYSQLD1_PATH_PID restarted + +########################################################################### +# +# 1.1.7. Check that Instance Manager does not restart non-guarded instance. +# +########################################################################### + +SHOW INSTANCES; + +START INSTANCE mysqld2; +# FIXME +--sleep 3 + +SHOW INSTANCES; + +--exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_MYSQLD2_PATH_PID killed + +SHOW INSTANCES; diff --git a/mysql-test/t/im_options_set.imtest b/mysql-test/t/im_options_set.imtest new file mode 100644 index 00000000000..785c6d05fef --- /dev/null +++ b/mysql-test/t/im_options_set.imtest @@ -0,0 +1,142 @@ +########################################################################### +# +# This file contains test for (3) test suite. +# +# Consult WL#2789 for more information. +# +########################################################################### + +# +# Check the options-management commands: +# - SET; +# - FLUSH INSTANCES; +# +# Let's test the commands on the option 'server_id'. It's expected that +# originally the instances have the following server ids: +# - mysqld1: 1 +# - mysqld2: 2 +# +# 1. SET .server_id= SERVER_ID); where SERVER_ID is 11 or 12. +# 1.1. check that the configuration file has been updated (i.e. contains +# server_id=SERVER_ID for the instance); +# 1.2. (for mysqld1) check that the running instance has not been affected: +# connect to the instance and check that 'SHOW VARIABLES LIKE 'server_id'' +# returns zero; +# 1.3. check that internal cache of Instance Manager has not been affected +# (i.e. SHOW INSTANCE OPTIONS does not contain updated value). +# +# 2. FLUSH INSTANCES; +# 2.1. check that the configuration file has not been updated; +# 2.2. (for mysqld1) check that the running instance has not been affected: +# connect to the instance and check that 'SHOW VARIABLES LIKE 'server_id'' +# returns zero value; +# 2.3. check that internal cache of Instance Manager has been updated (i.e. +# SHOW INSTANCE OPTIONS contains 'server_id=SERVER_ID' line). +# +# 3. Restore options. +# + +########################################################################### + +--source include/im_check_os.inc + +########################################################################### +# +# 0. Check starting conditions. +# +########################################################################### + +# - check the configuration file; + +--exec grep server_id $MYSQL_TEST_DIR/var/im.cnf ; + +# - check the running instances. + +--connect (mysql1_con,localhost,root,,mysql,$IM_MYSQLD1_PORT,$IM_MYSQLD1_SOCK) + +--connection mysql1_con + +SHOW VARIABLES LIKE 'server_id'; + +--connection default + +# - check the internal cache. +# TODO: we should check only server_id option here. + +# SHOW INSTANCE OPTIONS mysqld1; +# SHOW INSTANCE OPTIONS mysqld2; + +########################################################################### +# +# 1. SET .server_id= SERVER_ID); where SERVER_ID is 11 or 12. +# +########################################################################### + +# * mysqld1 + +SET mysqld1.server_id = 11; + +# - check that the configuration file has been updated (i.e. contains +# server_id=SERVER_ID for the instance); + +--exec grep server_id $MYSQL_TEST_DIR/var/im.cnf ; + +# - (for mysqld1) check that the running instance has not been affected: +# connect to the instance and check that 'SHOW VARIABLES LIKE 'server_id'' +# returns zero; + +--connection mysql1_con + +SHOW VARIABLES LIKE 'server_id'; + +--connection default + +# - check that internal cache of Instance Manager has not been affected +# (i.e. SHOW INSTANCE OPTIONS does not contain updated value). +# TODO: we should check only server_id option here. + +# SHOW INSTANCE OPTIONS mysqld1; + +# * mysqld2 + +SET mysqld2.server_id = 12; + +# - check that the configuration file has been updated (i.e. contains +# server_id=SERVER_ID for the instance); + +--exec grep server_id $MYSQL_TEST_DIR/var/im.cnf ; + +# - check that internal cache of Instance Manager has not been affected +# (i.e. SHOW INSTANCE OPTIONS does not contain updated value). +# TODO: we should check only server_id option here. + +# SHOW INSTANCE OPTIONS mysqld2; + +########################################################################### +# +# 2. FLUSH INSTANCES; +# +########################################################################### + +FLUSH INSTANCES; + +# - check that the configuration file has not been updated; + +--exec grep server_id $MYSQL_TEST_DIR/var/im.cnf ; + +# - (for mysqld1) check that the running instance has not been affected: +# connect to the instance and check that 'SHOW VARIABLES LIKE 'server_id'' +# returns zero value; + +--connection mysql1_con + +SHOW VARIABLES LIKE 'server_id'; + +--connection default + +# - check that internal cache of Instance Manager has been updated (i.e. +# SHOW INSTANCE OPTIONS contains 'server_id=' line). +# TODO: we should check only server_id option here. + +# SHOW INSTANCE OPTIONS mysqld1; +# SHOW INSTANCE OPTIONS mysqld2; diff --git a/mysql-test/t/im_options_unset.imtest b/mysql-test/t/im_options_unset.imtest new file mode 100644 index 00000000000..74ec42ac3f9 --- /dev/null +++ b/mysql-test/t/im_options_unset.imtest @@ -0,0 +1,150 @@ +########################################################################### +# +# This file contains test for (3) test suite. +# +# Consult WL#2789 for more information. +# +########################################################################### + +# +# Check the options-management commands: +# - UNSET; +# - FLUSH INSTANCES; +# +# Let's test the commands on the option 'server_id'. It's expected that +# originally the instances have the following server ids: +# - mysqld1: 1 +# - mysqld2: 2 +# +# The test case: +# +# 1. UNSET .server_id; +# +# Do the step for both instances. +# +# 1.1. check that the configuration file has been updated (i.e. does not +# contain 'server_id=' line for the instance); +# 1.2. (for mysqld1) check that the running instance has not been affected: +# connect to the instance and check that 'SHOW VARIABLES LIKE 'server_id'' +# returns non-zero value; +# 1.3. check that internal cache of Instance Manager is not affected (i.e. +# SHOW INSTANCE OPTIONS contains non-zero value for server_id); +# +# 2. FLUSH INSTANCES; +# +# Do the step for both instances. +# +# 2.1. check that the configuration file has not been updated (i.e. does not +# contain 'server_id=' for the instance); +# 2.2. (for mysqld1) check that the running instance has not been affected: +# connect to the instance and check that 'SHOW VARIABLES LIKE 'server_id'' +# returns non-zero value; +# 2.3. check that internal cache of Instance Manager has been updated (i.e. +# SHOW INSTANCE OPTIONS does not contain 'server_id=' line). +# + +########################################################################### + +--source include/im_check_os.inc + +########################################################################### +# +# 0. Check starting conditions. +# +########################################################################### + +# - check the configuration file; + +--exec grep server_id $MYSQL_TEST_DIR/var/im.cnf ; + +# - check the running instances. + +--connect (mysql1_con,localhost,root,,mysql,$IM_MYSQLD1_PORT,$IM_MYSQLD1_SOCK) + +--connection mysql1_con + +SHOW VARIABLES LIKE 'server_id'; + +--connection default + +# - check the internal cache. +# TODO: we should check only server_id option here. + +# SHOW INSTANCE OPTIONS mysqld1; +# SHOW INSTANCE OPTIONS mysqld2; + +########################################################################### +# +# 1. UNSET .server_id; +# +########################################################################### + +# * mysqld1 + +UNSET mysqld1.server_id; + +# - check that the configuration file has been updated (i.e. does not +# contain 'server_id=' line for the instance); + +--exec grep server_id $MYSQL_TEST_DIR/var/im.cnf ; + +# - check that the running instance has not been affected: connect to the +# instance and check that 'SHOW VARIABLES LIKE 'server_id'' returns non-zero +# value; + +--connection mysql1_con + +SHOW VARIABLES LIKE 'server_id'; + +--connection default + +# - check that internal cache of Instance Manager is not affected (i.e. SHOW +# INSTANCE OPTIONS contains non-zero value for server_id); +# TODO: we should check only server_id option here. + +# SHOW INSTANCE OPTIONS mysqld1; + +# * mysqld2 + +UNSET mysqld2.server_id; + +# - check that the configuration file has been updated (i.e. does not +# contain 'server_id=' line for the instance); + +--exec grep server_id $MYSQL_TEST_DIR/var/im.cnf || true; + +# - check that internal cache of Instance Manager is not affected (i.e. SHOW +# INSTANCE OPTIONS contains non-zero value for server_id); +# TODO: we should check only server_id option here. + +# SHOW INSTANCE OPTIONS mysqld2; + +########################################################################### +# +# 2. FLUSH INSTANCES; +# +########################################################################### + +FLUSH INSTANCES; + +# - check that the configuration file has not been updated (i.e. does not +# contain 'server_id=' for the instance); + +--exec grep server_id $MYSQL_TEST_DIR/var/im.cnf || true; + +# - (for mysqld1) check that the running instance has not been affected: +# connect to the instance and check that 'SHOW VARIABLES LIKE 'server_id'' +# returns non-zero value; + +--connection mysql1_con + +SHOW VARIABLES LIKE 'server_id'; + +--connection default + +# - check that internal cache of Instance Manager has been updated (i.e. +# SHOW INSTANCE OPTIONS does not contain 'server_id=' line). +# TODO: we should check only server_id option here. + +# SHOW INSTANCE OPTIONS mysqld1; +# SHOW INSTANCE OPTIONS mysqld2; diff --git a/mysql-test/t/im_utils.imtest b/mysql-test/t/im_utils.imtest new file mode 100644 index 00000000000..dc6fb93c4ff --- /dev/null +++ b/mysql-test/t/im_utils.imtest @@ -0,0 +1,115 @@ +########################################################################### +# +# This file contains test for (2) test suite. +# +# Consult WL#2789 for more information. +# +########################################################################### + +--source include/im_check_os.inc + +########################################################################### + +# +# Check starting conditions. This test case assumes that: +# - two mysqld-instances are registered; +# - the first instance is online; +# - the second instance is offline; +# + +SHOW INSTANCES; + +# +# Check 'SHOW INSTANCE OPTIONS' command: +# - check that options of both offline and online instances are accessible; +# - since configuration of an mysqld-instance contains directories, we should +# completely ignore the second column (values) in order to make the test +# case produce the same results on different installations; +# TODO: ignore values of only directory-specific options. +# + +--replace_column 2 VALUE +SHOW INSTANCE OPTIONS mysqld1; + +--replace_column 2 VALUE +SHOW INSTANCE OPTIONS mysqld2; + +# +# Before checking log files, we should start the second instance (mysqld2) to +# give it a chance to create log files. +# + +START INSTANCE mysqld2; + +# FIXME +-- sleep 3 + +STOP INSTANCE mysqld2; + +# +# Check 'SHOW LOG FILES' command: +# - check that log files of both offline and online instances are accessible; +# - since placement of the log files is installation-specific, we should +# ignore it in comparisson; +# - also, we should ignore log file size, since it may depend on the version +# being tested; +# + +--replace_column 2 PATH 3 FILE_SIZE +SHOW mysqld1 LOG FILES; + +--replace_column 2 PATH 3 FILE_SIZE +SHOW mysqld2 LOG FILES; + +# +# Check 'SHOW LOG' command: +# - check that all three kinds of logs are available for both offline and +# online instances; +# - we should ignore the value, because it is very specific and depends on +# many factors; we only check that Instance Manager is able to provide log +# files. +# + +# mysqld1 (online) w/o the optional argument. + +--replace_column 1 LOG_DATA +SHOW mysqld1 LOG ERROR 10; + +--replace_column 1 LOG_DATA +SHOW mysqld1 LOG SLOW 10; + +--replace_column 1 LOG_DATA +SHOW mysqld1 LOG GENERAL 10; + +# mysqld1 (online) with the optional argument. + +--replace_column 1 LOG_DATA +SHOW mysqld1 LOG ERROR 10, 2; + +--replace_column 1 LOG_DATA +SHOW mysqld1 LOG SLOW 10, 2; + +--replace_column 1 LOG_DATA +SHOW mysqld1 LOG GENERAL 10, 2; + +# mysqld2 (offline) w/o the optional argument. + +--replace_column 1 LOG_DATA +SHOW mysqld2 LOG ERROR 10; + +--replace_column 1 LOG_DATA +SHOW mysqld2 LOG SLOW 10; + +--replace_column 1 LOG_DATA +SHOW mysqld2 LOG GENERAL 10; + +# mysqld2 (offline) with the optional argument. + +--replace_column 1 LOG_DATA +SHOW mysqld2 LOG ERROR 10, 2; + +--replace_column 1 LOG_DATA +SHOW mysqld2 LOG SLOW 10, 2; + +--replace_column 1 LOG_DATA +SHOW mysqld2 LOG GENERAL 10, 2; diff --git a/mysql-test/t/kill_n_check.sh b/mysql-test/t/kill_n_check.sh new file mode 100755 index 00000000000..7fe30c4774c --- /dev/null +++ b/mysql-test/t/kill_n_check.sh @@ -0,0 +1,66 @@ +#!/bin/sh + +if [ $# -ne 2 ]; then + echo "Usage: kill_n_check.sh killed|restarted" + exit 0 +fi + +pid_path="$1" +expected_result="$2" + +if [ -z "$pid_path" -o ! -r "$pid_path" ]; then + echo "Error: invalid PID path ($pid_path) or PID file does not exist." + exit 0 +fi + +if [ "$expected_result" != "killed" -a \ + "$expected_result" != "restarted" ]; then + echo "Error: expected result must be either 'killed' or 'restarted'." + exit 0 +fi + +# echo "PID path: '$pid_path'" + +original_pid=`cat "$pid_path"` + +# echo "Original PID: $original_pid" + +echo "Killing the process..." + +kill -9 $original_pid + +echo "Sleeping..." + +sleep 3 + +new_pid="" + +[ -r "$pid_path" ] && new_pid=`cat "$pid_path"` + +# echo "New PID: $new_pid" + +if [ "$expected_result" == "restarted" ]; then + + if [ -z "$new_pid" ]; then + echo "Error: the process was killed." + exit 0 + fi + + if [ "$original_pid" -eq "$new_pid" ]; then + echo "Error: the process was not restarted." + exit 0 + fi + + echo "Success: the process was restarted." + exit 0 + +else # $expected_result == killed + + if [ "$new_pid" -a "$new_pid" -ne "$original_pid" ]; then + echo "Error: the process was restarted." + exit 0 + fi + + echo "Success: the process was killed." + exit 0 +fi From d553b667911304ae14f9bed3b10fd3c1b77da649 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Sep 2005 16:26:48 -0700 Subject: [PATCH 203/225] Move handler specific options into handlerton flag check BUG#13108 mysql-test/r/federated.result: added test results for federated alter table mysql-test/t/federated.test: added test for federated alter table sql/examples/ha_example.cc: supports table re-creation sql/examples/ha_tina.cc: supports table re-creation sql/ha_blackhole.cc: supports table re-creation sql/ha_federated.cc: added flag for not supporting alter sql/ha_heap.cc: supports table recreation sql/ha_myisam.cc: supports table recreation sql/ha_myisammrg.cc: supports table re-creation sql/handler.cc: implemented flag check function sql/handler.h: added additional handlerton flags created a function to test flags replace ha_supports_generate macro with call to flag check sql/sql_delete.cc: replaced ha_supports_generate with handlerton flag check sql/sql_table.cc: added check for handlerton check for alter support --- mysql-test/r/federated.result | 26 +++++++++++++++++++++ mysql-test/t/federated.test | 44 ++++++++++++++++++++++++++++++++++- sql/examples/ha_example.cc | 2 +- sql/examples/ha_tina.cc | 2 +- sql/ha_blackhole.cc | 2 +- sql/ha_federated.cc | 2 +- sql/ha_heap.cc | 2 +- sql/ha_myisam.cc | 2 +- sql/ha_myisammrg.cc | 2 +- sql/handler.cc | 17 ++++++++++++++ sql/handler.h | 13 ++++------- sql/sql_delete.cc | 5 ++-- sql/sql_table.cc | 10 ++++++++ 13 files changed, 111 insertions(+), 18 deletions(-) diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result index 1ec9857c8a7..e0e0bba3271 100644 --- a/mysql-test/r/federated.result +++ b/mysql-test/r/federated.result @@ -1457,6 +1457,32 @@ federated.t1 repair status OK REPAIR TABLE federated.t1 USE_FRM; Table Op Msg_type Msg_text federated.t1 repair status OK +DROP TABLE IF EXISTS federated.normal_table; +CREATE TABLE federated.normal_table ( +`id` int(4) NOT NULL, +`name` varchar(10) default NULL +) DEFAULT CHARSET=latin1; +DROP TABLE IF EXISTS federated.alter_me; +CREATE TABLE federated.alter_me ( +`id` int(4) NOT NULL, +`name` varchar(10) default NULL, +PRIMARY KEY (`id`) +) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 +CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/normal_table'; +INSERT INTO federated.alter_me (id, name) VALUES (1, 'Monty'); +INSERT INTO federated.alter_me (id, name) VALUES (2, 'David'); +SELECT * FROM federated.alter_me; +id name +1 Monty +2 David +ALTER TABLE federated.alter_me MODIFY COLUMN id int(16) NOT NULL; +ERROR HY000: Table storage engine for 'alter_me' doesn't have this option +SELECT * FROM federated.alter_me; +id name +1 Monty +2 David +DROP TABLE federated.alter_me; +DROP TABLE federated.normal_table; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; DROP TABLE IF EXISTS federated.t1; diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index 28091676dd7..c401468a940 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -1137,11 +1137,53 @@ ORDER BY federated.t1.country_id; DROP TABLE federated.countries; -# optimize and repair tests +#BEGIN optimize and repair tests OPTIMIZE TABLE federated.t1; REPAIR TABLE federated.t1; REPAIR TABLE federated.t1 QUICK; REPAIR TABLE federated.t1 EXTENDED; REPAIR TABLE federated.t1 USE_FRM; +#END optimize and repair tests + + +# BEGIN ALTER TEST +connection slave; +--disable_warnings +DROP TABLE IF EXISTS federated.normal_table; +--enable_warnings + +CREATE TABLE federated.normal_table ( + `id` int(4) NOT NULL, + `name` varchar(10) default NULL + ) DEFAULT CHARSET=latin1; + +connection master; +--disable_warnings +DROP TABLE IF EXISTS federated.alter_me; +--enable_warnings + +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE federated.alter_me ( + `id` int(4) NOT NULL, + `name` varchar(10) default NULL, + PRIMARY KEY (`id`) + ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 + CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/normal_table'; + +INSERT INTO federated.alter_me (id, name) VALUES (1, 'Monty'); +INSERT INTO federated.alter_me (id, name) VALUES (2, 'David'); + +SELECT * FROM federated.alter_me; + +--error 1031 +ALTER TABLE federated.alter_me MODIFY COLUMN id int(16) NOT NULL; + +SELECT * FROM federated.alter_me; + +DROP TABLE federated.alter_me; +connection slave; +DROP TABLE federated.normal_table; +# END ALTER TEST + source include/federated_cleanup.inc; diff --git a/sql/examples/ha_example.cc b/sql/examples/ha_example.cc index cc4ad3eb535..d809398b69f 100644 --- a/sql/examples/ha_example.cc +++ b/sql/examples/ha_example.cc @@ -90,7 +90,7 @@ handlerton example_hton= { NULL, /* create_cursor_read_view */ NULL, /* set_cursor_read_view */ NULL, /* close_cursor_read_view */ - HTON_NO_FLAGS + HTON_CAN_RECREATE }; /* Variables for example share methods */ diff --git a/sql/examples/ha_tina.cc b/sql/examples/ha_tina.cc index 5663cd829bd..559fdfbbbd9 100644 --- a/sql/examples/ha_tina.cc +++ b/sql/examples/ha_tina.cc @@ -71,7 +71,7 @@ handlerton tina_hton= { NULL, /* create_cursor_read_view */ NULL, /* set_cursor_read_view */ NULL, /* close_cursor_read_view */ - HTON_NO_FLAGS + HTON_CAN_RECREATE }; /***************************************************************************** diff --git a/sql/ha_blackhole.cc b/sql/ha_blackhole.cc index f089b67d678..57882e638d7 100644 --- a/sql/ha_blackhole.cc +++ b/sql/ha_blackhole.cc @@ -43,7 +43,7 @@ handlerton blackhole_hton= { NULL, /* create_cursor_read_view */ NULL, /* set_cursor_read_view */ NULL, /* close_cursor_read_view */ - HTON_NO_FLAGS + HTON_CAN_RECREATE }; /***************************************************************************** diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index 9a8b5eb794d..f2caca7f012 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -713,7 +713,7 @@ handlerton federated_hton= { NULL, /* create_cursor_read_view */ NULL, /* set_cursor_read_view */ NULL, /* close_cursor_read_view */ - HTON_NO_FLAGS + HTON_ALTER_NOT_SUPPORTED }; diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index fafd597e858..ad7da559ff4 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -40,7 +40,7 @@ handlerton heap_hton= { NULL, /* create_cursor_read_view */ NULL, /* set_cursor_read_view */ NULL, /* close_cursor_read_view */ - HTON_NO_FLAGS + HTON_CAN_RECREATE }; /***************************************************************************** diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 02769c1eb31..c9e69b377d0 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -73,7 +73,7 @@ handlerton myisam_hton= { MyISAM doesn't support transactions and doesn't have transaction-dependent context: cursors can survive a commit. */ - HTON_NO_FLAGS + HTON_CAN_RECREATE }; // collect errors printed by mi_check routines diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index 8347dcdaa3e..7a93015ecaa 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -51,7 +51,7 @@ handlerton myisammrg_hton= { NULL, /* create_cursor_read_view */ NULL, /* set_cursor_read_view */ NULL, /* close_cursor_read_view */ - HTON_NO_FLAGS + HTON_CAN_RECREATE }; diff --git a/sql/handler.cc b/sql/handler.cc index 39d9b706ed2..5221ccbb7c5 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -183,6 +183,23 @@ const char *ha_get_storage_engine(enum db_type db_type) return "none"; } +bool ha_check_storage_engine_flag(enum db_type db_type, uint32 flag) +{ + show_table_type_st *types; + for (types= sys_table_types; types->type; types++) + { + if (db_type == types->db_type) + { + if (types->ht->flags & flag) + return TRUE; + else + return FALSE; + } + } + + return FALSE; +} + my_bool ha_storage_engine_is_enabled(enum db_type database_type) { diff --git a/sql/handler.h b/sql/handler.h index 50f697bc980..9d955d1be58 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -377,8 +377,10 @@ struct show_table_alias_st { }; /* Possible flags of a handlerton */ -#define HTON_NO_FLAGS 0 -#define HTON_CLOSE_CURSORS_AT_COMMIT 1 +#define HTON_NO_FLAGS 0 +#define HTON_CLOSE_CURSORS_AT_COMMIT (1 << 0) +#define HTON_ALTER_NOT_SUPPORTED (1 << 1) +#define HTON_CAN_RECREATE (1 << 2) typedef struct st_thd_trans { @@ -848,18 +850,13 @@ extern ulong total_ha, total_ha_2pc; #define ha_commit(thd) (ha_commit_trans((thd), TRUE)) #define ha_rollback(thd) (ha_rollback_trans((thd), TRUE)) -#define ha_supports_generate(T) (T != DB_TYPE_INNODB && \ - T != DB_TYPE_BERKELEY_DB && \ - T != DB_TYPE_ARCHIVE_DB && \ - T != DB_TYPE_FEDERATED_DB && \ - T != DB_TYPE_NDBCLUSTER) - /* lookups */ enum db_type ha_resolve_by_name(const char *name, uint namelen); const char *ha_get_storage_engine(enum db_type db_type); handler *get_new_handler(TABLE *table, enum db_type db_type); enum db_type ha_checktype(THD *thd, enum db_type database_type, bool no_substitute, bool report_error); +bool ha_check_storage_engine_flag(enum db_type db_type, uint32 flag); /* basic stuff */ int ha_init(void); diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 4001a51f459..d9734b7cae8 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -787,7 +787,7 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok) TABLE *table= *table_ptr; table->file->info(HA_STATUS_AUTO | HA_STATUS_NO_LOCK); db_type table_type= table->s->db_type; - if (!ha_supports_generate(table_type)) + if (!ha_check_storage_engine_flag(table_type, HTON_CAN_RECREATE)) goto trunc_by_del; strmov(path, table->s->path); *table_ptr= table->next; // Unlink table from list @@ -818,7 +818,8 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok) table_list->db, table_list->table_name); DBUG_RETURN(TRUE); } - if (!ha_supports_generate(table_type) || thd->lex->sphead) + if (!ha_check_storage_engine_flag(table_type, HTON_CAN_RECREATE) + || thd->lex->sphead) goto trunc_by_del; if (lock_and_wait_for_table_name(thd, table_list)) DBUG_RETURN(TRUE); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index dba4168343a..4438400806f 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3156,6 +3156,16 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, if (create_info->row_type == ROW_TYPE_NOT_USED) create_info->row_type= table->s->row_type; + DBUG_PRINT("info", ("old type: %d new type: %d", old_db_type, new_db_type)); + if (ha_check_storage_engine_flag(old_db_type, HTON_ALTER_NOT_SUPPORTED) + || ha_check_storage_engine_flag(new_db_type, HTON_ALTER_NOT_SUPPORTED)) + { + DBUG_PRINT("info", ("doesn't support alter")); + my_error(ER_ILLEGAL_HA, MYF(0), table_name); + DBUG_RETURN(TRUE); + } + DBUG_PRINT("info", ("supports alter")); + thd->proc_info="setup"; if (!(alter_info->flags & ~(ALTER_RENAME | ALTER_KEYS_ONOFF)) && !table->s->tmp_table) // no need to touch frm From 58263844c7e916d271dc1e14661ea1b6e66d5e04 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 1 Oct 2005 09:35:30 +0300 Subject: [PATCH 204/225] Fix for BUG#13410 - qualified reference to a view column in the HAVING clause cannot be resolved. The problem was then when a column reference was resolved to a view column, the new Item created for this column contained the name of the view, and not the view alias. mysql-test/r/view.result: Additional test for BUG#13410. mysql-test/t/view.test: Additional test for BUG#13410. sql/item.cc: Correctly cast 'cur_field' to Item_ident because if the original item is an Item_field, the cur_field is either an Item_field or an Item_ref. Thus we have to cast cur_field to a common super-class of both. sql/item.h: - real_item() may be called before Item_ref::ref is set (i.e. the Item_ref object was resolved). - To avoid a crash and to return some meaningful value in such cases we return 'this'. sql/sql_base.cc: - 'item' may be an Item_ref, so we test for the type of the actual referenced item. - Correctly cast 'cur_field' to Item_ident because if the original item is an Item_field, the cur_field is either an Item_field or an Item_ref. Thus we have to cast cur_field to a common super-class of both. sql/table.cc: - When creating a new Item for a reference to a view column, use the view alias, and not the real view name. - Removed old code --- mysql-test/r/view.result | 10 ++++++++++ mysql-test/t/view.test | 2 ++ sql/item.cc | 4 ++-- sql/item.h | 2 +- sql/sql_base.cc | 4 ++-- sql/table.cc | 18 +----------------- 6 files changed, 18 insertions(+), 22 deletions(-) diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 9742c029706..e52ec950c8c 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -2286,5 +2286,15 @@ SELECT v1.a FROM v1 GROUP BY v1.a HAVING v1.a > 1; a 2 3 +SELECT t_1.a FROM t1 AS t_1 GROUP BY t_1.a HAVING t_1.a IN (1,2,3); +a +1 +2 +3 +SELECT v_1.a FROM v1 AS v_1 GROUP BY v_1.a HAVING v_1.a IN (1,2,3); +a +1 +2 +3 DROP VIEW v1; DROP TABLE t1; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 8d3593162c7..15c8cccf69c 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -2162,6 +2162,8 @@ INSERT INTO t1 VALUES (1,1),(2,2),(3,3); CREATE VIEW v1 AS SELECT a,b FROM t1; SELECT t1.a FROM t1 GROUP BY t1.a HAVING t1.a > 1; SELECT v1.a FROM v1 GROUP BY v1.a HAVING v1.a > 1; +SELECT t_1.a FROM t1 AS t_1 GROUP BY t_1.a HAVING t_1.a IN (1,2,3); +SELECT v_1.a FROM v1 AS v_1 GROUP BY v_1.a HAVING v_1.a IN (1,2,3); DROP VIEW v1; DROP TABLE t1; diff --git a/sql/item.cc b/sql/item.cc index f826fc1d874..966dbbaec53 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2973,7 +2973,7 @@ static Item** find_field_in_group_list(Item *find_item, ORDER *group_list) const char *field_name; ORDER *found_group= NULL; int found_match_degree= 0; - Item_field *cur_field; + Item_ident *cur_field; int cur_match_degree= 0; if (find_item->type() == Item::FIELD_ITEM || @@ -2992,7 +2992,7 @@ static Item** find_field_in_group_list(Item *find_item, ORDER *group_list) { if ((*(cur_group->item))->real_item()->type() == Item::FIELD_ITEM) { - cur_field= (Item_field*) *cur_group->item; + cur_field= (Item_ident*) *cur_group->item; cur_match_degree= 0; DBUG_ASSERT(cur_field->field_name != 0); diff --git a/sql/item.h b/sql/item.h index 10c1eec2db9..755eaf2136f 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1619,7 +1619,7 @@ public: } Item *real_item() { - return (*ref)->real_item(); + return (ref && *ref) ? (*ref)->real_item() : this; } bool walk(Item_processor processor, byte *arg) { return (*ref)->walk(processor, arg); } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 715d38925aa..1ea51ae1067 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -3357,9 +3357,9 @@ find_item_in_list(Item *find, List &items, uint *counter, for (uint i= 0; (item=li++); i++) { - if (field_name && item->type() == Item::FIELD_ITEM) + if (field_name && item->real_item()->type() == Item::FIELD_ITEM) { - Item_field *item_field= (Item_field*) item; + Item_ident *item_field= (Item_ident*) item; /* In case of group_concat() with ORDER BY condition in the QUERY diff --git a/sql/table.cc b/sql/table.cc index 982d5e7ddc9..4be48bafae4 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2424,22 +2424,6 @@ Field *Natural_join_column::field() const char *Natural_join_column::table_name() { return table_ref->alias; - /* - TODO: - I think that it is sufficient to return just - table->alias, which is correctly set to either - the view name, the table name, or the alias to - the table reference (view or stored table). - */ -#ifdef NOT_YET - if (view_field) - return table_ref->view_name.str; - - DBUG_ASSERT(!strcmp(table_ref->table_name, - table_ref->table->s->table_name)); - return table_ref->table_name; -} -#endif } @@ -2575,7 +2559,7 @@ Item *create_view_field(THD *thd, TABLE_LIST *view, Item **field_ref, DBUG_RETURN(field); } Item *item= new Item_direct_view_ref(&view->view->select_lex.context, - field_ref, view->view_name.str, + field_ref, view->alias, name); DBUG_RETURN(item); } From c96cf154a879e3deb4e8cfc108355b97e4f5e7d0 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 1 Oct 2005 17:21:09 +0200 Subject: [PATCH 205/225] init_db.sql: mysql.user.password doesn't need utf8 mysql-test/lib/init_db.sql: mysql.user.password doesn't need utf8 --- mysql-test/lib/init_db.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/lib/init_db.sql b/mysql-test/lib/init_db.sql index 37353e5974f..b366a429ab2 100644 --- a/mysql-test/lib/init_db.sql +++ b/mysql-test/lib/init_db.sql @@ -62,7 +62,7 @@ comment='Host privileges; Merged with database privileges'; CREATE TABLE user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, - Password char(41) binary DEFAULT '' NOT NULL, + Password binary(41) DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, From 7e0e3cb7b96fde137ac8d3eecfb1e1c2a608629b Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 1 Oct 2005 21:05:09 +0200 Subject: [PATCH 206/225] mysqld.vcproj: Removed "examples/" from path to "ha_archive.cc" VC++Files/sql/mysqld.vcproj: Removed "examples/" from path to "ha_archive.cc" --- VC++Files/sql/mysqld.vcproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VC++Files/sql/mysqld.vcproj b/VC++Files/sql/mysqld.vcproj index 26d23022a50..49bf74ae5a2 100644 --- a/VC++Files/sql/mysqld.vcproj +++ b/VC++Files/sql/mysqld.vcproj @@ -1252,7 +1252,7 @@ + RelativePath="ha_archive.cpp"> Date: Sun, 2 Oct 2005 19:44:28 -0700 Subject: [PATCH 207/225] Next big patch for loadable storage engines! Handlerton array is now created instead of using sys_table_types_st. All storage engines can now have inits and giant ifdef's are now gone for startup. No compeltely clean yet, handlertons will next be merged with sys_table_types. Federated and archive now have real cleanup if their inits fail. sql/examples/ha_archive.cc: Modifications for new ha_init code. The init method now checks for errors and will not start up if the errors occur. sql/examples/ha_archive.h: Change for new init method. sql/examples/ha_example.cc: New handlerton pieces. sql/examples/ha_tina.cc: New handlerton pieces. sql/ha_berkeley.cc: New handlerton pieces, plus changes for ha_init changes. I'm not happy with our current "skip" setup. sql/ha_berkeley.h: Change in init return. sql/ha_blackhole.cc: Changes for new handlerton pieces. sql/ha_federated.cc: Changes for new handlerton and true cleanup code. sql/ha_heap.cc: Changes for new handlerton returns. sql/ha_innodb.cc: Changes for handlerton code. sql/ha_innodb.h: Change in init. sql/ha_myisam.cc: Changes for additional handlerton bits. sql/ha_myisammrg.cc: Changes for new handlerton bits. sql/ha_ndbcluster.cc: Changes for new handlerton bits. sql/ha_ndbcluster.h: Changes for handlerton bits. sql/handler.cc: Changes for ditching show_table_type_st types, and collapsing it into a handlerton array. The ha_init now just loops through all handlers to init (much cleaner...). handlertons and sys_table_types should be merged next. sql/handler.h: Additions for sys_table_types sql/log.cc: Clean up of binlog for changes in handlerton sql/mysql_priv.h: Removed unneeded define for binlog_init sql/sql_show.cc: Changes for change in handlerton to sys_table_types --- sql/examples/ha_archive.cc | 31 +++-- sql/examples/ha_archive.h | 2 +- sql/examples/ha_example.cc | 6 +- sql/examples/ha_tina.cc | 4 + sql/ha_berkeley.cc | 19 ++- sql/ha_berkeley.h | 2 +- sql/ha_blackhole.cc | 4 + sql/ha_federated.cc | 71 +++++++----- sql/ha_heap.cc | 4 + sql/ha_innodb.cc | 21 +++- sql/ha_innodb.h | 2 +- sql/ha_myisam.cc | 4 + sql/ha_myisammrg.cc | 4 + sql/ha_ndbcluster.cc | 19 ++- sql/ha_ndbcluster.h | 2 +- sql/handler.cc | 231 +++++++++++-------------------------- sql/handler.h | 31 +++-- sql/log.cc | 11 +- sql/mysql_priv.h | 1 - sql/sql_show.cc | 14 +-- 20 files changed, 244 insertions(+), 239 deletions(-) diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index 7a0c957e5c3..91e8c5d5eee 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -116,7 +116,7 @@ */ /* If the archive storage engine has been inited */ -static bool archive_inited= 0; +static bool archive_inited= FALSE; /* Variables for archive share methods */ pthread_mutex_t archive_mutex; static HASH archive_open_tables; @@ -138,6 +138,10 @@ static HASH archive_open_tables; /* dummy handlerton - only to have something to return from archive_db_init */ handlerton archive_hton = { "archive", + SHOW_OPTION_YES, + "Archive storage engine", + DB_TYPE_ARCHIVE_DB, + archive_db_init, 0, /* slot */ 0, /* savepoint size. */ NULL, /* close_connection */ @@ -176,18 +180,29 @@ static byte* archive_get_key(ARCHIVE_SHARE *share,uint *length, void RETURN - &archive_hton OK - 0 Error + FALSE OK + TRUE Error */ -handlerton *archive_db_init() +bool archive_db_init() { - archive_inited= 1; - VOID(pthread_mutex_init(&archive_mutex, MY_MUTEX_INIT_FAST)); + DBUG_ENTER("archive_db_init"); + if (pthread_mutex_init(&archive_mutex, MY_MUTEX_INIT_FAST)) + goto error; if (hash_init(&archive_open_tables, system_charset_info, 32, 0, 0, (hash_get_key) archive_get_key, 0, 0)) - return 0; - return &archive_hton; + { + VOID(pthread_mutex_destroy(&archive_mutex)); + } + else + { + archive_inited= TRUE; + DBUG_RETURN(FALSE); + } +error: + have_archive_db= SHOW_OPTION_DISABLED; // If we couldn't use handler + archive_hton.state= SHOW_OPTION_DISABLED; + DBUG_RETURN(TRUE); } /* diff --git a/sql/examples/ha_archive.h b/sql/examples/ha_archive.h index e2d8aa49add..849b5b5bd6c 100644 --- a/sql/examples/ha_archive.h +++ b/sql/examples/ha_archive.h @@ -105,6 +105,6 @@ public: enum thr_lock_type lock_type); }; -handlerton *archive_db_init(void); +bool archive_db_init(void); bool archive_db_end(void); diff --git a/sql/examples/ha_example.cc b/sql/examples/ha_example.cc index cc4ad3eb535..85497ecf9b4 100644 --- a/sql/examples/ha_example.cc +++ b/sql/examples/ha_example.cc @@ -74,7 +74,11 @@ handlerton example_hton= { - "CSV", + "EXAMPLE", + SHOW_OPTION_YES, + "Example storage engine", + DB_TYPE_EXAMPLE_DB, + NULL, /* We do need to write one! */ 0, /* slot */ 0, /* savepoint size. */ NULL, /* close_connection */ diff --git a/sql/examples/ha_tina.cc b/sql/examples/ha_tina.cc index 5663cd829bd..27d1a94271b 100644 --- a/sql/examples/ha_tina.cc +++ b/sql/examples/ha_tina.cc @@ -56,6 +56,10 @@ static int tina_init= 0; handlerton tina_hton= { "CSV", + SHOW_OPTION_YES, + "CSV storage engine", + DB_TYPE_CSV_DB, + NULL, /* One needs to be written! */ 0, /* slot */ 0, /* savepoint size. */ NULL, /* close_connection */ diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 2f47b03de9d..60dd27efa69 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -109,6 +109,10 @@ static int berkeley_rollback(THD *thd, bool all); handlerton berkeley_hton = { "BerkeleyDB", + SHOW_OPTION_YES, + "Supports transactions and page-level locking", + DB_TYPE_BERKELEY_DB, + berkeley_init, 0, /* slot */ 0, /* savepoint size */ berkeley_close_connection, @@ -135,10 +139,13 @@ typedef struct st_berkeley_trx_data { /* General functions */ -handlerton *berkeley_init(void) +bool berkeley_init(void) { DBUG_ENTER("berkeley_init"); + if (have_berkeley_db != SHOW_OPTION_YES) + goto error; + if (!berkeley_tmpdir) berkeley_tmpdir=mysql_tmpdir; if (!berkeley_home) @@ -164,7 +171,7 @@ handlerton *berkeley_init(void) berkeley_log_file_size= max(berkeley_log_file_size, 10*1024*1024L); if (db_env_create(&db_env,0)) - DBUG_RETURN(0); + goto error; db_env->set_errcall(db_env,berkeley_print_error); db_env->set_errpfx(db_env,"bdb"); db_env->set_noticecall(db_env, berkeley_noticecall); @@ -194,13 +201,17 @@ handlerton *berkeley_init(void) { db_env->close(db_env,0); db_env=0; - DBUG_RETURN(0); + goto error; } (void) hash_init(&bdb_open_tables,system_charset_info,32,0,0, (hash_get_key) bdb_get_key,0,0); pthread_mutex_init(&bdb_mutex,MY_MUTEX_INIT_FAST); - DBUG_RETURN(&berkeley_hton); + DBUG_RETURN(FALSE); +error: + have_berkeley_db= SHOW_OPTION_DISABLED; // If we couldn't use handler + berkeley_hton.state= SHOW_OPTION_DISABLED; + DBUG_RETURN(TRUE); } diff --git a/sql/ha_berkeley.h b/sql/ha_berkeley.h index 282641e3f25..10ac410a1a9 100644 --- a/sql/ha_berkeley.h +++ b/sql/ha_berkeley.h @@ -161,7 +161,7 @@ extern char *berkeley_home, *berkeley_tmpdir, *berkeley_logdir; extern long berkeley_lock_scan_time; extern TYPELIB berkeley_lock_typelib; -handlerton *berkeley_init(void); +bool berkeley_init(void); bool berkeley_end(void); bool berkeley_flush_logs(void); int berkeley_show_logs(Protocol *protocol); diff --git a/sql/ha_blackhole.cc b/sql/ha_blackhole.cc index f089b67d678..35f8d60a868 100644 --- a/sql/ha_blackhole.cc +++ b/sql/ha_blackhole.cc @@ -28,6 +28,10 @@ handlerton blackhole_hton= { "BLACKHOLE", + SHOW_OPTION_YES, + "/dev/null storage engine (anything you write to it disappears)", + DB_TYPE_BLACKHOLE_DB, + NULL, 0, /* slot */ 0, /* savepoint size. */ NULL, /* close_connection */ diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index 9a8b5eb794d..26a9ff47a2e 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -363,6 +363,33 @@ pthread_mutex_t federated_mutex; // This is the mutex we use to static int federated_init= FALSE; // Variable for checking the // init state of hash +/* Federated storage engine handlerton */ + +handlerton federated_hton= { + "FEDERATED", + SHOW_OPTION_YES, + "Federated MySQL storage engine", + DB_TYPE_FEDERATED_DB, + federated_db_init, + 0, /* slot */ + 0, /* savepoint size. */ + NULL, /* close_connection */ + NULL, /* savepoint */ + NULL, /* rollback to savepoint */ + NULL, /* release savepoint */ + NULL, /* commit */ + NULL, /* rollback */ + NULL, /* prepare */ + NULL, /* recover */ + NULL, /* commit_by_xid */ + NULL, /* rollback_by_xid */ + NULL, /* create_cursor_read_view */ + NULL, /* set_cursor_read_view */ + NULL, /* close_cursor_read_view */ + HTON_NO_FLAGS +}; + + /* Function we use in the creation of our hash to get key. */ static byte *federated_get_key(FEDERATED_SHARE *share, uint *length, @@ -386,10 +413,23 @@ static byte *federated_get_key(FEDERATED_SHARE *share, uint *length, bool federated_db_init() { - federated_init= 1; - VOID(pthread_mutex_init(&federated_mutex, MY_MUTEX_INIT_FAST)); - return (hash_init(&federated_open_tables, system_charset_info, 32, 0, 0, - (hash_get_key) federated_get_key, 0, 0)); + DBUG_ENTER("federated_db_init"); + if (pthread_mutex_init(&federated_mutex, MY_MUTEX_INIT_FAST)) + goto error; + if (hash_init(&federated_open_tables, system_charset_info, 32, 0, 0, + (hash_get_key) federated_get_key, 0, 0)) + { + VOID(pthread_mutex_destroy(&federated_mutex)); + } + else + { + federated_init= TRUE; + DBUG_RETURN(FALSE); + } +error: + have_federated_db= SHOW_OPTION_DISABLED; // If we couldn't use handler + federated_hton.state= SHOW_OPTION_DISABLED; + DBUG_RETURN(TRUE); } @@ -694,29 +734,6 @@ error: } -/* Federated storage engine handlerton */ - -handlerton federated_hton= { - "FEDERATED", - 0, /* slot */ - 0, /* savepoint size. */ - NULL, /* close_connection */ - NULL, /* savepoint */ - NULL, /* rollback to savepoint */ - NULL, /* release savepoint */ - NULL, /* commit */ - NULL, /* rollback */ - NULL, /* prepare */ - NULL, /* recover */ - NULL, /* commit_by_xid */ - NULL, /* rollback_by_xid */ - NULL, /* create_cursor_read_view */ - NULL, /* set_cursor_read_view */ - NULL, /* close_cursor_read_view */ - HTON_NO_FLAGS -}; - - /***************************************************************************** ** FEDERATED tables *****************************************************************************/ diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index fafd597e858..e6826fddb51 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -25,6 +25,10 @@ handlerton heap_hton= { "MEMORY", + SHOW_OPTION_YES, + "Hash based, stored in memory, useful for temporary tables", + DB_TYPE_HEAP, + NULL, 0, /* slot */ 0, /* savepoint size. */ NULL, /* close_connection */ diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 69c20bb7974..a27cce506b6 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -208,6 +208,10 @@ static int innobase_release_savepoint(THD* thd, void *savepoint); handlerton innobase_hton = { "InnoDB", + SHOW_OPTION_YES, + "Supports transactions, row-level locking, and foreign keys", + DB_TYPE_INNODB, + innobase_init, 0, /* slot */ sizeof(trx_named_savept_t), /* savepoint size. TODO: use it */ innobase_close_connection, @@ -1188,7 +1192,7 @@ ha_innobase::init_table_handle_for_HANDLER(void) /************************************************************************* Opens an InnoDB database. */ -handlerton* +bool innobase_init(void) /*===============*/ /* out: TRUE if error */ @@ -1200,6 +1204,9 @@ innobase_init(void) DBUG_ENTER("innobase_init"); + if (have_innodb != SHOW_OPTION_YES) + goto error; + ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)MYSQL_TYPE_VARCHAR); os_innodb_umask = (ulint)my_umask; @@ -1267,7 +1274,7 @@ innobase_init(void) "InnoDB: syntax error in innodb_data_file_path"); my_free(internal_innobase_data_file_path, MYF(MY_ALLOW_ZERO_PTR)); - DBUG_RETURN(0); + goto error; } /* -------------- Log files ---------------------------*/ @@ -1298,7 +1305,7 @@ innobase_init(void) my_free(internal_innobase_data_file_path, MYF(MY_ALLOW_ZERO_PTR)); - DBUG_RETURN(0); + goto error; } /* --------------------------------------------------*/ @@ -1386,7 +1393,7 @@ innobase_init(void) if (err != DB_SUCCESS) { my_free(internal_innobase_data_file_path, MYF(MY_ALLOW_ZERO_PTR)); - DBUG_RETURN(0); + goto error; } (void) hash_init(&innobase_open_tables,system_charset_info, 32, 0, 0, @@ -1413,7 +1420,11 @@ innobase_init(void) glob_mi.pos = trx_sys_mysql_master_log_pos; } */ - DBUG_RETURN(&innobase_hton); + DBUG_RETURN(FALSE); +error: + have_innodb= SHOW_OPTION_DISABLED; // If we couldn't use handler + innobase_hton.state= SHOW_OPTION_DISABLED; + DBUG_RETURN(TRUE); } /*********************************************************************** diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index d3c7af432a0..89d3ceee2bb 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -241,7 +241,7 @@ extern ulong srv_commit_concurrency; extern TYPELIB innobase_lock_typelib; -handlerton *innobase_init(void); +bool innobase_init(void); bool innobase_end(void); bool innobase_flush_logs(void); uint innobase_get_free_space(void); diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 6b88656dd76..b006532dd62 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -54,6 +54,10 @@ TYPELIB myisam_stats_method_typelib= { handlerton myisam_hton= { "MyISAM", + SHOW_OPTION_YES, + "Default engine as of MySQL 3.23 with great performance", + DB_TYPE_MYISAM, + NULL, 0, /* slot */ 0, /* savepoint size. */ NULL, /* close_connection */ diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index 8347dcdaa3e..d5d4805b25c 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -36,6 +36,10 @@ handlerton myisammrg_hton= { "MRG_MYISAM", + SHOW_OPTION_YES, + "Collection of identical MyISAM tables", + DB_TYPE_MRG_MYISAM, + NULL, 0, /* slot */ 0, /* savepoint size. */ NULL, /* close_connection */ diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 709a7ed14e0..2b028902ecb 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -51,6 +51,10 @@ static int ndbcluster_rollback(THD *thd, bool all); handlerton ndbcluster_hton = { "ndbcluster", + SHOW_OPTION_YES, + "Clustered, fault-tolerant, memory-based tables", + DB_TYPE_NDBCLUSTER, + ndbcluster_init, 0, /* slot */ 0, /* savepoint size */ ndbcluster_close_connection, @@ -4734,11 +4738,14 @@ static int connect_callback() return 0; } -handlerton * -ndbcluster_init() +bool ndbcluster_init() { int res; DBUG_ENTER("ndbcluster_init"); + + if (have_ndbcluster != SHOW_OPTION_YES) + goto ndbcluster_init_error; + // Set connectstring if specified if (opt_ndbcluster_connectstring != 0) DBUG_PRINT("connectstring", ("%s", opt_ndbcluster_connectstring)); @@ -4819,16 +4826,18 @@ ndbcluster_init() } ndbcluster_inited= 1; - DBUG_RETURN(&ndbcluster_hton); + DBUG_RETURN(FALSE); - ndbcluster_init_error: +ndbcluster_init_error: if (g_ndb) delete g_ndb; g_ndb= NULL; if (g_ndb_cluster_connection) delete g_ndb_cluster_connection; g_ndb_cluster_connection= NULL; - DBUG_RETURN(NULL); + have_ndbcluster= SHOW_OPTION_DISABLED; // If we couldn't use handler + ndbcluster_hton.state= SHOW_OPTION_DISABLED; + DBUG_RETURN(TRUE); } diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 2a1d51724d4..2f5c4a5cf6f 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -716,7 +716,7 @@ private: extern struct show_var_st ndb_status_variables[]; -handlerton *ndbcluster_init(void); +bool ndbcluster_init(void); bool ndbcluster_end(void); int ndbcluster_discover(THD* thd, const char* dbname, const char* name, diff --git a/sql/handler.cc b/sql/handler.cc index b7b599a0a90..e5a6855a738 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -63,6 +63,7 @@ extern handlerton federated_hton; extern handlerton myisam_hton; extern handlerton myisammrg_hton; extern handlerton heap_hton; +extern handlerton binlog_hton; /* static functions defined in this file */ @@ -80,41 +81,38 @@ ulong total_ha_2pc; ulong savepoint_alloc_size; /* - This structure will go away in the future. + This array is used for processing compiled in engines. */ -struct show_table_type_st sys_table_types[]= +handlerton *sys_table_types[]= { - {"MyISAM", &have_yes, - "Default engine as of MySQL 3.23 with great performance", DB_TYPE_MYISAM, - NULL}, - {"MEMORY", &have_yes, - "Hash based, stored in memory, useful for temporary tables", DB_TYPE_HEAP, - NULL}, - {"MRG_MYISAM", &have_yes, - "Collection of identical MyISAM tables", DB_TYPE_MRG_MYISAM, NULL}, - {"ISAM", &have_isam, - "Obsolete storage engine, now replaced by MyISAM", DB_TYPE_ISAM, NULL}, - {"MRG_ISAM", &have_isam, - "Obsolete storage engine, now replaced by MERGE", DB_TYPE_MRG_ISAM, NULL}, - {"InnoDB", &have_innodb, - "Supports transactions, row-level locking, and foreign keys", DB_TYPE_INNODB, - NULL}, - {"BERKELEYDB", &have_berkeley_db, - "Supports transactions and page-level locking", DB_TYPE_BERKELEY_DB, NULL}, - {"NDBCLUSTER", &have_ndbcluster, - "Clustered, fault-tolerant, memory-based tables", DB_TYPE_NDBCLUSTER, NULL}, - {"EXAMPLE",&have_example_db, - "Example storage engine", DB_TYPE_EXAMPLE_DB, NULL}, - {"ARCHIVE",&have_archive_db, - "Archive storage engine", DB_TYPE_ARCHIVE_DB, NULL}, - {"CSV",&have_csv_db, - "CSV storage engine", DB_TYPE_CSV_DB, NULL}, - {"FEDERATED",&have_federated_db, - "Federated MySQL storage engine", DB_TYPE_FEDERATED_DB, NULL}, - {"BLACKHOLE",&have_blackhole_db, - "/dev/null storage engine (anything you write to it disappears)", - DB_TYPE_BLACKHOLE_DB, NULL}, - {NullS, NULL, NullS, DB_TYPE_UNKNOWN, NULL} + &myisam_hton, + &heap_hton, +#ifdef HAVE_INNOBASE_DB + &innobase_hton, +#endif +#ifdef HAVE_BERKELEY_DB + &berkeley_hton, +#endif +#ifdef HAVE_BLACKHOLE_DB + &blackhole_hton, +#endif +#ifdef HAVE_EXAMPLE_DB + &example_hton, +#endif +#ifdef HAVE_ARCHIVE_DB + &archive_hton, +#endif +#ifdef HAVE_CSV_DB + &tina_hton, +#endif +#ifdef HAVE_NDBCLUSTER_DB + &ndbcluster_hton, +#endif +#ifdef HAVE_FEDERATED_DB + &federated_hton, +#endif + &myisammrg_hton, + NULL }; struct show_table_alias_st sys_table_aliases[]= @@ -144,17 +142,17 @@ enum db_type ha_resolve_by_name(const char *name, uint namelen) { THD *thd= current_thd; show_table_alias_st *table_alias; - show_table_type_st *types; + handlerton **types; const char *ptr= name; if (thd && !my_strcasecmp(&my_charset_latin1, ptr, "DEFAULT")) return (enum db_type) thd->variables.table_type; retest: - for (types= sys_table_types; types->type; types++) + for (types= sys_table_types; *types; types++) { - if (!my_strcasecmp(&my_charset_latin1, ptr, types->type)) - return (enum db_type) types->db_type; + if (!my_strcasecmp(&my_charset_latin1, ptr, (*types)->name)) + return (enum db_type) (*types)->db_type; } /* @@ -173,11 +171,11 @@ retest: } const char *ha_get_storage_engine(enum db_type db_type) { - show_table_type_st *types; - for (types= sys_table_types; types->type; types++) + handlerton **types; + for (types= sys_table_types; *types; types++) { - if (db_type == types->db_type) - return types->type; + if (db_type == (*types)->db_type) + return (*types)->name; } return "none"; @@ -186,18 +184,18 @@ const char *ha_get_storage_engine(enum db_type db_type) my_bool ha_storage_engine_is_enabled(enum db_type database_type) { - show_table_type_st *types; - for (types= sys_table_types; types->type; types++) + handlerton **types; + for (types= sys_table_types; *types; types++) { - if ((database_type == types->db_type) && - (*types->value == SHOW_OPTION_YES)) + if ((database_type == (*types)->db_type) && + ((*types)->state == SHOW_OPTION_YES)) return TRUE; } return FALSE; } - /* Use other database handler if databasehandler is not incompiled */ +/* Use other database handler if databasehandler is not compiled in */ enum db_type ha_checktype(THD *thd, enum db_type database_type, bool no_substitute, bool report_error) @@ -395,7 +393,7 @@ int ha_init() { int error= 0; handlerton **ht= handlertons; - show_table_type_st *types; + handlerton **types; show_table_alias_st *table_alias; total_ha= savepoint_alloc_size= 0; @@ -405,132 +403,35 @@ int ha_init() /* This will go away soon. */ - for (types= sys_table_types; types->type; types++) + for (types= sys_table_types; *types; types++) { - switch (types->db_type) { - case DB_TYPE_HEAP: - types->ht= &heap_hton; - break; - case DB_TYPE_MYISAM: - types->ht= &myisam_hton; - break; - case DB_TYPE_MRG_MYISAM: - types->ht= &myisammrg_hton; - break; -#ifdef HAVE_BERKELEY_DB - case DB_TYPE_BERKELEY_DB: - if (have_berkeley_db == SHOW_OPTION_YES) - { - if (!(*ht= berkeley_init())) - { - have_berkeley_db= SHOW_OPTION_DISABLED; // If we couldn't use handler - error= 1; - } - else - { - types->ht= &berkeley_hton; - ha_was_inited_ok(ht++); - } - } - break; -#endif -#ifdef HAVE_INNOBASE_DB - case DB_TYPE_INNODB: - if (have_innodb == SHOW_OPTION_YES) - { - if (!(*ht= innobase_init())) - { - have_innodb= SHOW_OPTION_DISABLED; // If we couldn't use handler - error= 1; - } - else - { - ha_was_inited_ok(ht++); - types->ht= &innobase_hton; - } - } - break; -#endif -#ifdef HAVE_NDBCLUSTER_DB - case DB_TYPE_NDBCLUSTER: - if (have_ndbcluster == SHOW_OPTION_YES) - { - if (!(*ht= ndbcluster_init())) - { - have_ndbcluster= SHOW_OPTION_DISABLED; - error= 1; - } - else - { - ha_was_inited_ok(ht++); - types->ht= &ndbcluster_hton; - } - } - break; -#endif -#ifdef HAVE_EXAMPLE_DB - case DB_TYPE_EXAMPLE_DB: - types->ht= &example_hton; - break; -#endif -#ifdef HAVE_ARCHIVE_DB - case DB_TYPE_ARCHIVE_DB: - if (have_archive_db == SHOW_OPTION_YES) - { - if (!(*ht= archive_db_init())) - { - have_archive_db= SHOW_OPTION_DISABLED; - error= 1; - } - else - { - ha_was_inited_ok(ht++); - types->ht= &archive_hton; - } - } - break; -#endif -#ifdef HAVE_CSV_DB - case DB_TYPE_CSV_DB: - types->ht= &tina_hton; - break; -#endif -#ifdef HAVE_FEDERATED_DB - case DB_TYPE_FEDERATED_DB: - if (have_federated_db == SHOW_OPTION_YES) - { - if (federated_db_init()) - { - have_federated_db= SHOW_OPTION_DISABLED; - error= 1; - } - else - { - types->ht= &federated_hton; - } - } - break; -#endif -#ifdef HAVE_BLACKHOLE_DB - case DB_TYPE_BLACKHOLE_DB: - types->ht= &blackhole_hton; - break; -#endif - default: - types->ht= NULL; + /* + FUTURE - + We need to collapse sys_table_types and handlertons variables into + one variable. + */ + *ht= *types; + ht++; + if ((*types)->init) + { + if (!(*types)->init()) + ha_was_inited_ok(types); } } if (opt_bin_log) { - if (!(*ht= binlog_init())) // Always succeed + if (0) // Should fail until binlog is a bit more se like { mysql_bin_log.close(LOG_CLOSE_INDEX); // Never used opt_bin_log= 0; // Never used error= 1; // Never used } else - ha_was_inited_ok(ht++); + { + *types= &binlog_hton; + ha_was_inited_ok(types); + } } DBUG_ASSERT(total_ha < MAX_HA); /* @@ -2525,7 +2426,7 @@ TYPELIB *ha_known_exts(void) { if (!known_extensions.type_names || mysys_usage_id != known_extensions_id) { - show_table_type_st *types; + handlerton **types; List found_exts; List_iterator_fast it(found_exts); const char **ext, *old_ext; @@ -2533,11 +2434,11 @@ TYPELIB *ha_known_exts(void) known_extensions_id= mysys_usage_id; found_exts.push_back((char*) triggers_file_ext); found_exts.push_back((char*) trigname_file_ext); - for (types= sys_table_types; types->type; types++) + for (types= sys_table_types; *types; types++) { - if (*types->value == SHOW_OPTION_YES) + if ((*types)->state == SHOW_OPTION_YES) { - handler *file= get_new_handler(0,(enum db_type) types->db_type); + handler *file= get_new_handler(0,(enum db_type) (*types)->db_type); for (ext= file->bas_ext(); *ext; ext++) { while ((old_ext= it++)) diff --git a/sql/handler.h b/sql/handler.h index f4f6a8592bb..37fb1ad0ef5 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -297,6 +297,27 @@ typedef struct storage engine name as it should be printed to a user */ const char *name; + + /* + Historical marker for if the engine is available of not + */ + SHOW_COMP_OPTION state; + + /* + A comment used by SHOW to describe an engine. + */ + const char *comment; + + /* + Historical number used for frm file to determine the correct storage engine. + This is going away and new engines will just use "name" for this. + */ + enum db_type db_type; + /* + Method that initizlizes a storage engine + */ + bool (*init)(); + /* each storage engine has it's own memory area (actually a pointer) in the thd, for storing per-connection information. @@ -356,14 +377,6 @@ typedef struct uint32 flags; /* global handler flags */ } handlerton; -struct show_table_type_st { - const char *type; - SHOW_COMP_OPTION *value; - const char *comment; - enum db_type db_type; - handlerton *ht; -}; - struct show_table_alias_st { const char *alias; const char *type; @@ -828,7 +841,7 @@ public: /* Some extern variables used with handlers */ -extern struct show_table_type_st sys_table_types[]; +extern handlerton *sys_table_types[]; extern const char *ha_row_type[]; extern TYPELIB tx_isolation_typelib; extern TYPELIB myisam_stats_method_typelib; diff --git a/sql/log.cc b/sql/log.cc index 6e372938752..51540b82827 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -38,6 +38,7 @@ ulong sync_binlog_counter= 0; static bool test_if_number(const char *str, long *res, bool allow_wildcards); +static bool binlog_init(); static int binlog_close_connection(THD *thd); static int binlog_savepoint_set(THD *thd, void *sv); static int binlog_savepoint_rollback(THD *thd, void *sv); @@ -45,8 +46,12 @@ static int binlog_commit(THD *thd, bool all); static int binlog_rollback(THD *thd, bool all); static int binlog_prepare(THD *thd, bool all); -static handlerton binlog_hton = { +handlerton binlog_hton = { "binlog", + SHOW_OPTION_YES, + "This is a meta storage engine to represent the binlog in a transaction", + DB_TYPE_UNKNOWN, /* IGNORE for now */ + binlog_init, 0, sizeof(my_off_t), /* savepoint size = binlog offset */ binlog_close_connection, @@ -71,9 +76,9 @@ static handlerton binlog_hton = { should be moved here. */ -handlerton *binlog_init() +bool binlog_init() { - return &binlog_hton; + return false; } static int binlog_close_connection(THD *thd) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index fc7bac89274..ab3871afafc 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1069,7 +1069,6 @@ bool fn_format_relative_to_data_home(my_string to, const char *name, const char *dir, const char *extension); File open_binlog(IO_CACHE *log, const char *log_file_name, const char **errmsg); -handlerton *binlog_init(); /* mysqld.cc */ extern void yyerror(const char*); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index cdd2818d897..6b0c5c7ab62 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -67,18 +67,18 @@ bool mysqld_show_storage_engines(THD *thd) const char *default_type_name= ha_get_storage_engine((enum db_type)thd->variables.table_type); - show_table_type_st *types; - for (types= sys_table_types; types->type; types++) + handlerton **types; + for (types= sys_table_types; *types; types++) { protocol->prepare_for_resend(); - protocol->store(types->type, system_charset_info); - const char *option_name= show_comp_option_name[(int) *types->value]; + protocol->store((*types)->name, system_charset_info); + const char *option_name= show_comp_option_name[(int) (*types)->state]; - if (*types->value == SHOW_OPTION_YES && - !my_strcasecmp(system_charset_info, default_type_name, types->type)) + if ((*types)->state == SHOW_OPTION_YES && + !my_strcasecmp(system_charset_info, default_type_name, (*types)->name)) option_name= "DEFAULT"; protocol->store(option_name, system_charset_info); - protocol->store(types->comment, system_charset_info); + protocol->store((*types)->comment, system_charset_info); if (protocol->write()) DBUG_RETURN(TRUE); } From eaeb04a7b10635d92e074a95cd2d29f02034ca9f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Oct 2005 11:49:06 +0200 Subject: [PATCH 208/225] ndb - mysql-test-run ndb_config Fix 32/64 bit insecure code ndb/src/mgmsrv/InitConfigFileParser.cpp: Fix 32/64 bit insecure/useless code --- ndb/src/mgmsrv/InitConfigFileParser.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index 233458ddf83..94f07ab0ca1 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -773,14 +773,10 @@ InitConfigFileParser::parse_mycnf() case ConfigInfo::CI_INT: opt.value = (gptr*)malloc(sizeof(int)); opt.var_type = GET_INT; - require(convertStringToUint64(param._min, (Uint64&)opt.min_value)); - require(convertStringToUint64(param._max, (Uint64&)opt.max_value)); break; case ConfigInfo::CI_INT64: opt.value = (gptr*)malloc(sizeof(Int64)); opt.var_type = GET_LL; - require(convertStringToUint64(param._min, (Uint64&)opt.min_value)); - require(convertStringToUint64(param._max, (Uint64&)opt.max_value)); break; case ConfigInfo::CI_STRING: opt.value = (gptr*)malloc(sizeof(char *)); From aa44e79c19c407fcff66878225f622b76d3aaaa8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Oct 2005 16:06:07 +0200 Subject: [PATCH 209/225] ndb - fix solaris problem (dont print null) ndb/src/mgmsrv/Services.cpp: Dont print null address --- ndb/src/mgmsrv/Services.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 8c087c2a3ca..9f7e34f93ef 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -940,7 +940,7 @@ printNodeStatus(OutputStream *output, output->println("node.%d.dynamic_id: %d", nodeId, dynamicId); output->println("node.%d.node_group: %d", nodeId, nodeGroup); output->println("node.%d.connect_count: %d", nodeId, connectCount); - output->println("node.%d.address: %s", nodeId, address); + output->println("node.%d.address: %s", nodeId, address ? address : ""); } } From 257eddcb81823fd6891d01d0d8d00680f4eb9f46 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Oct 2005 19:44:53 +0400 Subject: [PATCH 210/225] Fix -ansi -pedantic compilation failure. --- client/mysqltest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 9f59539b177..264140cefa8 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -3155,7 +3155,7 @@ static int run_query_normal(MYSQL* mysql, struct st_query* q, int flags) goto end; } - // If we come here the query is both executed and read successfully + /* If we come here the query is both executed and read successfully */ if (handle_no_error(q)) { error= 1; From a40601b13b6d800688f121a7c8ab950cb292f1e6 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Oct 2005 21:04:04 +0400 Subject: [PATCH 211/225] Unset EOLN_NATIVE flag for proper tests execution under win32. mysql-test/include/check_var_limit.inc: Turn off EOLN_NATIVE flag mysql-test/include/have_big5.inc: Turn off EOLN_NATIVE flag mysql-test/include/have_compress.inc: Turn off EOLN_NATIVE flag mysql-test/include/have_crypt.inc: Turn off EOLN_NATIVE flag mysql-test/include/have_outfile.inc: Turn off EOLN_NATIVE flag mysql-test/include/have_query_cache.inc: Turn off EOLN_NATIVE flag mysql-test/include/have_tis620.inc: Turn off EOLN_NATIVE flag mysql-test/include/have_ucs2.inc: Turn off EOLN_NATIVE flag mysql-test/include/have_ujis.inc: Turn off EOLN_NATIVE flag mysql-test/include/not_embedded.inc: Turn off EOLN_NATIVE flag mysql-test/include/system_db_struct.inc: Turn off EOLN_NATIVE flag mysql-test/include/test_outfile.inc: Turn off EOLN_NATIVE flag mysql-test/r/greedy_optimizer.result: Turn off EOLN_NATIVE flag mysql-test/r/index_merge.result: Turn off EOLN_NATIVE flag mysql-test/r/index_merge_bdb.result: Turn off EOLN_NATIVE flag mysql-test/r/index_merge_innodb.result: Turn off EOLN_NATIVE flag mysql-test/r/index_merge_innodb2.result: Turn off EOLN_NATIVE flag mysql-test/r/index_merge_ror.result: Turn off EOLN_NATIVE flag mysql-test/r/index_merge_ror_cpk.result: Turn off EOLN_NATIVE flag mysql-test/r/join_nested.result: Turn off EOLN_NATIVE flag mysql-test/r/rowid_order_bdb.result: Turn off EOLN_NATIVE flag mysql-test/r/rowid_order_innodb.result: Turn off EOLN_NATIVE flag mysql-test/r/rpl_session_var.result: Turn off EOLN_NATIVE flag mysql-test/r/sp-error.result: Turn off EOLN_NATIVE flag mysql-test/r/sp-security.result: Turn off EOLN_NATIVE flag mysql-test/r/sp.result: Turn off EOLN_NATIVE flag mysql-test/r/sum_distinct.result: Turn off EOLN_NATIVE flag mysql-test/std_data/des_key_file: Turn off EOLN_NATIVE flag mysql-test/std_data/init_file.dat: Turn off EOLN_NATIVE flag mysql-test/std_data/loaddata1.dat: Turn off EOLN_NATIVE flag mysql-test/std_data/loaddata2.dat: Turn off EOLN_NATIVE flag mysql-test/std_data/loaddata3.dat: Turn off EOLN_NATIVE flag mysql-test/std_data/loaddata4.dat: Turn off EOLN_NATIVE flag mysql-test/std_data/rpl_loaddata.dat: Turn off EOLN_NATIVE flag mysql-test/std_data/rpl_loaddata2.dat: Turn off EOLN_NATIVE flag mysql-test/std_data/warnings_loaddata.dat: Turn off EOLN_NATIVE flag mysql-test/t/greedy_optimizer.test: Turn off EOLN_NATIVE flag mysql-test/t/index_merge.test: Turn off EOLN_NATIVE flag mysql-test/t/index_merge_bdb.test: Turn off EOLN_NATIVE flag mysql-test/t/index_merge_innodb.test: Turn off EOLN_NATIVE flag mysql-test/t/index_merge_innodb2.test: Turn off EOLN_NATIVE flag mysql-test/t/index_merge_ror.test: Turn off EOLN_NATIVE flag mysql-test/t/index_merge_ror_cpk.test: Turn off EOLN_NATIVE flag mysql-test/t/join_nested.test: Turn off EOLN_NATIVE flag mysql-test/t/rowid_order_bdb.test: Turn off EOLN_NATIVE flag mysql-test/t/rowid_order_innodb.test: Turn off EOLN_NATIVE flag mysql-test/t/rpl_session_var.test: Turn off EOLN_NATIVE flag mysql-test/t/sp-error.test: Turn off EOLN_NATIVE flag mysql-test/t/sp-security.test: Turn off EOLN_NATIVE flag mysql-test/t/sp.test: Turn off EOLN_NATIVE flag mysql-test/t/sum_distinct.test: Turn off EOLN_NATIVE flag From ed35cecdccff8eb8be7e606c1611946937623f88 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Oct 2005 18:42:30 -0700 Subject: [PATCH 212/225] Final patch for 5.0 for simplifying storage engine code. We now have just one set of ifdefs. I may also remove the code for creating new handlers. May changes were to simplify storage engine setup and support for legacy call to show storage engines. mysql-test/r/ps_1general.result: Fixed test results for new listing order sql/examples/ha_tina.cc: Removed dead code sql/examples/ha_tina.h: Removed dead code sql/ha_archive.cc: Capitalized sotrage engine name and moved disabled code. sql/ha_berkeley.cc: Moved deisabled code sql/ha_federated.cc: Removed disabled code sql/ha_innodb.cc: Removed disabled message sql/ha_ndbcluster.cc: Removed disabled message sql/handler.cc: Added in legacy support for sotrage engine listing (ala Serg's request). Removed handlertons variables and we now have simplified ha_init code. sql/handler.h: No longer need handlertons array. --- mysql-test/r/ps_1general.result | 12 +-- sql/examples/ha_tina.cc | 15 ---- sql/examples/ha_tina.h | 7 -- sql/ha_archive.cc | 3 +- sql/ha_berkeley.cc | 1 - sql/ha_federated.cc | 1 - sql/ha_innodb.cc | 1 - sql/ha_ndbcluster.cc | 1 - sql/handler.cc | 150 ++++++++++++++++++-------------- sql/handler.h | 1 - 10 files changed, 91 insertions(+), 101 deletions(-) diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index b65a8291062..d41d1b74ca7 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -323,17 +323,17 @@ execute stmt4; Engine Support Comment MyISAM YES/NO Default engine as of MySQL 3.23 with great performance MEMORY YES/NO Hash based, stored in memory, useful for temporary tables -MRG_MYISAM YES/NO Collection of identical MyISAM tables -ISAM YES/NO Obsolete storage engine, now replaced by MyISAM -MRG_ISAM YES/NO Obsolete storage engine, now replaced by MERGE InnoDB YES/NO Supports transactions, row-level locking, and foreign keys -BERKELEYDB YES/NO Supports transactions and page-level locking -NDBCLUSTER YES/NO Clustered, fault-tolerant, memory-based tables +BerkeleyDB YES/NO Supports transactions and page-level locking +BLACKHOLE YES/NO /dev/null storage engine (anything you write to it disappears) EXAMPLE YES/NO Example storage engine ARCHIVE YES/NO Archive storage engine CSV YES/NO CSV storage engine +ndbcluster YES/NO Clustered, fault-tolerant, memory-based tables FEDERATED YES/NO Federated MySQL storage engine -BLACKHOLE YES/NO /dev/null storage engine (anything you write to it disappears) +MRG_MYISAM YES/NO Collection of identical MyISAM tables +binlog YES/NO This is a meta storage engine to represent the binlog in a transaction +ISAM YES/NO Obsolete storage engine drop table if exists t5; prepare stmt1 from ' drop table if exists t5 ' ; execute stmt1 ; diff --git a/sql/examples/ha_tina.cc b/sql/examples/ha_tina.cc index 86e6ae8a2de..541e91f4b46 100644 --- a/sql/examples/ha_tina.cc +++ b/sql/examples/ha_tina.cc @@ -861,21 +861,6 @@ THR_LOCK_DATA **ha_tina::store_lock(THD *thd, return to; } -/* - Range optimizer calls this. - I need to update the information on this. -*/ -ha_rows ha_tina::records_in_range(int inx, - const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag) -{ - DBUG_ENTER("ha_tina::records_in_range "); - DBUG_RETURN(records); // Good guess -} - - /* Create a table. You do not want to leave the table open after a call to this (the database will call ::open() if it needs to). diff --git a/sql/examples/ha_tina.h b/sql/examples/ha_tina.h index 1ccb3418771..84854e868fa 100644 --- a/sql/examples/ha_tina.h +++ b/sql/examples/ha_tina.h @@ -78,7 +78,6 @@ public: */ virtual double scan_time() { return (double) (records+deleted) / 20.0+10; } /* The next method will never be called */ - virtual double read_time(ha_rows rows) { DBUG_ASSERT(0); return((double) rows / 20.0+1); } virtual bool fast_key_read() { return 1;} /* TODO: return actual upper bound of number of records in the table. @@ -110,12 +109,6 @@ public: int reset(void); int external_lock(THD *thd, int lock_type); int delete_all_rows(void); - ha_rows records_in_range(int inx, const byte *start_key,uint start_key_len, - enum ha_rkey_function start_search_flag, - const byte *end_key,uint end_key_len, - enum ha_rkey_function end_search_flag); -// int delete_table(const char *from); -// int rename_table(const char * from, const char * to); int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info); THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, diff --git a/sql/ha_archive.cc b/sql/ha_archive.cc index bc066b672d3..59c56e80cc3 100644 --- a/sql/ha_archive.cc +++ b/sql/ha_archive.cc @@ -137,7 +137,7 @@ static HASH archive_open_tables; /* dummy handlerton - only to have something to return from archive_db_init */ handlerton archive_hton = { - "archive", + "ARCHIVE", SHOW_OPTION_YES, "Archive storage engine", DB_TYPE_ARCHIVE_DB, @@ -201,7 +201,6 @@ bool archive_db_init() } error: have_archive_db= SHOW_OPTION_DISABLED; // If we couldn't use handler - archive_hton.state= SHOW_OPTION_DISABLED; DBUG_RETURN(TRUE); } diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 60dd27efa69..c7e56b350bf 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -210,7 +210,6 @@ bool berkeley_init(void) DBUG_RETURN(FALSE); error: have_berkeley_db= SHOW_OPTION_DISABLED; // If we couldn't use handler - berkeley_hton.state= SHOW_OPTION_DISABLED; DBUG_RETURN(TRUE); } diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index c129cb3058c..2b2be71cf53 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -428,7 +428,6 @@ bool federated_db_init() } error: have_federated_db= SHOW_OPTION_DISABLED; // If we couldn't use handler - federated_hton.state= SHOW_OPTION_DISABLED; DBUG_RETURN(TRUE); } diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index ebe1e41f890..1129251f06b 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -1423,7 +1423,6 @@ innobase_init(void) DBUG_RETURN(FALSE); error: have_innodb= SHOW_OPTION_DISABLED; // If we couldn't use handler - innobase_hton.state= SHOW_OPTION_DISABLED; DBUG_RETURN(TRUE); } diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 030f5881861..5451447ec43 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -4837,7 +4837,6 @@ ndbcluster_init_error: delete g_ndb_cluster_connection; g_ndb_cluster_connection= NULL; have_ndbcluster= SHOW_OPTION_DISABLED; // If we couldn't use handler - ndbcluster_hton.state= SHOW_OPTION_DISABLED; DBUG_RETURN(TRUE); } diff --git a/sql/handler.cc b/sql/handler.cc index 211da341da1..d449a0b90f2 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -25,37 +25,87 @@ #include "ha_heap.h" #include "ha_myisam.h" #include "ha_myisammrg.h" + + +/* + We have dummy hanldertons in case the handler has not been compiled + in. This will be removed in 5.1. +*/ #ifdef HAVE_BERKELEY_DB #include "ha_berkeley.h" extern handlerton berkeley_hton; +#else +handlerton berkeley_hton = { "BerkeleyDB", SHOW_OPTION_NO, + "Supports transactions and page-level locking", DB_TYPE_BERKELEY_DB, NULL, + 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, HTON_NO_FLAGS }; #endif #ifdef HAVE_BLACKHOLE_DB #include "ha_blackhole.h" extern handlerton blackhole_hton; +#else +handlerton blackhole_hton = { "BLACKHOLE", SHOW_OPTION_NO, + "/dev/null storage engine (anything you write to it disappears)", + DB_TYPE_BLACKHOLE_DB, NULL, 0, 0, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + HTON_NO_FLAGS }; #endif #ifdef HAVE_EXAMPLE_DB #include "examples/ha_example.h" extern handlerton example_hton; +#else +handlerton example_hton = { "EXAMPLE", SHOW_OPTION_NO, + "Example storage engine", + DB_TYPE_EXAMPLE_DB, NULL, 0, 0, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + HTON_NO_FLAGS }; #endif #ifdef HAVE_ARCHIVE_DB #include "ha_archive.h" extern handlerton archive_hton; +#else +handlerton archive_hton = { "ARCHIVE", SHOW_OPTION_NO, + "Archive storage engine", DB_TYPE_ARCHIVE_DB, NULL, 0, 0, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + HTON_NO_FLAGS }; #endif #ifdef HAVE_CSV_DB #include "examples/ha_tina.h" extern handlerton tina_hton; +#else +handlerton tina_hton = { "CSV", SHOW_OPTION_NO, "CSV storage engine", + DB_TYPE_CSV_DB, NULL, 0, 0, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + HTON_NO_FLAGS }; #endif #ifdef HAVE_INNOBASE_DB #include "ha_innodb.h" extern handlerton innobase_hton; +#else +handlerton innobase_hton = { "InnoDB", SHOW_OPTION_NO, + "Supports transactions, row-level locking, and foreign keys", + DB_TYPE_INNODB, NULL, 0, 0, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + HTON_NO_FLAGS }; #endif #ifdef HAVE_NDBCLUSTER_DB #include "ha_ndbcluster.h" extern handlerton ndbcluster_hton; +#else +handlerton ndbcluster_hton = { "ndbcluster", SHOW_OPTION_NO, + "Clustered, fault-tolerant, memory-based tables", + DB_TYPE_NDBCLUSTER, NULL, 0, 0, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + HTON_NO_FLAGS }; #endif #ifdef HAVE_FEDERATED_DB #include "ha_federated.h" extern handlerton federated_hton; +#else +handlerton federated_hton = { "FEDERATED", SHOW_OPTION_NO, + "Federated MySQL storage engine", DB_TYPE_FEDERATED_DB, NULL, 0, 0, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + HTON_NO_FLAGS }; #endif #include #include @@ -65,14 +115,18 @@ extern handlerton myisammrg_hton; extern handlerton heap_hton; extern handlerton binlog_hton; +/* + Obsolete +*/ +handlerton isam_hton = { "ISAM", SHOW_OPTION_NO, "Obsolete storage engine", + DB_TYPE_ISAM, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, HTON_NO_FLAGS }; - /* static functions defined in this file */ + +/* static functions defined in this file */ static SHOW_COMP_OPTION have_yes= SHOW_OPTION_YES; -/* list of all available storage engines (of their handlertons) */ -handlerton *handlertons[MAX_HA]={0}; - /* number of entries in handlertons[] */ ulong total_ha; /* number of storage engines (from handlertons[]) that support 2pc */ @@ -87,31 +141,17 @@ handlerton *sys_table_types[]= { &myisam_hton, &heap_hton, -#ifdef HAVE_INNOBASE_DB &innobase_hton, -#endif -#ifdef HAVE_BERKELEY_DB &berkeley_hton, -#endif -#ifdef HAVE_BLACKHOLE_DB &blackhole_hton, -#endif -#ifdef HAVE_EXAMPLE_DB &example_hton, -#endif -#ifdef HAVE_ARCHIVE_DB &archive_hton, -#endif -#ifdef HAVE_CSV_DB &tina_hton, -#endif -#ifdef HAVE_NDBCLUSTER_DB &ndbcluster_hton, -#endif -#ifdef HAVE_FEDERATED_DB &federated_hton, -#endif &myisammrg_hton, + &binlog_hton, + &isam_hton, NULL }; @@ -183,12 +223,12 @@ const char *ha_get_storage_engine(enum db_type db_type) bool ha_check_storage_engine_flag(enum db_type db_type, uint32 flag) { - show_table_type_st *types; - for (types= sys_table_types; types->type; types++) + handlerton **types; + for (types= sys_table_types; *types; types++) { - if (db_type == types->db_type) + if (db_type == (*types)->db_type) { - if (types->ht->flags & flag) + if ((*types)->flags & flag) return TRUE; else return FALSE; @@ -409,7 +449,6 @@ static inline void ha_was_inited_ok(handlerton **ht) int ha_init() { int error= 0; - handlerton **ht= handlertons; handlerton **types; show_table_alias_st *table_alias; total_ha= savepoint_alloc_size= 0; @@ -418,38 +457,16 @@ int ha_init() return 1; /* - This will go away soon. + We now initialize everything here. */ for (types= sys_table_types; *types; types++) { - /* - FUTURE - - We need to collapse sys_table_types and handlertons variables into - one variable. - */ - *ht= *types; - ht++; - if ((*types)->init) - { - if (!(*types)->init()) - ha_was_inited_ok(types); - } + if (!(*types)->init || !(*types)->init()) + ha_was_inited_ok(types); + else + (*types)->state= SHOW_OPTION_DISABLED; } - if (opt_bin_log) - { - if (0) // Should fail until binlog is a bit more se like - { - mysql_bin_log.close(LOG_CLOSE_INDEX); // Never used - opt_bin_log= 0; // Never used - error= 1; // Never used - } - else - { - *types= &binlog_hton; - ha_was_inited_ok(types); - } - } DBUG_ASSERT(total_ha < MAX_HA); /* Check if there is a transaction-capable storage engine besides the @@ -521,9 +538,10 @@ void ha_drop_database(char* path) /* don't bother to rollback here, it's done already */ void ha_close_connection(THD* thd) { - for (uint i=0; i < total_ha; i++) - if (thd->ha_data[i]) - (*handlertons[i]->close_connection)(thd); + handlerton **types; + for (types= sys_table_types; *types; types++) + if (thd->ha_data[(*types)->slot]) + (*types)->close_connection(thd); } /* ======================================================================== @@ -834,13 +852,13 @@ int ha_autocommit_or_rollback(THD *thd, int error) int ha_commit_or_rollback_by_xid(XID *xid, bool commit) { - handlerton **ht= handlertons, **end_ht=ht+total_ha; + handlerton **types; int res= 1; - for ( ; ht < end_ht ; ht++) - if ((*ht)->recover) + for (types= sys_table_types; *types; types++) + if ((*types)->state == SHOW_OPTION_YES && (*types)->recover) res= res && - (*(commit ? (*ht)->commit_by_xid : (*ht)->rollback_by_xid))(xid); + (*(commit ? (*types)->commit_by_xid : (*types)->rollback_by_xid))(xid); return res; } @@ -919,7 +937,7 @@ static char* xid_to_str(char *buf, XID *xid) int ha_recover(HASH *commit_list) { int len, got, found_foreign_xids=0, found_my_xids=0; - handlerton **ht= handlertons, **end_ht=ht+total_ha; + handlerton **types; XID *list=0; bool dry_run=(commit_list==0 && tc_heuristic_recover==0); DBUG_ENTER("ha_recover"); @@ -955,14 +973,14 @@ int ha_recover(HASH *commit_list) DBUG_RETURN(1); } - for ( ; ht < end_ht ; ht++) + for (types= sys_table_types; *types; types++) { - if (!(*ht)->recover) + if ((*types)->state != SHOW_OPTION_YES || !(*types)->recover) continue; - while ((got=(*(*ht)->recover)(list, len)) > 0 ) + while ((got=(*(*types)->recover)(list, len)) > 0 ) { sql_print_information("Found %d prepared transaction(s) in %s", - got, (*ht)->name); + got, (*types)->name); for (int i=0; i < got; i ++) { my_xid x=list[i].get_my_xid(); @@ -990,7 +1008,7 @@ int ha_recover(HASH *commit_list) char buf[XIDDATASIZE*4+6]; // see xid_to_str sql_print_information("commit xid %s", xid_to_str(buf, list+i)); #endif - (*(*ht)->commit_by_xid)(list+i); + (*(*types)->commit_by_xid)(list+i); } else { @@ -998,7 +1016,7 @@ int ha_recover(HASH *commit_list) char buf[XIDDATASIZE*4+6]; // see xid_to_str sql_print_information("rollback xid %s", xid_to_str(buf, list+i)); #endif - (*(*ht)->rollback_by_xid)(list+i); + (*(*types)->rollback_by_xid)(list+i); } } if (got < len) diff --git a/sql/handler.h b/sql/handler.h index 18c39de28e6..81048c0730e 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -854,7 +854,6 @@ extern handlerton *sys_table_types[]; extern const char *ha_row_type[]; extern TYPELIB tx_isolation_typelib; extern TYPELIB myisam_stats_method_typelib; -extern handlerton *handlertons[MAX_HA]; extern ulong total_ha, total_ha_2pc; /* Wrapper functions */ From ee6e983c5ce9a33a29d5b30391660c67c3de6653 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Oct 2005 14:42:02 +0200 Subject: [PATCH 213/225] Move -ansi from global_warnings to cxx_warnings --- BUILD/SETUP.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 64be7a34f95..f479d92718c 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -48,10 +48,10 @@ AM_MAKEFLAGS="-j 4" # The following warning flag will give too many warnings: # -Wshadow -Wunused -Winline (The later isn't usable in C++ as # __attribute()__ doesn't work with gnu C++) -global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -ansi" +global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings" #debug_extra_warnings="-Wuninitialized" c_warnings="$global_warnings -Wunused" -cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" +cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -ansi" base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine" base_max_no_ndb_configs="--with-innodb --with-berkeley-db --without-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine" max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --with-openssl --with-embedded-server --with-big-tables" From ba9508151070a12a3699b45369965db9ef5feff2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Oct 2005 17:04:20 +0200 Subject: [PATCH 214/225] sql_table.cc, table.cc, table.h: fixed CHECKSUM TABLE to be independent from last - undefined in InnoDB - bits in the null bitmask bug#13710 sql/table.h: fixed CHECKSUM TABLE to be independent from last - undefined in InnoDB - bits in the null bitmask bug#13710 sql/table.cc: fixed CHECKSUM TABLE to be independent from last - undefined in InnoDB - bits in the null bitmask bug#13710 sql/sql_table.cc: fixed CHECKSUM TABLE to be independent from last - undefined in InnoDB - bits in the null bitmask bug#13710 --- sql/sql_table.cc | 14 +++++++++----- sql/table.cc | 1 + sql/table.h | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index dba4168343a..3f0dffea110 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4100,6 +4100,7 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, HA_CHECK_OPT *check_opt) { /* calculating table's checksum */ ha_checksum crc= 0; + uchar null_mask=256 - (1 << t->s->last_null_bit_pos); /* InnoDB must be told explicitly to retrieve all columns, because this function does not set field->query_id in the columns to the @@ -4120,9 +4121,12 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, HA_CHECK_OPT *check_opt) continue; break; } - if (t->record[0] != (byte*) t->field[0]->ptr) - row_crc= my_checksum(row_crc, t->record[0], - ((byte*) t->field[0]->ptr) - t->record[0]); + if (t->s->null_bytes) + { + /* fix undefined null bits */ + t->record[0][t->s->null_bytes-1] |= null_mask; + row_crc= my_checksum(row_crc, t->record[0], t->s->null_bytes); + } for (uint i= 0; i < t->s->fields; i++ ) { @@ -4166,9 +4170,9 @@ static bool check_engine(THD *thd, const char *table_name, enum db_type *new_engine) { enum db_type req_engine= *new_engine; - bool no_substitution= + bool no_substitution= test(thd->variables.sql_mode & MODE_NO_ENGINE_SUBSTITUTION); - if ((*new_engine= + if ((*new_engine= ha_checktype(thd, req_engine, no_substitution, 1)) == DB_TYPE_UNKNOWN) return TRUE; diff --git a/sql/table.cc b/sql/table.cc index 982d5e7ddc9..b605333e011 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -874,6 +874,7 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, /* the correct null_bytes can now be set, since bitfields have been taken into account */ share->null_bytes= null_pos - (uchar*) outparam->null_flags + (null_bit_pos + 7) / 8; + share->last_null_bit_pos= null_bit_pos; /* The table struct is now initialized; Open the table */ error=2; diff --git a/sql/table.h b/sql/table.h index b01d774bf10..44fe69e9397 100644 --- a/sql/table.h +++ b/sql/table.h @@ -141,7 +141,7 @@ typedef struct st_table_share enum tmp_table_type tmp_table; uint blob_ptr_size; /* 4 or 8 */ - uint null_bytes; + uint null_bytes, last_null_bit_pos; uint key_length; /* Length of table_cache_key */ uint fields; /* Number of fields */ uint rec_buff_length; /* Size of table->record[] buffer */ From dee0ea4b6c93ab7550e39293655f1b3b65cc3b7c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Oct 2005 18:20:57 +0300 Subject: [PATCH 215/225] Some fixes including implicit declaration of a function, using wrong type in assignment etc. cmd-line-utils/readline/complete.c: Fixed problem with implicitely defining wcwidth() in case when compiling with icc. cmd-line-utils/readline/display.c: Fixed problem with implicitely defining wcwidth() in case when compiling with icc. cmd-line-utils/readline/mbutil.c: Fixed problem with implicitely defining wcwidth() in case when compiling with icc. server-tools/instance-manager/protocol.cc: Fixed some types from int to char. Made ERROR_PACKET_CODE static global variable in this file. sql/log.cc: Removed warning of unused goto when not in debug mode. --- cmd-line-utils/readline/complete.c | 10 ++++++++++ cmd-line-utils/readline/display.c | 9 +++++++++ cmd-line-utils/readline/mbutil.c | 10 ++++++++++ server-tools/instance-manager/protocol.cc | 5 ++--- sql/log.cc | 2 ++ 5 files changed, 33 insertions(+), 3 deletions(-) diff --git a/cmd-line-utils/readline/complete.c b/cmd-line-utils/readline/complete.c index 5879100e0a6..393700b51e8 100644 --- a/cmd-line-utils/readline/complete.c +++ b/cmd-line-utils/readline/complete.c @@ -24,6 +24,12 @@ #include "config_readline.h" #include + +/* To get SuSE 9.3 to define wcwidth() (in wchar.h) */ +#ifndef __USE_XOPEN +#define __USE_XOPEN +#endif + #include #if defined (HAVE_SYS_FILE_H) @@ -56,6 +62,10 @@ extern int errno; #include "rldefs.h" #include "rlmbutil.h" +#ifdef HAVE_WCHAR_H +#include +#endif + /* Some standard library routines. */ #include "readline.h" #include "xmalloc.h" diff --git a/cmd-line-utils/readline/display.c b/cmd-line-utils/readline/display.c index cab76c0da81..372feeaffea 100644 --- a/cmd-line-utils/readline/display.c +++ b/cmd-line-utils/readline/display.c @@ -25,6 +25,11 @@ #include +/* To get SuSE 9.3 to define wcwidth() (in wchar.h) */ +#ifndef __USE_XOPEN +#define __USE_XOPEN +#endif + #if defined (HAVE_UNISTD_H) # include #endif /* HAVE_UNISTD_H */ @@ -43,6 +48,10 @@ #include "rldefs.h" #include "rlmbutil.h" +#ifdef HAVE_WCHAR_H +#include +#endif + /* Termcap library stuff. */ #include "tcap.h" diff --git a/cmd-line-utils/readline/mbutil.c b/cmd-line-utils/readline/mbutil.c index c88e9485f39..5cda8f3732d 100644 --- a/cmd-line-utils/readline/mbutil.c +++ b/cmd-line-utils/readline/mbutil.c @@ -24,6 +24,12 @@ #include "config_readline.h" #include + +/* To get SuSE 9.3 to define wcwidth() (in wchar.h) */ +#ifndef __USE_XOPEN +#define __USE_XOPEN +#endif + #include #include "posixjmp.h" @@ -44,6 +50,10 @@ #include "rldefs.h" #include "rlmbutil.h" +#ifdef HAVE_WCHAR_H +#include +#endif + #if defined (TIOCSTAT_IN_SYS_IOCTL) # include #endif /* TIOCSTAT_IN_SYS_IOCTL */ diff --git a/server-tools/instance-manager/protocol.cc b/server-tools/instance-manager/protocol.cc index e14449746fd..73e07f993ae 100644 --- a/server-tools/instance-manager/protocol.cc +++ b/server-tools/instance-manager/protocol.cc @@ -23,6 +23,7 @@ static char eof_buff[1]= { (char) 254 }; /* Marker for end of fields */ +static const char ERROR_PACKET_CODE= (char) 255; int net_send_ok(struct st_net *net, unsigned long connection_id, @@ -74,7 +75,6 @@ int net_send_error(struct st_net *net, uint sql_errno) MYSQL_ERRMSG_SIZE]; // message char *pos= buff; - const int ERROR_PACKET_CODE= 255; *pos++= ERROR_PACKET_CODE; int2store(pos, sql_errno); pos+= 2; @@ -95,7 +95,6 @@ int net_send_error_323(struct st_net *net, uint sql_errno) MYSQL_ERRMSG_SIZE]; // message char *pos= buff; - const int ERROR_PACKET_CODE= 255; *pos++= ERROR_PACKET_CODE; int2store(pos, sql_errno); pos+= 2; @@ -195,7 +194,7 @@ int send_fields(struct st_net *net, LIST *fields) int2store(send_buff.buffer + position, 1); /* charsetnr */ int4store(send_buff.buffer + position + 2, field->length); /* field length */ - send_buff.buffer[position+6]= (uint) FIELD_TYPE_STRING; /* type */ + send_buff.buffer[position+6]= (char) FIELD_TYPE_STRING; /* type */ int2store(send_buff.buffer + position + 7, 0); /* flags */ send_buff.buffer[position + 9]= (char) 0; /* decimals */ send_buff.buffer[position + 10]= 0; diff --git a/sql/log.cc b/sql/log.cc index 6e372938752..8d9185a8850 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1850,7 +1850,9 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event) if (commit_event->write(&log_file)) goto err; +#ifndef DBUG_OFF DBUG_skip_commit: +#endif if (flush_and_sync()) goto err; DBUG_EXECUTE_IF("half_binlogged_transaction", abort();); From b2fa7d16c2df3c9212f52c29e549b7e893fc8662 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Oct 2005 19:52:12 +0300 Subject: [PATCH 216/225] Fixed several boolean type options used in my_long_options[]. Some options were declared as 'bool', but since those are being handled in my_getopt.c, bool can be machine dependent. To make sure it works in all circumstances, the type should be my_bool for C (not C++) programs. sql/mysql_priv.h: Fixed some bools to my_bools. sql/mysqld.cc: Changed several bools to my_bools. sql/slave.cc: Changed bool to my_bool. sql/slave.h: Changed bool to my_bool. --- sql/mysql_priv.h | 5 +++-- sql/mysqld.cc | 9 +++++---- sql/slave.cc | 3 ++- sql/slave.h | 3 ++- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 73510717f7f..b1df72c9a88 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1155,12 +1155,13 @@ extern my_bool relay_log_purge, opt_innodb_safe_binlog, opt_innodb; extern uint test_flags,select_errors,ha_open_options; extern uint protocol_version, mysqld_port, dropping_tables; extern uint delay_key_write_options, lower_case_table_names; -extern bool opt_endinfo, using_udf_functions, locked_in_memory; +extern bool opt_endinfo, using_udf_functions; +extern my_bool locked_in_memory; extern bool opt_using_transactions, mysqld_embedded; extern bool using_update_log, opt_large_files, server_id_supplied; extern bool opt_log, opt_update_log, opt_bin_log, opt_slow_log, opt_error_log; extern bool opt_disable_networking, opt_skip_show_db; -extern bool opt_character_set_client_handshake; +extern my_bool opt_character_set_client_handshake; extern bool volatile abort_loop, shutdown_in_progress, grant_option; extern bool mysql_proc_table_exists; extern uint volatile thread_count, thread_running, global_read_lock; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index cb7939c3750..904b5ec78be 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -294,7 +294,7 @@ bool opt_large_files= sizeof(my_off_t) > 4; /* Used with --help for detailed option */ -static bool opt_help= 0, opt_verbose= 0; +static my_bool opt_help= 0, opt_verbose= 0; arg_cmp_func Arg_comparator::comparator_matrix[5][2] = {{&Arg_comparator::compare_string, &Arg_comparator::compare_e_string}, @@ -338,9 +338,10 @@ static my_bool opt_sync_bdb_logs; bool opt_log, opt_update_log, opt_bin_log, opt_slow_log; bool opt_error_log= IF_WIN(1,0); bool opt_disable_networking=0, opt_skip_show_db=0; -bool opt_character_set_client_handshake= 1; +my_bool opt_character_set_client_handshake= 1; bool server_id_supplied = 0; -bool opt_endinfo,using_udf_functions, locked_in_memory; +bool opt_endinfo,using_udf_functions; +my_bool locked_in_memory; bool opt_using_transactions, using_update_log; bool volatile abort_loop; bool volatile shutdown_in_progress, grant_option; @@ -572,7 +573,7 @@ Query_cache query_cache; #endif #ifdef HAVE_SMEM char *shared_memory_base_name= default_shared_memory_base_name; -bool opt_enable_shared_memory; +my_bool opt_enable_shared_memory; HANDLE smem_event_connect_request= 0; #endif diff --git a/sql/slave.cc b/sql/slave.cc index 092fb40d9d9..b1763187d04 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -40,7 +40,8 @@ HASH replicate_do_table, replicate_ignore_table; DYNAMIC_ARRAY replicate_wild_do_table, replicate_wild_ignore_table; bool do_table_inited = 0, ignore_table_inited = 0; bool wild_do_table_inited = 0, wild_ignore_table_inited = 0; -bool table_rules_on= 0, replicate_same_server_id; +bool table_rules_on= 0; +my_bool replicate_same_server_id; ulonglong relay_log_space_limit = 0; /* diff --git a/sql/slave.h b/sql/slave.h index c41234ab2ed..f8e784bfd17 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -581,7 +581,8 @@ extern HASH replicate_do_table, replicate_ignore_table; extern DYNAMIC_ARRAY replicate_wild_do_table, replicate_wild_ignore_table; extern bool do_table_inited, ignore_table_inited, wild_do_table_inited, wild_ignore_table_inited; -extern bool table_rules_on, replicate_same_server_id; +extern bool table_rules_on; +extern my_bool replicate_same_server_id; extern int disconnect_slave_event_count, abort_slave_event_count ; From 463d86a9bf0e50bdff59e2581d480fc69ce8e6cc Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Oct 2005 20:22:39 +0300 Subject: [PATCH 217/225] Changed __USE_XOPEN to _XOPEN_SOURCE and got rid of some extra code. --- cmd-line-utils/readline/complete.c | 11 ++++------- cmd-line-utils/readline/display.c | 11 ++++------- cmd-line-utils/readline/mbutil.c | 11 ++++------- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/cmd-line-utils/readline/complete.c b/cmd-line-utils/readline/complete.c index 393700b51e8..41ea22d815e 100644 --- a/cmd-line-utils/readline/complete.c +++ b/cmd-line-utils/readline/complete.c @@ -21,14 +21,15 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE 500 +#endif + #include "config_readline.h" #include /* To get SuSE 9.3 to define wcwidth() (in wchar.h) */ -#ifndef __USE_XOPEN -#define __USE_XOPEN -#endif #include @@ -62,10 +63,6 @@ extern int errno; #include "rldefs.h" #include "rlmbutil.h" -#ifdef HAVE_WCHAR_H -#include -#endif - /* Some standard library routines. */ #include "readline.h" #include "xmalloc.h" diff --git a/cmd-line-utils/readline/display.c b/cmd-line-utils/readline/display.c index 372feeaffea..06eaa5e4be2 100644 --- a/cmd-line-utils/readline/display.c +++ b/cmd-line-utils/readline/display.c @@ -21,14 +21,15 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE 500 +#endif + #include "config_readline.h" #include /* To get SuSE 9.3 to define wcwidth() (in wchar.h) */ -#ifndef __USE_XOPEN -#define __USE_XOPEN -#endif #if defined (HAVE_UNISTD_H) # include @@ -48,10 +49,6 @@ #include "rldefs.h" #include "rlmbutil.h" -#ifdef HAVE_WCHAR_H -#include -#endif - /* Termcap library stuff. */ #include "tcap.h" diff --git a/cmd-line-utils/readline/mbutil.c b/cmd-line-utils/readline/mbutil.c index 5cda8f3732d..284ea63aae4 100644 --- a/cmd-line-utils/readline/mbutil.c +++ b/cmd-line-utils/readline/mbutil.c @@ -21,14 +21,15 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE 500 +#endif + #include "config_readline.h" #include /* To get SuSE 9.3 to define wcwidth() (in wchar.h) */ -#ifndef __USE_XOPEN -#define __USE_XOPEN -#endif #include #include "posixjmp.h" @@ -50,10 +51,6 @@ #include "rldefs.h" #include "rlmbutil.h" -#ifdef HAVE_WCHAR_H -#include -#endif - #if defined (TIOCSTAT_IN_SYS_IOCTL) # include #endif /* TIOCSTAT_IN_SYS_IOCTL */ From 04af49a97f06e0ab09a9d46a26d33d72f01b0ab2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Oct 2005 21:37:50 +0200 Subject: [PATCH 218/225] innodb.result: somehow it didn't get into the previous changeset mysql-test/r/innodb.result: somehow it didn't get into the previous changeset --- mysql-test/r/innodb.result | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index f634d0fc98b..a66259ff5f4 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -2625,11 +2625,11 @@ test.t1 1531596814 insert into t1 values(3); checksum table t1; Table Checksum -test.t1 2605035534 +test.t1 1531596814 commit; checksum table t1; Table Checksum -test.t1 127268899 +test.t1 2050879373 commit; drop table t1; create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; @@ -2642,7 +2642,7 @@ set autocommit=1; insert into t1 values(3); checksum table t1; Table Checksum -test.t1 127268899 +test.t1 2050879373 drop table t1; create table t1 (col1 integer primary key, col2 integer) engine=innodb; insert t1 values (1,100); From 625c9582e2f3ba8b63c86561da02e5d1e7621586 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Oct 2005 01:08:22 +0400 Subject: [PATCH 219/225] Make mysql_fix_privilege_tables.sh not dependent on the current directory. scripts/mysql_fix_privilege_tables.sh: Make the script not dependent on the current directory. --- scripts/mysql_fix_privilege_tables.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index d080b68b268..073964d4bde 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -97,9 +97,11 @@ fi # Find where 'mysql' command is located +dirname=`dirname "$0"` + if test -z "$bindir" then - for i in @bindir@ $basedir/bin client + for i in @bindir@ $basedir/bin "$dirname/../client" do if test -f $i/mysql then @@ -109,6 +111,13 @@ then done fi +if test -z "$bindir" +then + echo "Could not find MySQL command-line client (mysql)." + echo "Please use --basedir to specify the directory where MySQL is installed." + exit 1 +fi + cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host" if test ! -z "$password" ; then cmd="$cmd --password=$password" @@ -128,7 +137,7 @@ fi # Find where first mysql_fix_privilege_tables.sql is located for i in $basedir/support-files $basedir/share $basedir/share/mysql \ - $basedir/scripts $pkgdatadir . ./scripts + $basedir/scripts $pkgdatadir . "$dirname" do if test -f $i/$file then From 3410309f26553048c17f7ca2d269dfdc72a150ad Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Oct 2005 14:37:42 +0200 Subject: [PATCH 220/225] Revert BUILD/SETUP.sh: Remove -ansi --- BUILD/SETUP.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index f479d92718c..598aaaa80ae 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -51,7 +51,7 @@ AM_MAKEFLAGS="-j 4" global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings" #debug_extra_warnings="-Wuninitialized" c_warnings="$global_warnings -Wunused" -cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -ansi" +cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine" base_max_no_ndb_configs="--with-innodb --with-berkeley-db --without-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine" max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --with-openssl --with-embedded-server --with-big-tables" From 07172cabdf7f36cbbdad2d48c1f12d9531a452df Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Oct 2005 16:38:53 +0200 Subject: [PATCH 221/225] Bug#13143 - formatID should not affect XID's uniqueness --- mysql-test/r/xa.result | 2 ++ mysql-test/t/xa.test | 2 ++ sql/handler.h | 10 +++++++++- sql/sql_class.cc | 12 ++++++------ 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/xa.result b/mysql-test/r/xa.result index f3d7e151628..ae5407ce409 100644 --- a/mysql-test/r/xa.result +++ b/mysql-test/r/xa.result @@ -24,6 +24,8 @@ insert t1 values (30); xa end 'testa','testb'; xa start 'testa','testb'; ERROR XAE08: XAER_DUPID: The XID already exists +xa start 'testa','testb', 123; +ERROR XAE08: XAER_DUPID: The XID already exists xa start 0x7465737462, 0x2030405060, 0xb; insert t1 values (40); xa end 'testb',' 0@P`',11; diff --git a/mysql-test/t/xa.test b/mysql-test/t/xa.test index 1347fd05415..f059f8f9bb5 100644 --- a/mysql-test/t/xa.test +++ b/mysql-test/t/xa.test @@ -33,6 +33,8 @@ connection con1; --error 1440 xa start 'testa','testb'; +--error 1440 +xa start 'testa','testb', 123; # gtrid [ , bqual [ , formatID ] ] xa start 0x7465737462, 0x2030405060, 0xb; diff --git a/sql/handler.h b/sql/handler.h index 664427fe5c4..d58d28ad7b0 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -228,7 +228,7 @@ struct xid_t { char data[XIDDATASIZE]; // not \0-terminated ! bool eq(struct xid_t *xid) - { return !memcmp(this, xid, length()); } + { return eq(xid->gtrid_length, xid->bqual_length, xid->data); } bool eq(long g, long b, const char *d) { return g == gtrid_length && b == bqual_length && !memcmp(d, data, g+b); } void set(struct xid_t *xid) @@ -276,6 +276,14 @@ struct xid_t { return sizeof(formatID)+sizeof(gtrid_length)+sizeof(bqual_length)+ gtrid_length+bqual_length; } + byte *key() + { + return (byte *)>rid_length; + } + uint key_length() + { + return sizeof(gtrid_length)+sizeof(bqual_length)+gtrid_length+bqual_length; + } }; typedef struct xid_t XID; diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 2917626ff35..fc7ea6a2794 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1982,8 +1982,8 @@ HASH xid_cache; static byte *xid_get_hash_key(const byte *ptr,uint *length, my_bool not_used __attribute__((unused))) { - *length=((XID_STATE*)ptr)->xid.length(); - return (byte *)&((XID_STATE*)ptr)->xid; + *length=((XID_STATE*)ptr)->xid.key_length(); + return ((XID_STATE*)ptr)->xid.key(); } static void xid_free_hash (void *ptr) @@ -2011,7 +2011,7 @@ void xid_cache_free() XID_STATE *xid_cache_search(XID *xid) { pthread_mutex_lock(&LOCK_xid_cache); - XID_STATE *res=(XID_STATE *)hash_search(&xid_cache, (byte *)xid, xid->length()); + XID_STATE *res=(XID_STATE *)hash_search(&xid_cache, xid->key(), xid->key_length()); pthread_mutex_unlock(&LOCK_xid_cache); return res; } @@ -2022,7 +2022,7 @@ bool xid_cache_insert(XID *xid, enum xa_states xa_state) XID_STATE *xs; my_bool res; pthread_mutex_lock(&LOCK_xid_cache); - if (hash_search(&xid_cache, (byte *)xid, xid->length())) + if (hash_search(&xid_cache, xid->key(), xid->key_length())) res=0; else if (!(xs=(XID_STATE *)my_malloc(sizeof(*xs), MYF(MY_WME)))) res=1; @@ -2041,8 +2041,8 @@ bool xid_cache_insert(XID *xid, enum xa_states xa_state) bool xid_cache_insert(XID_STATE *xid_state) { pthread_mutex_lock(&LOCK_xid_cache); - DBUG_ASSERT(hash_search(&xid_cache, (byte *)&xid_state->xid, - xid_state->xid.length())==0); + DBUG_ASSERT(hash_search(&xid_cache, xid_state->xid.key(), + xid_state->xid.key_length())==0); my_bool res=my_hash_insert(&xid_cache, (byte*)xid_state); pthread_mutex_unlock(&LOCK_xid_cache); return res; From ab2cd8689dcb31eded0f7c056ec4cbca9922b46d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Oct 2005 10:06:31 -0700 Subject: [PATCH 222/225] Fail when two messages exist for the same language for an error in the server error messages file. (Bug #13071) extra/comp_err.c: Fail when two messages for the same language are given for an error --- extra/comp_err.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/extra/comp_err.c b/extra/comp_err.c index b322be2b8ed..d0e387dcd35 100644 --- a/extra/comp_err.c +++ b/extra/comp_err.c @@ -131,7 +131,8 @@ static struct languages *parse_charset_string(char *str); static struct errors *parse_error_string(char *ptr, int er_count); static struct message *parse_message_string(struct message *new_message, char *str); -static struct message *find_message(struct errors *err, const char *lang); +static struct message *find_message(struct errors *err, const char *lang, + my_bool no_default); static int parse_input_file(const char *file_name, struct errors **top_error, struct languages **top_language); static int get_options(int *argc, char ***argv); @@ -305,7 +306,7 @@ static int create_sys_files(struct languages *lang_head, for (tmp_error= error_head; tmp_error; tmp_error= tmp_error->next_error) { /* dealing with messages */ - tmp= find_message(tmp_error, tmp_lang->lang_short_name); + tmp= find_message(tmp_error, tmp_lang->lang_short_name, FALSE); if (!tmp) { @@ -450,6 +451,13 @@ static int parse_input_file(const char *file_name, struct errors **top_error, current_error->er_name); DBUG_RETURN(0); } + if (find_message(current_error, current_message.lang_short_name, TRUE)) + { + fprintf(stderr, "Duplicate message string for error '%s'" + " in language '%s'\n", + current_error->er_name, current_message.lang_short_name); + DBUG_RETURN(0); + } if (insert_dynamic(¤t_error->msg, (byte *) & current_message)) DBUG_RETURN(0); continue; @@ -556,11 +564,19 @@ static char *parse_default_language(char *str) /* - For given error, finds message in given language; if does not exist, - returns english. -*/ + Find the message in a particular language -static struct message *find_message(struct errors *err, const char *lang) + SYNOPSIS + find_message() + err Error to find message for + lang Language of message to find + no_default Don't return default (English) if does not exit + + RETURN VALUE + Returns the message structure if one is found, or NULL if not. +*/ +static struct message *find_message(struct errors *err, const char *lang, + my_bool no_default) { struct message *tmp, *return_val= 0; uint i, count; @@ -579,7 +595,7 @@ static struct message *find_message(struct errors *err, const char *lang) return_val= tmp; } } - DBUG_RETURN(return_val); + DBUG_RETURN(no_default ? NULL : return_val); } From f1d7899e7067a030231d39ab480dea89e34094a3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Oct 2005 19:36:20 +0200 Subject: [PATCH 223/225] sql_table.cc: fixed CHECKSUM TABLE to be independent from the first 'deleted' bit in the null bitmask (undefined in the InnoDB) bug#13710 sql/sql_table.cc: fixed CHECKSUM TABLE to be independent from the first 'deleted' bit in the null bitmask (undefined in the InnoDB) bug#13710 --- sql/sql_table.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 3f0dffea110..0bb4a0bbaed 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4125,6 +4125,9 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, HA_CHECK_OPT *check_opt) { /* fix undefined null bits */ t->record[0][t->s->null_bytes-1] |= null_mask; + if (!(t->s->db_create_options & HA_OPTION_PACK_RECORD)) + t->record[0][0] |= 1; + row_crc= my_checksum(row_crc, t->record[0], t->s->null_bytes); } From fcc644fff735c97d17d6a525a14fd1bd310b26c9 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Oct 2005 19:58:16 +0200 Subject: [PATCH 224/225] Bug#12935 Local and XA transactions not mutually exclusive --- mysql-test/r/xa.result | 12 ++++++++++-- mysql-test/t/xa.test | 12 ++++++++++++ sql/share/errmsg.txt | 3 ++- sql/sql_parse.cc | 18 ++++++++++++++++++ 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/xa.result b/mysql-test/r/xa.result index ae5407ce409..5fb03d2378e 100644 --- a/mysql-test/r/xa.result +++ b/mysql-test/r/xa.result @@ -9,10 +9,10 @@ select * from t1; a xa start 'test2'; xa start 'test-bad'; -ERROR XAE07: XAER_RMFAIL: The command cannot be executed in the ACTIVE state +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state insert t1 values (20); xa prepare 'test2'; -ERROR XAE07: XAER_RMFAIL: The command cannot be executed in the ACTIVE state +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state xa end 'test2'; xa prepare 'test2'; xa commit 'test2'; @@ -21,7 +21,13 @@ a 20 xa start 'testa','testb'; insert t1 values (30); +commit; +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state xa end 'testa','testb'; +begin; +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state +create table t2 (a int); +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state xa start 'testa','testb'; ERROR XAE08: XAER_DUPID: The XID already exists xa start 'testa','testb', 123; @@ -30,6 +36,8 @@ xa start 0x7465737462, 0x2030405060, 0xb; insert t1 values (40); xa end 'testb',' 0@P`',11; xa prepare 'testb',0x2030405060,11; +start transaction; +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state xa recover; formatID gtrid_length bqual_length data 11 5 5 testb 0@P` diff --git a/mysql-test/t/xa.test b/mysql-test/t/xa.test index f059f8f9bb5..92405bac137 100644 --- a/mysql-test/t/xa.test +++ b/mysql-test/t/xa.test @@ -26,8 +26,17 @@ select * from t1; xa start 'testa','testb'; insert t1 values (30); + +--error 1399 +commit; + xa end 'testa','testb'; +--error 1399 +begin; +--error 1399 +create table t2 (a int); + connect (con1,localhost,,,); connection con1; @@ -42,6 +51,9 @@ insert t1 values (40); xa end 'testb',' 0@P`',11; xa prepare 'testb',0x2030405060,11; +--error 1399 +start transaction; + xa recover; # uncomment the line below when binlog will be able to prepare diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index d3964fe6e52..10f0d0691d1 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5311,7 +5311,8 @@ ER_XAER_NOTA XAE04 ER_XAER_INVAL XAE05 eng "XAER_INVAL: Invalid arguments (or unsupported command)" ER_XAER_RMFAIL XAE07 - eng "XAER_RMFAIL: The command cannot be executed in the %.64s state" + eng "XAER_RMFAIL: The command cannot be executed when global transaction is in the %.64s state" + rus "XAER_RMFAIL: эту команду нельзя выполнять когда глобальная транзакция находится в состоянии '%.64s'" ER_XAER_OUTSIDE XAE09 eng "XAER_OUTSIDE: Some work is done outside global transaction" ER_XAER_RMERR XAE03 diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e16d75165fd..57b7c387ac9 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -134,6 +134,12 @@ static bool end_active_trans(THD *thd) my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0)); DBUG_RETURN(1); } + if (thd->transaction.xid_state.xa_state != XA_NOTR) + { + my_error(ER_XAER_RMFAIL, MYF(0), + xa_state_names[thd->transaction.xid_state.xa_state]); + DBUG_RETURN(1); + } if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN | OPTION_TABLE_LOCK)) { @@ -1368,6 +1374,12 @@ int end_trans(THD *thd, enum enum_mysql_completiontype completion) my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0)); DBUG_RETURN(1); } + if (thd->transaction.xid_state.xa_state != XA_NOTR) + { + my_error(ER_XAER_RMFAIL, MYF(0), + xa_state_names[thd->transaction.xid_state.xa_state]); + DBUG_RETURN(1); + } switch (completion) { case COMMIT: /* @@ -3926,6 +3938,12 @@ end_with_restore_list: break; case SQLCOM_BEGIN: + if (thd->transaction.xid_state.xa_state != XA_NOTR) + { + my_error(ER_XAER_RMFAIL, MYF(0), + xa_state_names[thd->transaction.xid_state.xa_state]); + break; + } if (begin_trans(thd)) goto error; send_ok(thd); From 3c2dca475dfa91c95f2488831fafacacaf852347 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Oct 2005 03:49:14 +0200 Subject: [PATCH 225/225] my_pthread.h: Let pthread_mutex_init() macro return 0 on Windows mysql_priv.h: Return type is to be 'my_bool' for 'opt_enable_shared_memory' sql/mysql_priv.h: Return type is to be 'my_bool' for 'opt_enable_shared_memory' include/my_pthread.h: Let pthread_mutex_init() macro return 0 on Windows --- include/my_pthread.h | 2 +- sql/mysql_priv.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/my_pthread.h b/include/my_pthread.h index 132a298bc69..057b71356db 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -144,7 +144,7 @@ extern int pthread_mutex_destroy (pthread_mutex_t *); #define pthread_kill(A,B) raise(B) #define pthread_exit(A) pthread_dummy() #else -#define pthread_mutex_init(A,B) InitializeCriticalSection(A) +#define pthread_mutex_init(A,B) (InitializeCriticalSection(A),0) #define pthread_mutex_lock(A) (EnterCriticalSection(A),0) #define pthread_mutex_trylock(A) (WaitForSingleObject((A), 0) == WAIT_TIMEOUT) #define pthread_mutex_unlock(A) LeaveCriticalSection(A) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 633af122db8..c80e457d2bb 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1175,7 +1175,7 @@ extern my_bool sp_automatic_privileges, opt_noacl; extern my_bool opt_old_style_user_limits, trust_routine_creators; extern uint opt_crash_binlog_innodb; extern char *shared_memory_base_name, *mysqld_unix_port; -extern bool opt_enable_shared_memory; +extern my_bool opt_enable_shared_memory; extern char *default_tz_name; extern my_bool opt_large_pages; extern uint opt_large_page_size;