X-Git-Url: http://sigaev.ru/git/gitweb.cgi?p=ftsbench.git;a=blobdiff_plain;f=mysqldriver.c;fp=mysqldriver.c;h=0fddf619cb3a3f98df103c2209fde088ffc8223e;hp=68f5b40c366f1d6b50cedb7410b60557adbd27f0;hb=34dc32fe558e25dfe4c7c80b94b126e597ebac2f;hpb=430dd7ec2f63bd59274f832a28d45eb6cf737cbd diff --git a/mysqldriver.c b/mysqldriver.c index 68f5b40..0fddf61 100644 --- a/mysqldriver.c +++ b/mysqldriver.c @@ -149,10 +149,10 @@ startCreateScheme(ftsDB *adb, int flags) { db->flags = flags; if ( flags & FLG_FUNC ) - printf("Flag 'func' is ignored by MySQL\n"); + report("Flag 'func' is ignored by MySQL\n"); - if ( flags & (FLG_GIN | FLG_GIST) ) - printf("MySQL doesn't distinguish 'gin' and 'gist' flags\n"); + if ( (flags & (FLG_GIN | FLG_GIST)) && (db->flags & FLG_SQL) == 0 ) + report("MySQL doesn't distinguish 'gin' and 'gist' flags\n"); if ( mysql_query(db->conn, "DROP TABLE IF EXISTS ftsbench CASCADE;")!= 0 ) { fprintf(stderr,"mysql_query failed: %s\n", mysql_error(db->conn)); @@ -170,27 +170,23 @@ finishCreateScheme(ftsDB *adb) { ftsMY *db = (ftsMY*)adb; if ( db->flags & (FLG_GIN | FLG_GIST) ) { - printf("(create index, "); - fflush(stdout); + report("(create index, "); if ( mysql_query(db->conn, "CREATE FULLTEXT INDEX fts ON ftsbench (body);")!= 0 ) { fprintf(stderr,"mysql_query failed: %s\n", mysql_error(db->conn)); exit(1); } - } else { - printf("("); - fflush(stdout); - } + } else + report("("); - printf("optimize"); - fflush(stdout); + report("optimize"); + if ( mysql_query(db->conn, "OPTIMIZE TABLE ftsbench;")!= 0 ) { fprintf(stderr,"mysql_query failed: %s\n", mysql_error(db->conn)); exit(1); } - printf(") "); - fflush(stdout); + report(") "); } static void