57741c59bcf91b2d2fae5b38b8252fc796aeb3f2 galt Tue May 22 16:34:46 2012 -0700 make mysql load error detection the default diff --git src/hg/lib/jksql.c src/hg/lib/jksql.c index b7bd9bf..d6f0c4b 100644 --- src/hg/lib/jksql.c +++ src/hg/lib/jksql.c @@ -1329,36 +1329,31 @@ safef(query, sizeof(query), "LOAD DATA %s %s INFILE '%s' %s INTO TABLE %s", concurrentOpt, localOpt, tabPath, dupOpt, table); sr = sqlGetResult(conn, query); monitorEnter(); info = mysql_info(conn->conn); monitorLeave(); if (info == NULL) errAbort("no info available for result of sql query: %s", query); numScan = sscanf(info, "Records: %d Deleted: %*d Skipped: %d Warnings: %d", &numRecs, &numSkipped, &numWarnings); if (numScan != 3) errAbort("can't parse sql load info: %s", info); sqlFreeResult(&sr); -char *host = getenv("HOST"); -if ( // TODO 2012/03/26 this is temporary and we should eventually get to always checking the warnings. - sameOk(host,"hgwdev") - || sameOk(host,"hgwbeta") - || sameOk(host,"hgwalpha") - || sameOk(cfgOption("detectMysqlLoadWarnings"), "on")) // go gently in case of backwards-compatibility issues +if (!sameOk(cfgOption("detectMysqlLoadWarnings"), "off")) { /* mysql 5.0 bug: mysql_info returns unreliable warnings count, so use this instead: */ numWarnings = sqlWarnCount(conn); } if ((numSkipped > 0) || (numWarnings > 0)) { boolean doAbort = TRUE; if ((numSkipped > 0) && (options & SQL_TAB_FILE_WARN_ON_ERROR)) doAbort = FALSE; /* don't abort on errors */ else if ((numWarnings > 0) && (options & (SQL_TAB_FILE_WARN_ON_ERROR|SQL_TAB_FILE_WARN_ON_WARN))) doAbort = FALSE; /* don't abort on warnings */ if (numWarnings > 0) {