From 756d02b90230e0f6d7de467159aae6b641eb75f0 Mon Sep 17 00:00:00 2001 From: sandhyawy Date: Fri, 3 Nov 2023 21:34:52 +0530 Subject: [PATCH] SQLyog 13.2.1 GA --- include/AppInfo.h | 2 +- include/ExportAsSQL.h | 6 +++ include/Version.h | 2 +- lib/Keywords.db | Bin 116736 -> 116736 bytes src/CommonHelper.cpp | 47 ++++++-------------- src/ConnectionBase.cpp | 15 +++++++ src/ConnectionCommunity.cpp | 8 +++- src/CopyDatabase.cpp | 59 ++++++++++++++++---------- src/ExportAsSQL.cpp | 26 ++++++++++++ src/ExportBatch.cpp | 12 ++++-- src/ExportImportConnectionDetails.cpp | 6 ++- src/GUIHelper.cpp | 4 ++ src/MySQLVersionHelper.cpp | 6 +-- src/TabFields.cpp | 3 ++ src/TabIndexes.cpp | 8 ++-- 15 files changed, 133 insertions(+), 71 deletions(-) diff --git a/include/AppInfo.h b/include/AppInfo.h index 344cd53..dd7c400 100644 --- a/include/AppInfo.h +++ b/include/AppInfo.h @@ -38,7 +38,7 @@ #define SQLITE_APPVERSION_MAJOR "10" #define SQLITE_APPVERSION_MINOR "5" -#define COMPANY_COPYRIGHT "(c) 2001-2022 Webyog Inc." +#define COMPANY_COPYRIGHT "(c) 2001-2023 Webyog Inc." #define FILEVER MAJOR_VERSION_INT ## , ## MINOR_VERSION_INT ## , ## UPDATE_VERSION_INT ## , ## RELEASE_VERSION_INT #define STRFILEVER MAJOR_VERSION "." MINOR_VERSION "." STRINGIZE(UPDATE_VERSION_INT) "." STRINGIZE(RELEASE_VERSION_INT) diff --git a/include/ExportAsSQL.h b/include/ExportAsSQL.h index 9d60f5f..0324fca 100644 --- a/include/ExportAsSQL.h +++ b/include/ExportAsSQL.h @@ -269,6 +269,12 @@ class MySQLDump */ wyBool DumpDatabaseOnUtf8(); + /// Dumps database with setting the utf8mb4 option + /** + @returns wyTrue + */ + wyBool DumpDatabaseOnUtf8mb4(); + /// Changes the current database /** @param db : IN Database name to change to diff --git a/include/Version.h b/include/Version.h index 843aaaf..8bc30e8 100644 --- a/include/Version.h +++ b/include/Version.h @@ -1,5 +1,5 @@ #define MAJOR_VERSION_INT 13 #define MINOR_VERSION_INT 2 -#define UPDATE_VERSION_INT 0 +#define UPDATE_VERSION_INT 1 #define RELEASE_VERSION_INT 0 #define EXTRAINFO "" diff --git a/lib/Keywords.db b/lib/Keywords.db index c259cb8015611756aa68834caa5a91a41b3c3ae0..66e921344907731b166f16251675d62cc13ea070 100644 GIT binary patch delta 10933 zcmbVS2VhiH*1qT5c}xfiNk|U~Nq{sN0-;C{q^ux4R7JrsOeQbMn8{2s?+p+I2NXg7 zCn`SIpzErL;#v^~DQj7kVneKJMc3Zjs%zt4{Lj7bO=dvd{dZH}ZRg&1>UYka)mJ)K zU+KKEZ|bLvu@Lg6m7_8~W!1A+rSgRg;V6Tn_>XAE)dob5f)mq$6|pae(#(Fa ziG9iEn(2s*UV>FqlJZ)01bT z7Vv%Aq3QoXvHCMX{veNABE2Pe?q z67en#{$K<9J7a9Pcwen0tTzUi2jDsCnPjH-D1~w6upZCASQDM)=bXlpGk6(lG|1A$ z{5H=DcPO}AgUfgm>n%>=ZSjOWUK&?=^J4S{+uD4(t~R2JKgb_sN-~XPX7NGTu7KJdXb*^&aPBsPxDP~eqVFXQFE+m7eU=5ZbF&YnI1HYJe@&K>rv-qie z7%wBvI7xzE;Jf$|rXYu(;8S=LUW7yN2<(MB;Ce9OQn&yDpu*Wu2dBXx@jWr5dXxv@ z4wgQDfqRM?oa)h9ls#|}%b@l&ZN4wk*6vr8ozx>{Ow%T}wdz-vnKg8-4pPt%I(w|PYdP*eF6P+l4^|hJ%S&xfjZ^x6y8@f=g*rqNx4gK zPBe5+NS_nL9jy2Ko@dW@PdS4IpEs}T`Gt8_uhLV+5|7s#39-*nDpd9$+#PJ5ch|lFy_$j=cXYih!;b-_3zKl=cgSZ24!K-mS zNvjpTI1eY{NUXv<{w;qSM(|hoA^s5GhN%efHGBkbzzgsMJODe0^lfk*Y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yU{XTZ$#C$-d5=gxb=DBP+jzT-XU7C6AGePJ0UA4J94Wjvsrfpudzo@?|_nu z(-vdo=ypFa-ZBNo6k}S}W*dt~=MNKp&=P?KYU#rFfHOy$(|2ur@J$HL{{O z{8-23C{RKt@Cuta8?|nQQZPDtZsowZe-KzKrD@#a@oxqO4x^)7a@Ds{saEPnO?HE>Cg{Sxe|F-JT0Q4Rk+*66-8^y;C$@;)78+DyCK6`#>fQl zIfJ1AddSprintf("%c", currentrow[index]); - index++; - s2.SetAs(s1.Substr(index, 7)); - } - found = wyTrue; - } - else - { - index = ptr - currentrow + 5; + index = ptr - currentrow + 6; //length of "CHECK " - while (wyTrue) - { - if ((currentrow[index] == ',' && currentrow[index + 2] == ' ')|| (currentrow[index] == '\0' )) - break; + while (wyTrue) + { + if ((currentrow[index] == ',' && currentrow[index + 2] == ' ')|| (currentrow[index] == '\0' )) + break; - expression->AddSprintf("%c", currentrow[index]); - index++; - } - found = wyTrue; + expression->AddSprintf("%c", currentrow[index]); + index++; } - + found = wyTrue; } return found; @@ -1193,13 +1173,13 @@ wyBool GetCheckConstraintValue(wyChar * currentrow, wyString * expression) wyBool GettablelevelCheckConstraintValue(wyChar * currentrow, wyString * expression) { - wyChar * find = "CHECK"; + wyChar * find = "CHECK "; wyBool found = wyFalse;/*, withcomment = wyFalse, withoutcomment = wyFalse;*/ wyChar *ptr = strstr(currentrow, find); wyInt32 index=0; if (ptr) { found = wyTrue; - index =( ptr - currentrow) + 5; + index =( ptr - currentrow) + 6; //length of "CHECK " while (currentrow[index] != '\0') { /*if (currentrow[index] == '\0' && currentrow[index + 2] == ' ') @@ -4264,8 +4244,8 @@ InitConnectionDetails(ConnectionInfo *conn) conn->m_rgbconn = RGB(255, 255, 255); conn->m_rgbfgconn = RGB(0, 0, 0); #endif - conn->m_no_ca = wyFalse; + return; } @@ -4810,4 +4790,5 @@ GetConnectionId(Tunnel *tunnel, MYSQL *mysql) sja_mysql_free_result(tunnel, myres); return idstr.GetAsInt32(); + } diff --git a/src/ConnectionBase.cpp b/src/ConnectionBase.cpp index 5ba29c6..bc29cf3 100644 --- a/src/ConnectionBase.cpp +++ b/src/ConnectionBase.cpp @@ -908,6 +908,11 @@ ConnectionBase::ChangeConnName(HWND hdlg) hwndc = (HWND)SendMessage(hwndcombo, CCBM_GETCOMBOHWND, NULL, NULL); VERIFY ((cursel = SendMessage(hwndcombo, CB_GETCURSEL, 0, 0))!= CB_ERR); + + if (cursel == -1) { + cursel = SendMessage(hwndcombo, CB_GETCOUNT, cursel, 0) - 1; + } + VERIFY ((SendMessage(hwndc, CB_GETLBTEXT, cursel,(LPARAM)pconn.m_connname))); VERIFY((count = SendMessage(hwndcombo, CB_GETITEMDATA, cursel, 0))); @@ -1583,6 +1588,9 @@ ConnectionBase::GetInitialDetails(HWND hdlg) dirstr.SetAs(directory); count = SendMessage(hwndcombo, CB_GETCURSEL, 0, 0); + if (count == -1) { + count = SendMessage(hwndcombo, CB_GETCOUNT, count, 0) - 1; + } VERIFY(count != CB_ERR); count = SendMessage(hwndcombo, CB_GETITEMDATA, count, 0); conn.Sprintf("Connection %u", count); @@ -1799,6 +1807,9 @@ ConnectionBase::GetOtherValues(HWND hdlg, ConnectionInfo *coninfo) // now get the title. index = SendMessage(hcb,CB_GETCURSEL,0,0); + if (index == -1) { + index = SendMessage(hcb, CB_GETCOUNT, index, 0) - 1; + } SendMessage(hwndCombo,CB_GETLBTEXT, index, (LPARAM)title); SendMessage(GetDlgItem(hdlg, IDC_DLGCONNECT_DATABASE), WM_GETTEXT,(WPARAM)SIZE_512 - 1,(LPARAM)db); @@ -2908,6 +2919,10 @@ ConnectionBase::GetConnectionName(HWND hdlg, wyString *connnamestr, const wyChar VERIFY((index = SendMessage(hcb, CB_GETCURSEL, 0, 0))!= CB_ERR); + if (index == -1) { + index = SendMessage(hcb, CB_GETCOUNT, index, 0) - 1; + } + txtlen = (SendMessage(hcb, CB_GETLBTEXTLEN, index, 0)); conname = AllocateBuffWChar(txtlen + 1); diff --git a/src/ConnectionCommunity.cpp b/src/ConnectionCommunity.cpp index 8a641aa..045a538 100644 --- a/src/ConnectionCommunity.cpp +++ b/src/ConnectionCommunity.cpp @@ -1231,6 +1231,9 @@ ConnectionCommunity::CreateSourceInstance(CopyDatabase *copydb) VERIFY(!(copydb->m_newsrctunnel->mysql_options(tempmysql, MYSQL_INIT_COMMAND, "/*40030 SET net_write_timeout=3600 */"))); + if(copydb->m_srcinfo->m_initcommand.FindI("utf8mb4") >=0) + VERIFY(!(copydb->m_newsrctunnel->mysql_options(tempmysql, MYSQL_INIT_COMMAND, copydb->m_srcinfo->m_initcommand.GetString()))); + SetMySQLOptions(copydb->m_srcinfo, copydb->m_newsrctunnel, &tempmysql, wyTrue); newsrcmysql = copydb->m_newsrctunnel->mysql_real_connect(tempmysql, @@ -1269,7 +1272,10 @@ ConnectionCommunity::CreateTargetInstance(CopyDatabase *copydb) copydb->m_newtargettunnel = CreateTunnel((wyBool)copydb->m_targettunnel->IsTunnel()); VERIFY(tempmysql = copydb->m_newtargettunnel->mysql_init((MYSQL*)0)); - + + if (copydb->m_tgtinfo->m_initcommand.FindI("utf8mb4") >= 0) + VERIFY(!(copydb->m_newtargettunnel->mysql_options(tempmysql, MYSQL_INIT_COMMAND, copydb->m_tgtinfo->m_initcommand.GetString()))); + SetMySQLOptions(copydb->m_tgtinfo, copydb->m_newtargettunnel, &tempmysql); newtargetmysql = copydb->m_newtargettunnel->mysql_real_connect(tempmysql, diff --git a/src/CopyDatabase.cpp b/src/CopyDatabase.cpp index 7a8c219..29fe5ff 100644 --- a/src/CopyDatabase.cpp +++ b/src/CopyDatabase.cpp @@ -1582,7 +1582,8 @@ CopyDatabase::InitExportData(HWND hwndtree) else m_isremdefiner = wyFalse; InitTargetServer(); - SetNamesToUTF8(); + + SetNamesToUTF8(); return wyTrue; } @@ -2612,54 +2613,66 @@ CopyDatabase::RevertTargetServer() void CopyDatabase::SetNamesToUTF8() { - wyString query; - MYSQL_RES *res; + wyString query; + MYSQL_RES *res; - if(IsMySQL41(m_newsrctunnel, &m_newsrcmysql)&& IsMySQL41(m_newtargettunnel, &m_newtargetmysql)) + wyString srcUtf8CharType = "utf8"; + wyString trgtUtf8CharType = "utf8"; + + if (m_tgtinfo->m_initcommand.FindI("utf8mb4") >= 0) + { + trgtUtf8CharType = "utf8mb4"; + } + + if(m_srcinfo->m_initcommand.FindI("utf8mb4") >= 0) { - if(m_newsrctunnel->IsTunnel()) - m_newsrctunnel->SetCharset("utf8"); + srcUtf8CharType = "utf8mb4"; + } + + if (IsMySQL41(m_newsrctunnel, &m_newsrcmysql) && IsMySQL41(m_newtargettunnel, &m_newtargetmysql)) + { + if (m_newsrctunnel->IsTunnel()) + m_newsrctunnel->SetCharset(srcUtf8CharType.GetString()); else { - query.Sprintf("SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT"); + query.Sprintf("SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT"); res = SjaExecuteAndGetResult(m_newsrctunnel, &m_newsrcmysql, query); - if(res) + if (res) m_newsrctunnel->mysql_free_result(res); - query.Sprintf("SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS"); + query.Sprintf("SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS"); res = SjaExecuteAndGetResult(m_newsrctunnel, &m_newsrcmysql, query); - if(res) + if (res) m_newsrctunnel->mysql_free_result(res); - query.Sprintf("SET NAMES utf8"); + query.Sprintf("SET NAMES %s", srcUtf8CharType.GetString()); res = SjaExecuteAndGetResult(m_newsrctunnel, &m_newsrcmysql, query); - if(res) + if (res) m_newsrctunnel->mysql_free_result(res); } - if(m_newtargettunnel->IsTunnel()) - m_newtargettunnel->SetCharset("utf8"); + if (m_newtargettunnel->IsTunnel()) + m_newtargettunnel->SetCharset(trgtUtf8CharType.GetString()); else { - - query.Sprintf("SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT"); + query.Sprintf("SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT"); res = SjaExecuteAndGetResult(m_newtargettunnel, &m_newtargetmysql, query); - if(res) + if (res) m_newtargettunnel->mysql_free_result(res); - query.Sprintf("SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS"); + query.Sprintf("SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS"); res = SjaExecuteAndGetResult(m_newtargettunnel, &m_newtargetmysql, query); - if(res) + if (res) m_newtargettunnel->mysql_free_result(res); - query.Sprintf("SET NAMES utf8"); + query.Sprintf("SET NAMES %s", trgtUtf8CharType.GetString()); res = SjaExecuteAndGetResult(m_newtargettunnel, &m_newtargetmysql, query); - if(res) + if (res) m_newtargettunnel->mysql_free_result(res); } - } + } - return; + return; } void diff --git a/src/ExportAsSQL.cpp b/src/ExportAsSQL.cpp index f9b3916..a587fd4 100644 --- a/src/ExportAsSQL.cpp +++ b/src/ExportAsSQL.cpp @@ -2497,6 +2497,10 @@ MySQLDump::DumpDatabase(wyString * buffer, const wyChar *db, wyInt32 *fileerr) if(DumpDatabaseOnUtf8() == wyFalse) return wyFalse; + if (m_charset.CompareI("utf8mb4") == 0) + if (DumpDatabaseOnUtf8mb4() == wyFalse) + return wyFalse; + if(m_singletransaction == wyTrue) OnSingleTransaction(); @@ -2581,6 +2585,28 @@ MySQLDump::DumpDatabaseOnUtf8() return wyTrue; } +wyBool +MySQLDump::DumpDatabaseOnUtf8mb4() +{ + MYSQL_RES *res; + wyString query; + + query.SetAs("SET NAMES UTF8MB4"); + + res = SjaExecuteAndGetResult(m_tunnel, &m_mysql, query); + +#ifdef _WIN32 + + m_tunnel->SetCharset("utf8mb4"); + +#endif + + if (res) + sja_mysql_free_result(m_tunnel, res); + + return wyTrue; +} + wyBool MySQLDump::ChangeContextDatabase(const wyChar *db) { diff --git a/src/ExportBatch.cpp b/src/ExportBatch.cpp index a5d5782..31588fb 100644 --- a/src/ExportBatch.cpp +++ b/src/ExportBatch.cpp @@ -1490,6 +1490,7 @@ ExportBatch::SetOtherValues(MySQLDump *dump) wyString filename; wyString charset, query; wyBool ischunkinsert,isprifixtimestamp=wyFalse; + MDIWindow *wnd = GetActiveWin(); dump->SetDatabase(m_db.GetString()); dump->SetAllTables(m_alltables); @@ -1516,9 +1517,14 @@ ExportBatch::SetOtherValues(MySQLDump *dump) dump->SetChunkLimit(chunklimit); } } - - if(IsMySQL41(m_tunnel, m_mysql)) - dump->SetCharSet("utf8"); + + if (wnd->m_conninfo.m_initcommand.FindI("utf8mb4") >= 0) + dump->SetCharSet("utf8mb4"); + else if(IsMySQL41(m_tunnel, m_mysql)) + { + dump->SetCharSet("utf8"); + } + else { if(GetServerDefaultCharset(m_tunnel, *m_mysql, charset, query) == wyFalse) diff --git a/src/ExportImportConnectionDetails.cpp b/src/ExportImportConnectionDetails.cpp index 5c43fd1..39783a0 100644 --- a/src/ExportImportConnectionDetails.cpp +++ b/src/ExportImportConnectionDetails.cpp @@ -1369,7 +1369,11 @@ wyBool ExportImportConnection::LoadDataToLV(HWND hwnd) cono=atoi(tempconsecname+10); if(connnamestr.Compare("") == 0) - return wyFalse; + { + ++i; + tempconsecname = strtok(NULL, seps); + continue; + } AddRowsToListViewControl(m_hwndLV, cono, connnamestr.GetAsWideChar(), connhostnamestr.GetAsWideChar(), connusernamestr.GetAsWideChar(), connportstr.GetAsWideChar(),isSSH, isSSL, isHTTP); ++i; tempconsecname = strtok(NULL, seps); diff --git a/src/GUIHelper.cpp b/src/GUIHelper.cpp index 59b9291..a80d051 100644 --- a/src/GUIHelper.cpp +++ b/src/GUIHelper.cpp @@ -1859,6 +1859,10 @@ WriteConnDetails(HWND hdlg) VERIFY((index = SendMessage(hcb, CB_GETCURSEL, 0, 0))!= CB_ERR); + if (index == -1) { + index = SendMessage(hcb, CB_GETCOUNT, index, 0) - 1; + } + txtlen = (SendMessage(hcb, CB_GETLBTEXTLEN, index, 0)); conname = AllocateBuffWChar(txtlen + 1); diff --git a/src/MySQLVersionHelper.cpp b/src/MySQLVersionHelper.cpp index 2395072..24a6fc5 100644 --- a/src/MySQLVersionHelper.cpp +++ b/src/MySQLVersionHelper.cpp @@ -517,10 +517,10 @@ void GetVersionInfoforAutoComplete(MYSQL *mysql, wyString &VersionS) char *dbString = mysql_get_server_info(mysql); if(strstr(dbString, "MariaDB")) ///if its mariadb,check if the version is above 10.2 { - if(me >= 100200) + if(me >= 100200 && me < 100300) me = 50713;///if mariadb version is > 10.2 it supports JSON, hence include functions till mysql version 5.7.13 - else - me = 50066;///if mariadb version is < 10.2, include functions only for previous versons of mysql. + else if(me < 100200) + me = 50300;///if mariadb version is < 10.2, include functions only for previous versons of mysql. } VersionS.Sprintf("%ld", me); diff --git a/src/TabFields.cpp b/src/TabFields.cpp index 643effd..b0c8d5a 100644 --- a/src/TabFields.cpp +++ b/src/TabFields.cpp @@ -1989,6 +1989,9 @@ TabFields::GetDefaultValue(wyString& query, FieldStructWrapper* cwrapobj) { query.Add("'' "); } + else if (datatype.Compare("varchar") == 0 && ((defval.FindI("UUID()") != -1) || (defval.FindI("SYS_GUID()") != -1))) { + query.AddSprintf("%s ", defval.GetString()); + } else { if(defval.GetCharAt(0) == '`' && defval.GetCharAt(defval.GetLength() - 1) == '`' diff --git a/src/TabIndexes.cpp b/src/TabIndexes.cpp index 2e0f355..4ed4433 100644 --- a/src/TabIndexes.cpp +++ b/src/TabIndexes.cpp @@ -1742,14 +1742,12 @@ TabIndexes::FillColumnsGrid(HWND hwnd) } if(!tmpindcols) { - //add only thoes columns for index which are not virtual - if(!(m_ismariadb52 && cfieldswrapobj->m_newval->m_virtuality.CompareI("VIRTUAL")==0) ) - { - newrow = CustomGrid_InsertRow(m_hdlggrid); + //add only columns including virtual columns + + newrow = CustomGrid_InsertRow(m_hdlggrid); CustomGrid_SetText(m_hdlggrid, newrow, 0, (wyChar*)cfieldswrapobj->m_newval->m_name.GetString()); CustomGrid_SetText(m_hdlggrid, newrow, 1, (wyChar*)cfieldswrapobj->m_newval->m_datatype.GetString()); CustomGrid_SetRowLongData(m_hdlggrid, newrow, (LPARAM) cfieldswrapobj); - } } } cfieldswrapobj = (FieldStructWrapper*)cfieldswrapobj->m_next;