Skip to content

Commit

Permalink
SQLyog 12.3.3 GA
Browse files Browse the repository at this point in the history
  • Loading branch information
wyaadarsh committed Dec 26, 2016
1 parent 16126c5 commit afb3ec8
Show file tree
Hide file tree
Showing 12 changed files with 99 additions and 17 deletions.
11 changes: 11 additions & 0 deletions include/FrameWindowHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
#pragma once
#endif

#define IS_FROM_WINDOWS_STORE 0

// #defines of character constants for better readability using in lexer and editing things.
#define C_TAB '\t'
#define C_SPACE ' '
Expand Down Expand Up @@ -394,7 +396,12 @@ All Files(*.*)\0*.*\0"
#define DEFAULT_NO_TABLE _("(Read Only)")
#define DEFAULT_NO_TABLEW _(L"(Read Only)")
#define DEFAULT_READONLY_RESULT _(L"Read-only result")
#define BUYLABEL "Buy SQLyog"
#if IS_FROM_WINDOWS_STORE == 1
#define BUYURL "https://www.webyog.com/product/sqlyogpricing/?utm_source=sqlyogapp&utm_medium=referral&utm_campaign=windowsstore"
#else
#define BUYURL "http://www.webyog.com/product/sqlyogpricing"
#endif
#define BUYURL_POWERTOOLS "http://www.webyog.com/product/sqlyogpricing/?ref=community.powertools"
////#define BUYURL_NAGBEGIN "http://www.webyog.com/product/sqlyogpricing/?ref=community.nagbegin"
#define BUYURL_TOOLBARRIBBON "http://www.webyog.com/product/sqlyogpricing/?ref=community.toolbarribbon"
Expand All @@ -406,7 +413,11 @@ All Files(*.*)\0*.*\0"
#define BUYURL_BUYNAGEND "http://www.webyog.com/product/sqlyogpricing/?ref=community.buynagend"
#define SUPPORTURL "https://www.webyog.com/customer?ref=sqlyog"

#if IS_FROM_WINDOWS_STORE == 1
#define BUYENT "https://www.webyog.com/product/sqlyogpricing/?utm_source=sqlyogapp&utm_medium=referral&utm_campaign=windowsstore"
#else
#define BUYENT "http://www.webyog.com/product/sqlyogpricing"
#endif
#define IMAGEURL "http://www.webyog.com"
#define PRODUCTURL "https://www.webyog.com/product/sqlyog"
#define COMMUNITYURL "https://www.webyog.com/community"
Expand Down
2 changes: 2 additions & 0 deletions include/MySQLVersionHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ wyBool IsMySQL553(Tunnel * tunnel, PMYSQL mysql);
wyBool IsMySQL5510(Tunnel * tunnel, PMYSQL mysql);
//MySQL 5.5.0
wyBool IsMySQL5500(Tunnel * tunnel, PMYSQL mysql);
//MySQL 5.6.0
wyBool IsMySQL5600(Tunnel * tunnel, PMYSQL mysql);
//MySQL 5.6.3
wyBool IsMySQL563(Tunnel * tunnel, PMYSQL mysql);

