diff options
author | unknown <acurtis/antony@ltamd64.xiphis.org> | 2007-07-24 00:03:01 -0700 |
---|---|---|
committer | unknown <acurtis/antony@ltamd64.xiphis.org> | 2007-07-24 00:03:01 -0700 |
commit | e1b3b9317e5afffbebbe3387bcfa7354b85e3a51 (patch) | |
tree | b4297e5a5bc8285bb3d7526f32a7ffe3a50b3959 /tests | |
parent | a794036e94e0eb1d3db69428fe28221ba1f1eebd (diff) | |
parent | 0f85ae9f2cb88dd8a17aaa5f69639e3e22fd0f9f (diff) | |
download | mariadb-git-e1b3b9317e5afffbebbe3387bcfa7354b85e3a51.tar.gz |
Merge xiphis.org:/anubis/antony/work/p2-bug25714.1
into xiphis.org:/anubis/antony/work/p2-bug25714.1.merge-5.1
mysql-test/mysql-test-run.pl:
Auto merged
tests/Makefile.am:
Auto merged
storage/federated/ha_federated.cc:
manual merge from 5.0 to 5.1
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 5 | ||||
-rw-r--r-- | tests/bug25714.c | 68 |
2 files changed, 72 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 5f34def19bd..fbd58b88b9c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -35,7 +35,7 @@ EXTRA_DIST = auto_increment.res auto_increment.tst \ CMakeLists.txt bin_PROGRAMS = mysql_client_test -noinst_PROGRAMS = insert_test select_test thread_test +noinst_PROGRAMS = insert_test select_test thread_test bug25714 INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \ $(openssl_includes) @@ -52,6 +52,9 @@ select_test_SOURCES= select_test.c insert_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) select_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) +bug25714_SOURCES= bug25714.c +bug25714_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) + # Fix for mit-threads DEFS = -DUNDEF_THREADS_HACK diff --git a/tests/bug25714.c b/tests/bug25714.c new file mode 100644 index 00000000000..d163b8ad00e --- /dev/null +++ b/tests/bug25714.c @@ -0,0 +1,68 @@ +/* Copyright (C) 2007 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; version 2 of the License. + + 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 <mysql.h> +#include <string.h> +#include <stdio.h> +#include <stdlib.h> +#include <assert.h> + +int main (int argc, char **argv) +{ + MYSQL conn; + int OK; + + const char* query4= "INSERT INTO federated.t1 SET Value=54"; + const char* query5= "INSERT INTO federated.t1 SET Value=55"; + + if (argc != 2) + return -1; + + mysql_init(&conn); + if (!mysql_real_connect( + &conn, + "127.0.0.1", + "root", + "", + "test", + atoi(argv[1]), + NULL, + CLIENT_FOUND_ROWS)) + { + fprintf(stderr, "Failed to connect to database: Error: %s\n", + mysql_error(&conn)); + return 1; + } else { + printf("%s\n", mysql_error(&conn)); + } + + OK = mysql_real_query (&conn, query4, strlen(query4)); + + assert(0 == OK); + + printf("%ld inserted\n", + (long) mysql_insert_id(&conn)); + + OK = mysql_real_query (&conn, query5, strlen(query5)); + + assert(0 == OK); + + printf("%ld inserted\n", + (long) mysql_insert_id(&conn)); + + mysql_close(&conn); + + return 0; +}; |