From fc1cd0fc2f341bd2082073f95e0954c5576b6b4c Mon Sep 17 00:00:00 2001 From: wyaadarsh Date: Mon, 15 Jan 2018 18:49:02 +0530 Subject: [PATCH] SQLyog 12.5.1 GA --- include/Version.h | 4 ++-- src/CommonHelper.cpp | 16 ++++++++-------- src/ExportAsSQL.cpp | 35 +++++++++++++++++++++-------------- 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/include/Version.h b/include/Version.h index 5221531..4b1fdb5 100644 --- a/include/Version.h +++ b/include/Version.h @@ -1,5 +1,5 @@ #define MAJOR_VERSION_INT 12 -#define MINOR_VERSION_INT 4 -#define UPDATE_VERSION_INT 3 +#define MINOR_VERSION_INT 5 +#define UPDATE_VERSION_INT 1 #define RELEASE_VERSION_INT 0 #define EXTRAINFO "" diff --git a/src/CommonHelper.cpp b/src/CommonHelper.cpp index 4c8bd7c..342795f 100644 --- a/src/CommonHelper.cpp +++ b/src/CommonHelper.cpp @@ -3819,13 +3819,13 @@ SetMySQLOptions(ConnectionInfo *conn, Tunnel *tunnel, PMYSQL pmysql, wyBool isse //Session wait_timeout - timeout = conn->m_strwaittimeout.GetAsUInt32(); - - if(timeout > 28800 || timeout <= 0) - conn->m_strwaittimeout.SetAs("28800"); - - strtimeout.Sprintf("/*!40101 set @@session.wait_timeout=%s */", conn->m_strwaittimeout.GetString()); - mysql_options(*pmysql, MYSQL_INIT_COMMAND, strtimeout.GetString()); + if(conn->m_isdeftimeout != wyTrue){ + timeout = conn->m_strwaittimeout.GetAsUInt32(); + if(timeout > 28800 || timeout <= 0) + conn->m_strwaittimeout.SetAs("28800"); + strtimeout.Sprintf("/*!40101 set @@session.wait_timeout=%s */", conn->m_strwaittimeout.GetString()); + mysql_options(*pmysql, MYSQL_INIT_COMMAND, strtimeout.GetString()); + } } //Gets the field inforamtion of the view @@ -4090,7 +4090,7 @@ InitConnectionDetails(ConnectionInfo *conn) conn->m_issslauthchecked = wyFalse; conn->m_issslchecked = wyFalse; conn->m_iscompress = wyTrue; - conn->m_isdeftimeout = wyTrue; + conn->m_isdeftimeout = wyTrue; conn->m_strwaittimeout.SetAs("28800"); conn->m_isreadonly = wyFalse; //conn->m_ispwdcleartext = wyFalse; diff --git a/src/ExportAsSQL.cpp b/src/ExportAsSQL.cpp index 9ab63e2..97f8da8 100644 --- a/src/ExportAsSQL.cpp +++ b/src/ExportAsSQL.cpp @@ -3842,29 +3842,36 @@ MySQLDump::PrintFieldValue(wyString * buffer, MYSQL_RES *res, MYSQL_ROW row, wyI if(m_sethexblob && isBlob) { - hex_datalen=lengths[count]+1; - hex_data.SetAs(row[count]); - if(hex_datalen==1) + hex_datalen=lengths[count]; + + if(hex_datalen==0) { buffer->AddSprintf("''"); firstcol++; continue; } - len=hex_data.GetLength(); - blob_temp.SetAs(hex_data.GetString()); + buffer->AddSprintf("0x"); hex_tmp.SetAs(""); - for (i = 0; i < len; i++) + + const char *ptr= row[count]; + + for (i = 0; i < hex_datalen; i++) { - if((i+3) < len && blob_temp.GetCharAt(i) == '\\' && blob_temp.GetCharAt(i+1)=='r' && blob_temp.GetCharAt(i+2)=='\\' && blob_temp.GetCharAt(i+3) == 'n') - { - hex_tmp.Add("0D0A"); - i += 3; - } - else - { - hex_tmp.AddSprintf("%02x",blob_temp.GetCharAt(i)); + //MM: Test case? + if((i+3) < hex_datalen) { + if (*((unsigned char *)(ptr + i)) == '\\' && + *((unsigned char *)(ptr + i + 1)) =='r' && + *((unsigned char *)(ptr + i + 2)) =='\\' && + *((unsigned char *)(ptr + i + 3)) == 'n') + { + hex_tmp.Add("0D0A"); + i += 3; + continue; + } } + + hex_tmp.AddSprintf("%02x", *((unsigned char *)(ptr+i))); } buffer->AddSprintf(hex_tmp.GetString()); firstcol ++;