Commit 4e66318d authored by Andrew McDonnell's avatar Andrew McDonnell

Cleanup warning consistency

parent 0532a847
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#include "my_dbug.h" #include "my_dbug.h"
// Uncomment this for extra debug, but expect a performance hit in large queries // Uncomment this for extra debug, but expect a performance hit in large queries
// #define VERBOSE_DEBUG #define VERBOSE_DEBUG
#ifdef VERBOSE_DEBUG #ifdef VERBOSE_DEBUG
#else #else
#undef DBUG_PRINT #undef DBUG_PRINT
...@@ -308,6 +308,7 @@ int ha_oqgraph::oqgraph_check_table_structure (TABLE *table_arg) ...@@ -308,6 +308,7 @@ int ha_oqgraph::oqgraph_check_table_structure (TABLE *table_arg)
#ifdef RETAIN_INT_LATCH_COMPATIBILITY #ifdef RETAIN_INT_LATCH_COMPATIBILITY
if (g_allow_create_integer_latch && isLatchColumn && ((*field)->type() == MYSQL_TYPE_SHORT)) if (g_allow_create_integer_latch && isLatchColumn && ((*field)->type() == MYSQL_TYPE_SHORT))
{ {
DBUG_PRINT( "oq-debug", ("Allowing integer latch anyway!"));
isStringLatch = false; isStringLatch = false;
/* Make a warning */ /* Make a warning */
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
...@@ -315,6 +316,12 @@ int ha_oqgraph::oqgraph_check_table_structure (TABLE *table_arg) ...@@ -315,6 +316,12 @@ int ha_oqgraph::oqgraph_check_table_structure (TABLE *table_arg)
"latch SMALLINT UNSIGNED NULL", "'latch VARCHAR(32) NULL'"); "latch SMALLINT UNSIGNED NULL", "'latch VARCHAR(32) NULL'");
} else } else
#endif #endif
if (isLatchColumn && ((*field)->type() == MYSQL_TYPE_SHORT))
{
DBUG_PRINT( "oq-debug", ("Allowing integer no more!"));
badColumn = true;
push_warning_printf( current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, HA_WRONG_CREATE_OPTION, "Integer latch is not supported for new tables.", i);
} else
/* Check Column Type */ /* Check Column Type */
if ((*field)->type() != skel[i].coltype) { if ((*field)->type() != skel[i].coltype) {
badColumn = true; badColumn = true;
...@@ -322,7 +329,7 @@ int ha_oqgraph::oqgraph_check_table_structure (TABLE *table_arg) ...@@ -322,7 +329,7 @@ int ha_oqgraph::oqgraph_check_table_structure (TABLE *table_arg)
} }
// Make sure latch column is large enough for all possible latch values // Make sure latch column is large enough for all possible latch values
if (isLatchColumn) { if (isLatchColumn && isStringLatch) {
if ((*field)->char_length() < findLongestLatch()) { if ((*field)->char_length() < findLongestLatch()) {
badColumn = true; badColumn = true;
push_warning_printf( current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, HA_WRONG_CREATE_OPTION, "Column %d is too short.", i); push_warning_printf( current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, HA_WRONG_CREATE_OPTION, "Column %d is too short.", i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment