Add SQL-mode of result output
[ftsbench.git] / mysqldriver.c
index 68f5b40..0fddf61 100644 (file)
@@ -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