summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc18
-rw-r--r--client/mysqldump.c4
-rw-r--r--client/mysqlslap.c4
3 files changed, 15 insertions, 11 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 900bdec067a..01308055ac0 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -2241,8 +2241,10 @@ print_table_data(MYSQL_RES *result)
MYSQL_ROW cur;
MYSQL_FIELD *field;
bool *num_flag;
+ bool *not_null_flag;
num_flag=(bool*) my_alloca(sizeof(bool)*mysql_num_fields(result));
+ not_null_flag=(bool*) my_alloca(sizeof(bool)*mysql_num_fields(result));
if (info_flag)
{
print_field_types(result);
@@ -2260,7 +2262,7 @@ print_table_data(MYSQL_RES *result)
length=max(length,field->max_length);
if (length < 4 && !IS_NOT_NULL(field->flags))
length=4; // Room for "NULL"
- field->max_length=length+1;
+ field->max_length=length;
separator.fill(separator.length()+length+2,'-');
separator.append('+');
}
@@ -2272,10 +2274,11 @@ print_table_data(MYSQL_RES *result)
(void) tee_fputs("|", PAGER);
for (uint off=0; (field = mysql_fetch_field(result)) ; off++)
{
- tee_fprintf(PAGER, " %-*s|",(int) min(field->max_length,
+ tee_fprintf(PAGER, " %-*s |",(int) min(field->max_length,
MAX_COLUMN_LENGTH),
field->name);
num_flag[off]= IS_NUM(field->type);
+ not_null_flag[off]= IS_NOT_NULL(field->flags);
}
(void) tee_fputs("\n", PAGER);
tee_puts((char*) separator.ptr(), PAGER);
@@ -2295,7 +2298,8 @@ print_table_data(MYSQL_RES *result)
uint visible_length;
uint extra_padding;
- if (lengths[off] == 0)
+ /* If this column may have a null value, use "NULL" for empty. */
+ if (! not_null_flag[off] && (lengths[off] == 0))
{
buffer= "NULL";
data_length= 4;
@@ -2335,6 +2339,7 @@ print_table_data(MYSQL_RES *result)
}
tee_puts((char*) separator.ptr(), PAGER);
my_afree((gptr) num_flag);
+ my_afree((gptr) not_null_flag);
}
@@ -2349,11 +2354,8 @@ tee_print_sized_data(const char *data, unsigned int data_length, unsigned int to
unsigned int i;
const char *p;
- total_bytes_to_send -= 1;
- /* Off by one, perhaps mistakenly accounting for a terminating NUL. */
-
if (right_justified)
- for (i= 0; i < (total_bytes_to_send - data_length); i++)
+ for (i= data_length; i < total_bytes_to_send; i++)
tee_putc((int)' ', PAGER);
for (i= 0, p= data; i < data_length; i+= 1, p+= 1)
@@ -2365,7 +2367,7 @@ tee_print_sized_data(const char *data, unsigned int data_length, unsigned int to
}
if (! right_justified)
- for (i= 0; i < (total_bytes_to_send - data_length); i++)
+ for (i= data_length; i < total_bytes_to_send; i++)
tee_putc((int)' ', PAGER);
}
diff --git a/client/mysqldump.c b/client/mysqldump.c
index f268ca5b468..82da5d990b9 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -50,6 +50,7 @@
#include "mysql.h"
#include "mysql_version.h"
#include "mysqld_error.h"
+#include "../sql/ha_ndbcluster_tables.h"
/* Exit codes */
@@ -134,7 +135,6 @@ static CHARSET_INFO *charset_info= &my_charset_latin1;
const char *default_dbug_option="d:t:o,/tmp/mysqldump.trace";
/* do we met VIEWs during tables scaning */
my_bool was_views= 0;
-
const char *compatible_mode_names[]=
{
"MYSQL323", "MYSQL40", "POSTGRESQL", "ORACLE", "MSSQL", "DB2",
@@ -2937,6 +2937,8 @@ static int dump_all_tables_in_db(char *database)
afterdot= strmov(hash_key, database);
*afterdot++= '.';
+ if (!strcmp(database, NDB_REP_DB)) /* Skip cluster internal database */
+ return 0;
if (init_dumping(database))
return 1;
if (opt_xml)
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index d9b4230348e..11d3ae5a2df 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -457,8 +457,8 @@ static struct my_option my_long_options[] =
(gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
0},
{"preserve-schema", OPT_MYSQL_PRESERVE_SCHEMA,
- "Preserve the schema from the mysqlslap run, this happens unless \
- --auto-generate-sql or --create are used.",
+ "Preserve the schema from the mysqlslap run, this happens unless "
+ "--auto-generate-sql or --create are used.",
(gptr*) &opt_preserve, (gptr*) &opt_preserve, 0, GET_BOOL,
NO_ARG, TRUE, 0, 0, 0, 0, 0},
{"protocol", OPT_MYSQL_PROTOCOL,