mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
0515b14020
into polly.(none):/home/kaa/src/opt/bug32221/my51-bug31445 BitKeeper/deleted/.del-myTest.dsp~4a8c480769193952: Auto merged BitKeeper/deleted/.del-mytest.c~9a99338689e5de8: Auto merged BitKeeper/deleted/.del-mytest.dsw~2324698861155335: Auto merged libmysql/Makefile.am: Auto merged tests/bug25714.c: Auto merged tests/mysql_client_test.c: Auto merged BitKeeper/deleted/.del-copy_mysql_files.bat~f6878eeb80173de9: Auto merged BitKeeper/deleted/.del-mytest_1.c: Merge rename: BitKeeper/deleted/.del-mytest.c -> BitKeeper/deleted/.del-mytest_1.c BitKeeper/deleted/.del-myTest-package.dsp~ec9faf3287cbe2b9: Auto merged BitKeeper/deleted/.del-myTest-package_ia64.dsp~e423b69f2c624850: Auto merged BitKeeper/deleted/.del-myTest.vcproj~dba5adc4fad3c06: Auto merged BitKeeper/deleted/.del-myTest_ia64.dsp~b17572b217d092e6: Auto merged libmysql/CMakeLists.txt: Manual merge.
76 lines
2 KiB
C
76 lines
2 KiB
C
/* 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 <my_global.h>
|
|
#include <my_sys.h>
|
|
#include <mysql.h>
|
|
#include <m_string.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";
|
|
|
|
MY_INIT(argv[0]);
|
|
|
|
if (argc != 2 || !strcmp(argv[1], "--help"))
|
|
{
|
|
fprintf(stderr, "This program is a part of the MySQL test suite. "
|
|
"It is not intended to be executed directly by a user.\n");
|
|
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);
|
|
my_end(0);
|
|
|
|
return 0;
|
|
}
|
|
|