From 3be063eab8cc9af4f7782b693b497817c2511ddc Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 2 Mar 2001 19:07:29 +0200 Subject: [PATCH] row0sel.c Removes now trailing spaces from varchars srv0start.c Removes now trailing spaces from varchars row0mysql.ic Removes now trailing spaces from varchars ha_innobase.cc Removes now trailing spaces from varchars sql/ha_innobase.cc: Removes now trailing spaces from varchars innobase/include/row0mysql.ic: Removes now trailing spaces from varchars innobase/row/row0sel.c: Removes now trailing spaces from varchars innobase/srv/srv0start.c: Removes now trailing spaces from varchars --- innobase/include/row0mysql.ic | 7 ++++++- innobase/row/row0sel.c | 3 +++ innobase/srv/srv0start.c | 6 ++++++ sql/ha_innobase.cc | 16 ++++++++++++---- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/innobase/include/row0mysql.ic b/innobase/include/row0mysql.ic index 957a143008d..6096e5771f7 100644 --- a/innobase/include/row0mysql.ic +++ b/innobase/include/row0mysql.ic @@ -89,7 +89,12 @@ row_mysql_store_col_in_innobase_format( } } else if (type == DATA_VARCHAR || type == DATA_VARMYSQL || type == DATA_BINARY) { - ptr = row_mysql_read_var_ref(&col_len, mysql_data); + ptr = row_mysql_read_var_ref(&col_len, mysql_data); + + /* Remove trailing spaces */ + while (col_len > 0 && ptr[col_len - 1] == ' ') { + col_len--; + } } else if (type == DATA_BLOB) { ptr = row_mysql_read_blob_ref(&col_len, mysql_data, col_len); diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 1045c39248e..e6182257581 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -1934,6 +1934,9 @@ row_sel_field_store_in_mysql_format( dest = row_mysql_store_var_len(dest, len); ut_memcpy(dest, data, len); + /* Pad with trailing spaces */ + memset(dest + len, ' ', col_len - len); + /* ut_ad(col_len >= len + 2); No real var implemented in MySQL yet! */ diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c index a051e2b62b5..b57558859b2 100644 --- a/innobase/srv/srv0start.c +++ b/innobase/srv/srv0start.c @@ -175,6 +175,9 @@ open_or_create_log_file( fprintf(stderr, "Innobase: Log file %s did not exist: new to be created\n", name); + printf("Innobase: Setting log file %s size to %lu\n", + name, UNIV_PAGE_SIZE * srv_log_file_size); + ret = os_file_set_size(name, files[i], UNIV_PAGE_SIZE * srv_log_file_size, 0); if (!ret) { @@ -323,6 +326,9 @@ open_or_create_data_files( printf("Innobase: Setting file %s size to %lu\n", name, UNIV_PAGE_SIZE * srv_data_file_sizes[i]); + printf( + "Innobase: Database physically writes the file full: wait...\n"); + ret = os_file_set_size(name, files[i], UNIV_PAGE_SIZE * srv_data_file_sizes[i], 0); diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc index 197a46c06cd..0e5bb82984c 100644 --- a/sql/ha_innobase.cc +++ b/sql/ha_innobase.cc @@ -431,7 +431,8 @@ innobase_init(void) if (!innobase_data_file_path) { - fprintf(stderr,"Can't initialize Innobase as 'innobase_data_file_path' is not set\n"); + fprintf(stderr, + "Can't initialize Innobase as 'innobase_data_file_path' is not set\n"); innobase_skip=1; DBUG_RETURN(FALSE); // Continue without innobase } @@ -1278,6 +1279,12 @@ innobase_convert_and_store_changed_col( if (len == UNIV_SQL_NULL) { data = NULL; + } else if (col_type == DATA_VARCHAR) { + /* Remove trailing spaces */ + while (len > 0 && data[len - 1] == ' ') { + len--; + } + } else if (col_type == DATA_INT) { /* Store integer data in Innobase in a big-endian format, sign bit negated, if signed */ @@ -2581,13 +2588,14 @@ ha_innobase::update_table_comment( { uint length=strlen(comment); - char *str=my_malloc(length + 50,MYF(0)); + char *str=my_malloc(length + 100,MYF(0)); if (!str) return (char*)comment; - sprintf(str,"%s Innobase free: %lu kB", comment, - (ulong) innobase_get_free_space()); + sprintf(str, + "%s; (See manual about Innobase stats); Innobase free: %lu kB", + comment, (ulong) innobase_get_free_space()); return((char*) str); }