Expand Down
2 changes: 1 addition & 1 deletion include/Version.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define MAJOR_VERSION_INT 12
#define MINOR_VERSION_INT 3
#define UPDATE_VERSION_INT 2
#define UPDATE_VERSION_INT 3
#define RELEASE_VERSION_INT 0
#define EXTRAINFO ""
6 changes: 4 additions & 2 deletions src/ExportAsSQL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3169,8 +3169,10 @@ MySQLDump::OnFlushMaster()
{
wyString query;
MYSQL_RES *res;

query.SetAs("FLUSH MASTER");
if(IsMySQL5600(m_tunnel, &m_mysql) == wyTrue)
query.SetAs("RESET MASTER");
else
query.SetAs("FLUSH MASTER");

res = SjaExecuteAndGetResult(m_tunnel, &m_mysql, query);

Expand Down
6 changes: 6 additions & 0 deletions src/FrameWindowHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ wyInt32 my_query(MDIWindow *wnd, Tunnel * tunnel, PMYSQL mysql, const wyChar *qu
if(transactioncheck != -1 && !wnd->m_ptransaction->m_starttransactionenabled && wnd->m_ptransaction->m_autocommit)
{
wnd->m_ptransaction->CallOnCommit();
if(wnd->m_ptransaction->m_implicitcommit)
{
wnd->m_ptransaction->m_implicitcommit = wyFalse;
recstr.SetAs(_("An implicit commit occurred"));
my_queryprofile(wnd, 1, recstr.GetString(), wyTrue);
}
}
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/GUIHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8251,7 +8251,7 @@ SetParanthesisHighlighting(HWND hwnd)
void
EnableFolding(HWND hwnd)
{
COLORREF forecolor = RGB(0,0,0), backcolor = COLOR_WHITE, texturecolor=COLOR_WHITE;
COLORREF forecolor = RGB(0,0,0), backcolor = COLOR_WHITE, texturecolor=COLOR_WHITE;
wyWChar *lpfileport = 0;
wyWChar directory[MAX_PATH+1] = {0};

Expand All @@ -8262,7 +8262,7 @@ EnableFolding(HWND hwnd)

forecolor = wyIni::IniGetInt(GENERALPREFA, "FoldingMarginFgColor", RGB(0,0,0), dirstr.GetString());
backcolor = wyIni::IniGetInt(GENERALPREFA, "FoldingMarginbackgroundColor", DEF_MARGINNUMBER, dirstr.GetString());
texturecolor= wyIni::IniGetInt(GENERALPREFA, "FoldingMarginTextureColor", COLOR_WHITE, dirstr.GetString());
texturecolor= wyIni::IniGetInt(GENERALPREFA, "FoldingMarginTextureColor", COLOR_WHITE, dirstr.GetString());
}
SendMessage(hwnd, SCI_SETPROPERTY, (WPARAM)"fold", (LPARAM)"1");
SendMessage(hwnd, SCI_SETPROPERTY, (WPARAM)"fold.comment", (LPARAM)"1");
Expand Down
1 change: 1 addition & 0 deletions src/ImportBatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ ImportBatch::OnWMCommand(HWND hwnd, WPARAM wParam)
{
wyString query;
query.Sprintf("COMMIT");
wnd->m_ptransaction->m_implicitcommit = wyTrue;
ExecuteAndGetResult(wnd, wnd->m_tunnel, &wnd->m_mysql, query, wyFalse, wyFalse, wyTrue, false, false, wyFalse, 0, wyFalse, &isintransaction);

if(isintransaction == 1)
Expand Down
1 change: 1 addition & 0 deletions src/MDIWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3287,6 +3287,7 @@ wyInt32 isintransaction = 1;
{
wyString query;
query.Sprintf("COMMIT");
pcquerywnd->m_ptransaction->m_implicitcommit = wyTrue;
ExecuteAndGetResult(pcquerywnd, pcquerywnd->m_tunnel, &pcquerywnd->m_mysql, query, wyFalse, wyFalse, wyTrue, false, false, wyFalse, 0, wyFalse, &isintransaction);

if(isintransaction == 1)
Expand Down
12 changes: 12 additions & 0 deletions src/MySQLVersionHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,18 @@ IsMySQL5500(Tunnel * tunnel, PMYSQL mysql)
return wyFalse;
}

wyBool
IsMySQL5600(Tunnel * tunnel, PMYSQL mysql)
{
long me = mysql_get_server_version(*mysql);/* Only available from MySQLv4.1*/
const char *dbString = mysql_get_server_info(*mysql);

if(me >= 50600 && !strstr(dbString, "MariaDB"))
return wyTrue;
else
return wyFalse;
}

wyBool
IsMySQL563(Tunnel *tunnel, PMYSQL mysql)
{
Expand Down
46 changes: 40 additions & 6 deletions src/OtherDialogs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1910,6 +1910,8 @@ CCopyTable::FillData()
return wyTrue;
}

// If ANSI_QUOTES global value is set....double quotes will be resulting in an error

// Function to prepare the query to copy the table and execute it.
wyBool
CCopyTable::DoCopy()
Expand All @@ -1920,7 +1922,6 @@ CCopyTable::DoCopy()
MYSQL_RES *res;
wyWChar newtable[SIZE_512]={0};
wyChar *tbuff;

if(SendMessage(GetDlgItem(m_hwnd, IDC_TABLENAME), WM_GETTEXTLENGTH, 0, 0)== 0)
{
yog_message(m_hwnd, _(L"Please give a table name"),
Expand Down Expand Up @@ -2270,15 +2271,29 @@ wyBool
CCopyTable::GetKeysPrimeKeyCheck(MYSQL_ROW *myrow, MYSQL_RES *myres, wyString &primary)
{
wyBool flgprimary = wyFalse;

primary.Add("primary key(");
wyBool ismysql553 ;
wyString comment;
ismysql553= IsMySQL553(m_tunnel,m_mysql);
wyInt32 flag = 0;
comment.SetAs("");

while(*myrow = m_tunnel->mysql_fetch_row(myres))
{
if(stricmp((*myrow)[GetFieldIndex(myres,"key_name", m_tunnel, m_mysql)], "primary") == 0)
{
primary.AddSprintf("`%s`", (*myrow)[GetFieldIndex(myres,"column_name", m_tunnel, m_mysql)]);

if(flag == 0)
{
flag++;
if(ismysql553)
{
if((*myrow)[GetFieldIndex(myres,"Index_comment", m_tunnel, m_mysql)])
comment.SetAs((*myrow)[GetFieldIndex(myres,"Index_comment", m_tunnel, m_mysql)]);
}
}

if((*myrow)[GetFieldIndex(myres,"sub_part", m_tunnel, m_mysql)])
primary.AddSprintf("(%s),", (*myrow)[GetFieldIndex(myres,"sub_part", m_tunnel, m_mysql)]);
else
Expand All @@ -2298,7 +2313,10 @@ CCopyTable::GetKeysPrimeKeyCheck(MYSQL_ROW *myrow, MYSQL_RES *myres, wyString &p
else
primary.Clear();

return flgprimary;
if(comment.GetLength() != 0)
primary.AddSprintf(" Comment \"%s\" ", comment.GetString());

return flgprimary;
}

wyBool
Expand All @@ -2321,11 +2339,14 @@ CCopyTable::GetKeysOtherIndex(MYSQL_ROW *myrow, MYSQL_RES *myres, wyString &inde
{
wyInt32 ftindex;
wyString tempindex, myrowstr, myrowstr1;
wyBool flgindex = wyFalse, ismysql41 = IsMySQL41(m_tunnel, m_mysql);

wyBool flgindex = wyFalse, ismysql41 = IsMySQL41(m_tunnel, m_mysql), ismysql553= IsMySQL553(m_tunnel,m_mysql);
wyString comment;

while(*myrow)
{
flgindex = wyTrue;
comment.SetAs("");

tempindex.SetAs((*myrow)[GetFieldIndex(myres, "key_name", m_tunnel, m_mysql)], (GetActiveWin())->m_ismysql41);

if(IsMySQL402(m_tunnel, m_mysql))
Expand All @@ -2343,6 +2364,12 @@ CCopyTable::GetKeysOtherIndex(MYSQL_ROW *myrow, MYSQL_RES *myres, wyString &inde
index.AddSprintf("%s `%s`(",((stricmp(myrowstr1.GetString(), "0")==0)?("UNIQUE"): (!myrowstr.CompareI("SPATIAL") ? "SPATIAL KEY" : "KEY")), tempindex.GetString());
}

if(ismysql553)
{
if((*myrow)[GetFieldIndex(myres,"Index_comment", m_tunnel, m_mysql)])
comment.SetAs((*myrow)[GetFieldIndex(myres,"Index_comment", m_tunnel, m_mysql)]);
}

while(1)
{
myrowstr.SetAs((*myrow)[GetFieldIndex(myres, "column_name", m_tunnel, m_mysql)], ismysql41);
Expand All @@ -2364,7 +2391,10 @@ CCopyTable::GetKeysOtherIndex(MYSQL_ROW *myrow, MYSQL_RES *myres, wyString &inde
if((*myrow) && (tempindex.Compare(myrowstr1.GetString()) != 0))
{
index.Strip(1);
index.Add("), ");
index.Add(")");
if(comment.GetLength() != 0)
index.AddSprintf(" Comment \"%s\" ", comment.GetString());
index.Add(", ");
break;
}
}
Expand All @@ -2375,6 +2405,8 @@ CCopyTable::GetKeysOtherIndex(MYSQL_ROW *myrow, MYSQL_RES *myres, wyString &inde
{
index.Strip(1);
index.Add(")");
if(comment.GetLength() != 0)
index.AddSprintf(" Comment \"%s\" ", comment.GetString());
}
else
index.Clear();
Expand Down Expand Up @@ -4505,6 +4537,7 @@ EmptyDB::OnWmCommand(WPARAM wParam)
break;

case IDOK:

ret = EmptyDatabase();

if(ret)
Expand Down Expand Up @@ -4555,6 +4588,7 @@ EmptyDB::EmptyDatabase()
{
wyString query;
wyInt32 isintransaction = 1;
wnd->m_ptransaction->m_implicitcommit = wyTrue;
query.Sprintf("COMMIT");
ExecuteAndGetResult(wnd, m_tunnel, m_mysql, query, wyFalse, wyFalse, wyTrue, false, false, wyFalse, 0, wyFalse, &isintransaction);

Expand Down
7 changes: 7 additions & 0 deletions src/TabFields.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5138,6 +5138,13 @@ TabFields::ExchangeRowValues(wyInt32 row1, wyInt32 row2)
GetGridCellData(m_hgridfields, row2, COMMENT_, data2);
CustomGrid_SetText(m_hgridfields, row1, COMMENT_, data2.GetString());
CustomGrid_SetText(m_hgridfields, row2, COMMENT_, data1.GetString());

//on Update value

boolval1 = CustomGrid_GetBoolValue(m_hgridfields, row1, ONUPDATECT);
boolval2 = CustomGrid_GetBoolValue(m_hgridfields, row2, ONUPDATECT);
CustomGrid_SetBoolValue(m_hgridfields, row1, ONUPDATECT, boolval2 ? GV_TRUE : GV_FALSE);
CustomGrid_SetBoolValue(m_hgridfields, row2, ONUPDATECT, boolval1 ? GV_TRUE : GV_FALSE);
}

//..Row Long Data
Expand Down
18 changes: 12 additions & 6 deletions src/TabIndexes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ TabIndexes::FetchIndexValuesIntoWrapper()
else if(isfulltext)
iindex->m_indextype.SetAs("FULLTEXT");
else
iindex->m_indextype.SetAs("");
iindex->m_indextype.SetAs("KEY");

listindcols = NULL;

Expand Down Expand Up @@ -405,7 +405,7 @@ TabIndexes::FetchIndexValuesIntoWrapper()
else if(isfulltext)
iindex->m_indextype.SetAs("FULLTEXT");
else
iindex->m_indextype.SetAs("");
iindex->m_indextype.SetAs("KEY");
}
m_mdiwnd->m_tunnel->mysql_free_result(myres);

Expand All @@ -420,7 +420,7 @@ TabIndexes::InitGrid()
GVCOLUMN gvcol; // structure used to create columns for grid
wyChar *heading[] = { _("Index Name"), _("Columns"), _("Index Type"), _("Comment")};
wyInt32 mask[] = { GVIF_TEXT, GVIF_TEXTBUTTON , GVIF_LIST, GVIF_TEXT};
wyWChar type[][20] = { L"UNIQUE", L"PRIMARY", L"FULLTEXT"};
wyWChar type[][20] = { L"UNIQUE", L"PRIMARY", L"FULLTEXT", L"KEY"};
VOID *listtype[] = { NULL, NULL, (VOID*)type, NULL};
wyInt32 elemsize[] = {0, 10, sizeof(type[0]), 0 };
wyInt32 elemcount[] = {0, 8, sizeof(type)/sizeof(type[0]), 0 };
Expand Down Expand Up @@ -2317,7 +2317,7 @@ TabIndexes::GenerateCreateQuery(wyString &query)
{
wyBool flag = wyTrue;
wyUInt32 rowcount = 0;
wyString indexnamestr, columnsstr, indextypestr, indexstr;
wyString indexnamestr, columnsstr, indextypestr, indexstr, indexcomment;
wyString tempstr;
rowcount = CustomGrid_GetRowCount(m_hgridindexes);
IndexesStructWrapper *indwrap = NULL;
Expand All @@ -2332,6 +2332,9 @@ TabIndexes::GenerateCreateQuery(wyString &query)
GetGridCellData(m_hgridindexes, row, INDEXNAME, indexnamestr);
GetGridCellData(m_hgridindexes, row, INDEXCOLUMNS, columnsstr);
GetGridCellData(m_hgridindexes, row, INDEXTYPE, indextypestr);

if(m_ismysql553)
GetGridCellData(m_hgridindexes, row, INDEXCOMMENT, indexcomment);

if((!indexnamestr.GetLength()) && (!columnsstr.GetLength()))
continue;
Expand All @@ -2345,7 +2348,7 @@ TabIndexes::GenerateCreateQuery(wyString &query)
indextypestr.SetAs("index");
else
{
if(indextypestr.CompareI("primary") != 0)
if(indextypestr.CompareI("primary") != 0 && indextypestr.CompareI("key") != 0 )
indextypestr.Add(" index");
}

Expand All @@ -2365,6 +2368,9 @@ TabIndexes::GenerateCreateQuery(wyString &query)
indexstr.AddSprintf("\r\n %s (%s)", indextypestr.GetString(), columnsstr.GetString());
}

if(indexcomment.GetLength())
indexstr.AddSprintf(" Comment \"%s\" ", indexcomment.GetString());

indexstr.Add(",");

//..Appending error message
Expand Down Expand Up @@ -2472,7 +2478,7 @@ TabIndexes::GetNewAndModifiedIndexes(wyString &query, wyBool execute)
indextypestr.SetAs("index");
else
{
if(indextypestr.CompareI("primary") != 0)
if(indextypestr.CompareI("primary") != 0 && indextypestr.CompareI("key") != 0 )
indextypestr.Add(" index");
}

Expand Down

0 comments on commit afb3ec8

Please sign in to comment.