summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorguilhem@mysql.com <>2005-01-16 21:39:21 +0100
committerguilhem@mysql.com <>2005-01-16 21:39:21 +0100
commit05793bb9b92bd29fd1409c664b5da05955b45324 (patch)
tree22c11c7fe0d89e79bf5d07bc49b61253a14dd905 /client
parent1cb5d98d85dd055c7255b7a77f71dd91760cd14b (diff)
parent6412558d03f7f8a5c6734644e403f2bcef1aa5f7 (diff)
downloadmariadb-git-05793bb9b92bd29fd1409c664b5da05955b45324.tar.gz
Merge
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc8
-rw-r--r--client/mysqldump.c7
2 files changed, 11 insertions, 4 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 7e7b2e291d5..0f6f3084d1e 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -172,7 +172,7 @@ static char *shared_memory_base_name=0;
#endif
static uint opt_protocol=0;
static CHARSET_INFO *charset_info= &my_charset_latin1;
-
+
#include "sslopt-vars.h"
const char *default_dbug_option="d:t:o,/tmp/mysql.trace";
@@ -1520,7 +1520,7 @@ You can turn off this feature to get a quicker startup with -A\n\n");
j=0;
while ((sql_field=mysql_fetch_field(fields)))
{
- sprintf(buf,"%s.%s",table_row[0],sql_field->name);
+ sprintf(buf,"%.64s.%.64s",table_row[0],sql_field->name);
field_names[i][j] = strdup_root(&hash_mem_root,buf);
add_word(&ht,field_names[i][j]);
field_names[i][num_fields+j] = strdup_root(&hash_mem_root,
@@ -1597,7 +1597,7 @@ int mysql_real_query_for_lazy(const char *buf, int length)
for (uint retry=0;; retry++)
{
if (!mysql_real_query(&mysql,buf,length))
- return 0;
+ return 0;
int error= put_error(&mysql);
if (mysql_errno(&mysql) != CR_SERVER_GONE_ERROR || retry > 1 ||
!opt_reconnect)
@@ -2526,7 +2526,7 @@ com_connect(String *buffer, char *line)
{
sprintf(buff,"Connection id: %lu",mysql_thread_id(&mysql));
put_info(buff,INFO_INFO);
- sprintf(buff,"Current database: %s\n",
+ sprintf(buff,"Current database: %.128s\n",
current_db ? current_db : "*** NONE ***");
put_info(buff,INFO_INFO);
}
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 876e4ef55e1..458c8a3ecda 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -2308,8 +2308,15 @@ static int start_transaction(MYSQL *mysql_con, my_bool consistent_read_now)
We use BEGIN for old servers. --single-transaction --master-data will fail
on old servers, but that's ok as it was already silently broken (it didn't
do a consistent read, so better tell people frankly, with the error).
+
+ We want the first consistent read to be used for all tables to dump so we
+ need the REPEATABLE READ level (not anything lower, for example READ
+ COMMITTED would give one new consistent read per dumped table).
*/
return (mysql_query_with_error_report(mysql_con, 0,
+ "SET SESSION TRANSACTION ISOLATION "
+ "LEVEL REPEATABLE READ") ||
+ mysql_query_with_error_report(mysql_con, 0,
consistent_read_now ?
"START TRANSACTION "
"WITH CONSISTENT SNAPSHOT" :