From c7a2d3ded19c4452014ccdbdffe5ea02794d3d7f Mon Sep 17 00:00:00 2001 From: maryamwy Date: Thu, 26 May 2016 18:02:08 +0530 Subject: [PATCH] SQLyog GA 12.2.3 --- include/SQLyog.rc | 2 +- include/UserManager.h | 2 ++ include/Version.h | 2 +- src/CopyDatabase.cpp | 21 ++++++++++++++++----- src/FrameWindow.cpp | 2 +- src/FrameWindowHelper.cpp | 16 +++++++++++----- src/FrameWindowSplitter.cpp | 2 +- src/GUIHelper.cpp | 6 ++++-- src/TabEditorSplitter.cpp | 2 +- src/UserManager.cpp | 36 ++++++++++++++++++++++++++++++++++-- 10 files changed, 72 insertions(+), 19 deletions(-) diff --git a/include/SQLyog.rc b/include/SQLyog.rc index 887cc0a..286d36d 100644 --- a/include/SQLyog.rc +++ b/include/SQLyog.rc @@ -1965,7 +1965,7 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN LTEXT "Size Griper",IDC_GRIP,390,140,40,10 LTEXT "Use&r",IDC_UM_USER,7,9,16,8 - COMBOBOX IDC_USERCOMBO,25,7,112,30,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_USERCOMBO,25,7,112,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP CONTROL "",IDC_OBTREE,"SysTreeView32",TVS_HASBUTTONS | TVS_LINESATROOT | TVS_SHOWSELALWAYS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,7,29,130,107 CONTROL "",IDC_PRIVOBTREE,"SysTreeView32",TVS_HASBUTTONS | TVS_LINESATROOT | TVS_SHOWSELALWAYS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,7,140,130,68 CONTROL "Show only pr&ivileged objects",IDC_PRIVILEGEDCHECK, diff --git a/include/UserManager.h b/include/UserManager.h index a0948a3..d24e1cf 100644 --- a/include/UserManager.h +++ b/include/UserManager.h @@ -161,6 +161,8 @@ class UserManager */ void OnUserComboChange(); + void OnHandleEditChange(); + ///Initializes the tree view /** @returns void diff --git a/include/Version.h b/include/Version.h index 8a96c9d..f92f09e 100644 --- a/include/Version.h +++ b/include/Version.h @@ -1,5 +1,5 @@ #define MAJOR_VERSION_INT 12 #define MINOR_VERSION_INT 2 -#define UPDATE_VERSION_INT 2 +#define UPDATE_VERSION_INT 3 #define RELEASE_VERSION_INT 0 #define EXTRAINFO "" diff --git a/src/CopyDatabase.cpp b/src/CopyDatabase.cpp index 63074f1..b568401 100644 --- a/src/CopyDatabase.cpp +++ b/src/CopyDatabase.cpp @@ -3506,19 +3506,30 @@ CopyDatabase::ExportSP(const wyChar *db, const wyChar *sp, wyBool isproc) m_newtargettunnel->mysql_free_result(res); } + else + { + if(isproc) + { + pattern.AddSprintf("PROCEDURE"); + extra = 9; + } + else + { + pattern.AddSprintf("FUNCTION"); + extra = 8; + } + + } + if(isproc) { - pattern.AddSprintf("PROCEDURE"); - extra = 9; query.Sprintf("show create procedure `%s`.`%s`", db, sp); } else { - pattern.AddSprintf("FUNCTION"); - extra = 8; query.Sprintf("show create function `%s`.`%s`", db, sp); } - + res = SjaExecuteAndGetResult(m_newsrctunnel, &m_newsrcmysql, query); if(!res) { diff --git a/src/FrameWindow.cpp b/src/FrameWindow.cpp index 22888b6..db5f76b 100644 --- a/src/FrameWindow.cpp +++ b/src/FrameWindow.cpp @@ -5216,7 +5216,7 @@ FrameWindow::InitCreateObjectDlg(HWND hwnd, wyChar *object) } else if(stricmp(object, "createdb") == 0) { - SendMessage(GetDlgItem(hwnd, IDC_DBEDIT), EM_LIMITTEXT, 64, 0); + SendMessage(GetDlgItem(hwnd, IDC_DBEDIT), EM_LIMITTEXT, 63, 0); if(GetActiveWin()->m_ismysql41 == wyFalse) { EnableWindow((GetDlgItem(hwnd, IDC_CHARSETCOMBO)), FALSE); diff --git a/src/FrameWindowHelper.cpp b/src/FrameWindowHelper.cpp index 75950b2..bea574e 100644 --- a/src/FrameWindowHelper.cpp +++ b/src/FrameWindowHelper.cpp @@ -401,7 +401,7 @@ wyChar * FormatResultSet(Tunnel * tunnel, MYSQL_RES * myres, MYSQL_FIELD * myfield, MySQLDataEx *mdata) { wyUInt32 count, ncounter = 0, *pfieldlenarr, nfieldlen = 0, nmaxlen = 0; - wyInt32 dwtitlecount, dwcurrline = 1, dwlinenum, dwlinenumtemp; + wyInt32 dwtitlecount, dwcurrline = 1,dwmaxline = 1, dwlinenum, dwlinenumtemp; wyUInt32 dwcharpoint; wyInt32 dwnewlinepoint, dwheapsize, dwlast=0, dwsize; wyChar sznull[] = STRING_NULL; @@ -715,10 +715,14 @@ wyChar * // now change the initial poition. dwlinenumtemp++; dwnewlinepoint = 0; - + // first pad up everything in the new line to spaces. - VerifyMemory(&result, &totalsize, (dwlinenumtemp * dwtitlecount) + extrapad + totalpad, dwtitlecount); - memset(result + (dwlinenumtemp * dwtitlecount) + extrapad + totalpad, ' ', dwtitlecount); + if(ncounter==0 || dwmaxline < dwlinenumtemp ) + { + VerifyMemory(&result, &totalsize, (dwlinenumtemp * dwtitlecount) + extrapad + totalpad, dwtitlecount); + memset(result + (dwlinenumtemp * dwtitlecount) + extrapad + totalpad, ' ', dwtitlecount); + dwmaxline = dwlinenumtemp; + } dwcurrline = dwlinenumtemp; // Now check if there is another \r or \n then we take it as one only. @@ -762,7 +766,9 @@ wyChar * *(result + (dwtitlecount * dwcurrline) + pfieldlenarr[myres->field_count] + totalpad - extrapad) = '\r'; *(result + (dwtitlecount * dwcurrline) + pfieldlenarr[myres->field_count] + 1 + totalpad - extrapad) = '\n'; } - dwlast = (dwtitlecount * dwcurrline) + pfieldlenarr[myres->field_count] + 1 + totalpad - extrapad; + + + dwlast = (dwtitlecount * dwmaxline) + pfieldlenarr[myres->field_count] + 1 + totalpad - extrapad; isfirstline = wyTrue; } diff --git a/src/FrameWindowSplitter.cpp b/src/FrameWindowSplitter.cpp index 7e7b0b0..9702630 100644 --- a/src/FrameWindowSplitter.cpp +++ b/src/FrameWindowSplitter.cpp @@ -31,7 +31,7 @@ FrameWindowSplitter::FrameWindowSplitter(HWND hwnd, wyUInt32 pleftortoppercent) m_lastleftpercent = 0; m_lasttoppercent = 35; m_hwndparent = hwnd; - m_width = 2; //GetSystemMetrics(SM_CXSIZEFRAME) + 1; + m_width = 4; //GetSystemMetrics(SM_CXSIZEFRAME) + 1; m_x = 0; m_prevstyle = 0; m_hdc = NULL; diff --git a/src/GUIHelper.cpp b/src/GUIHelper.cpp index e026259..a83ac9e 100644 --- a/src/GUIHelper.cpp +++ b/src/GUIHelper.cpp @@ -8315,14 +8315,16 @@ ConvertStringToBinary(wyChar *data, wyUInt32 len, wyInt32 colwidth, wyString *s if(!ascii) { isnullchar = wyTrue; + revstr.Replace(0, 0, "00000000"); + isnullchar = wyFalse; continue; } //Adding 0s if NULL character inbetween - if(isnullchar == wyTrue) + /*if(isnullchar == wyTrue) { revstr.Replace(0, 0, "00000000"); isnullchar = wyFalse; - } + }*/ //For handling the BIT column width //if(colwidth > 0) //{ diff --git a/src/TabEditorSplitter.cpp b/src/TabEditorSplitter.cpp index c0b34e6..3b54871 100644 --- a/src/TabEditorSplitter.cpp +++ b/src/TabEditorSplitter.cpp @@ -29,7 +29,7 @@ TabEditorSplitter::TabEditorSplitter(HWND hwnd, wyUInt32 ptoppercent) m_pctabeditor = NULL; m_ischanged = wyFalse; m_isdlgsplitter = wyFalse; - m_height = 2; //GetSystemMetrics(SM_CXSIZEFRAME) + 1; + m_height = 4; //GetSystemMetrics(SM_CXSIZEFRAME) + 1; m_hwndprevfocus = NULL; m_y = 0; m_hdc = NULL; diff --git a/src/UserManager.cpp b/src/UserManager.cpp index 85040a2..2633eca 100644 --- a/src/UserManager.cpp +++ b/src/UserManager.cpp @@ -872,6 +872,11 @@ UserManager::OnWMCommand(WPARAM wparam, LPARAM lparam) m_ispasswordchanged = wyTrue; } + if(LOWORD(wparam)== IDC_USERCOMBO){ + OnHandleEditChange(); + + } + return wyTrue; } @@ -905,8 +910,7 @@ UserManager::OnWMCommand(WPARAM wparam, LPARAM lparam) break; case IDC_USERCOMBO: - - if(HIWORD(wparam) == CBN_SELCHANGE) + if(HIWORD(wparam) == CBN_SELCHANGE) { OnUserComboChange(); } @@ -1357,6 +1361,34 @@ UserManager::OnUserComboChange() OnTreeViewSelChanged(); } +void +UserManager::OnHandleEditChange() +{ + int id; + int len = -1,textlen=-1; + wyWChar str[70] = {0}; + wyWChar textstr[70] = {0}; + HWND hwndusercombo = GetDlgItem(m_hwnd, IDC_USERCOMBO); + len = GetWindowText(hwndusercombo, str, 65); + id = SendMessage(hwndusercombo, CB_SELECTSTRING, -1, (LPARAM)str); + if(id != CB_ERR) + { + if(len==1) + SendMessage(hwndusercombo, CB_SHOWDROPDOWN, FALSE, NULL); + + SendMessage(hwndusercombo, CB_SHOWDROPDOWN, TRUE, NULL); + SetCursor(LoadCursor(NULL, IDC_ARROW)); + SetWindowText(hwndusercombo,str); + SendMessage(hwndusercombo, CB_SETEDITSEL, NULL, MAKELPARAM(len,len)); + } + else + { + SetWindowText(hwndusercombo,str); + SendMessage(hwndusercombo, CB_SETEDITSEL,NULL, MAKELPARAM(len-1,len)); + } + +} + //function shows/hides the respective tree view void UserManager::ShowAllObjects(wyBool show)