Skip to content

Commit

Permalink
SQLyog 13.2.0 GA
Browse files Browse the repository at this point in the history
  • Loading branch information
sandhyawy committed Dec 12, 2022
1 parent 1b241cf commit c3dd825
Show file tree
Hide file tree
Showing 24 changed files with 272 additions and 136 deletions.
2 changes: 1 addition & 1 deletion include/AppInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

#define SQLITE_APPVERSION_MAJOR "10"
#define SQLITE_APPVERSION_MINOR "5"
#define COMPANY_COPYRIGHT "(c) 2001-2021 Webyog Inc."
#define COMPANY_COPYRIGHT "(c) 2001-2022 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)
Expand Down
4 changes: 4 additions & 0 deletions include/CommonHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
#define WAIT_TIMEOUT_SERVER "28800"
#define PROCEDURE_FUNC_ERRMSG _("Unable to retrieve information. Please check your privileges. For routines (stored procedures and functions) you need SELECT privilege to mysql.proc if you are not the owner of the routines.")

#define AZURE_ENDPOINT "database.azure.com"

#define CPI_BIG5 950
#define CPI_CP850 850
#define CPI_KOI8R 20866
Expand Down Expand Up @@ -1010,6 +1012,8 @@ void RemovePattern(wyString &text, const wyChar* pattern);

void SetSslAuthentication(MYSQL *mysql, ConnectionInfo *conninfo);

wyUInt32 GetConnectionId(Tunnel *tunnel, MYSQL *mysql);

//void DebugLog(const char *buffer);
#ifdef _WIN32
void WriteLog(const wyChar* str);
Expand Down
13 changes: 12 additions & 1 deletion include/FrameWindowHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@ All Files(*.*)\0*.*\0"
#define SIZE_192 192
#define SIZE_256 256
#define SIZE_512 512
#define SIZE_1024 1024
#define SIZE_1024 1024
#define SIZE_2048 2048
#define SIZE_5120 (20*1024)

#define CURRENT_TIMESTAMP "CURRENT_TIMESTAMP"
Expand Down Expand Up @@ -977,6 +978,16 @@ wyBool IsColumnSet(Tunnel * tunnel, MYSQL_RES * myfieldres, MYSQL_RES * res, co
*/
wyBool IsColumnPrimary(Tunnel * tunnel, MYSQL_RES * myfieldres, wyChar * column);

/// Searches for the column name in the virtual fields res
/**
@param tunnel : IN Mysql tunnel pointer
@param myfieldres : IN Mysql result set
@param column : IN Column name
@returns wyTrue if set else wyFalse
*/
wyBool
IsFieldVirtual(Tunnel *tunnel, MYSQL_RES *myfieldres, wyString& column);

/// Whether there is a primary key for the table or not.
/**
@param tunnel : IN Tunnel Pointer.
Expand Down
3 changes: 3 additions & 0 deletions include/Global.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,9 @@ struct ConnectionInfo
wyBool m_isInfoOpen;

wyUInt32 m_isencrypted;

wyBool m_isazuredb;
wyUInt32 m_connection_id;

};

Expand Down
2 changes: 2 additions & 0 deletions include/MDIWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,8 @@ class MDIWindow
/// Stop query execution
void StopQueryExecution();

void ResetStopQueryExecution();

///CHecking if currenet execution stopped or not
/**
@return wyTrue if stopped/not executing anything, or return wyFalse
Expand Down
1 change: 1 addition & 0 deletions include/Tunnel.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class Tunnel
virtual void SetDB ( const char * db ) = 0;
virtual void SetBatchEnd ( bool end ) = 0;
virtual void EmptyQueryBuffer () = 0;
virtual void ClearXMLDoc() = 0;
virtual bool GetMySQLVersion ( MYSQL * mysql ) = 0;

virtual int mysql_real_query ( MYSQL * mysql, const char * q, unsigned long length, bool isbadforxml, bool batch = false,
Expand Down
1 change: 1 addition & 0 deletions include/TunnelCommunity.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class TunnelCommunity : public Tunnel
void SetDB ( const char * db );
void SetBatchEnd ( bool end ) {}
void EmptyQueryBuffer ();
void ClearXMLDoc();
bool GetMySQLVersion ( MYSQL * mysql );

int mysql_real_query ( MYSQL * mysql, const char * q, unsigned long length, bool isbadforxml,
Expand Down
4 changes: 2 additions & 2 deletions include/Version.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define MAJOR_VERSION_INT 13
#define MINOR_VERSION_INT 1
#define UPDATE_VERSION_INT 9
#define MINOR_VERSION_INT 2
#define UPDATE_VERSION_INT 0
#define RELEASE_VERSION_INT 0
#define EXTRAINFO ""
70 changes: 51 additions & 19 deletions src/CommonHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1120,25 +1120,29 @@ CheckForOnUpdate(wyString &strcreate, wyInt32 fieldpos)
free(create);
return find;
}

wyBool GetExpressionValue(wyChar * currentrow, wyString * expression)
{
wyChar * find="AS";
wyBool found=wyFalse;
const char *ptr = strstr(currentrow,find);
if(ptr) {
found=wyTrue;
int index = ptr - currentrow+2;
while(currentrow[index]!='S'&& currentrow[index]!='P'&& currentrow[index]!='V' )
{
expression->AddSprintf("%c",currentrow[index]);

index++;
}
}
wyString rowstr(currentrow);
wyChar * find = "AS";
wyBool found = wyFalse;
int startpos = -1;
int endpos = -1;

startpos = rowstr.FindI("AS");
if (startpos == -1)
return found;

return found;
startpos = startpos + 3; //length of AS and space.

if (((endpos = rowstr.FindI("VIRTUAL")) != -1) || ((endpos = rowstr.FindI("STORED")) != -1) || ((endpos = rowstr.FindI("PERSISTENT")) != -1)) {
expression->SetAs(rowstr.Substr(startpos, endpos - startpos));
found = wyTrue;
}
return found;

}

wyBool GetCheckConstraintValue(wyChar * currentrow, wyString * expression)
{
if (currentrow == NULL)
Expand Down Expand Up @@ -4261,6 +4265,7 @@ InitConnectionDetails(ConnectionInfo *conn)
conn->m_rgbfgconn = RGB(0, 0, 0);
#endif

conn->m_no_ca = wyFalse;
return;
}

Expand Down Expand Up @@ -4379,11 +4384,11 @@ IsDatatypeNumeric(wyString &datatype)
}

//Checks whether the datatype belongs to the deprecated numeric size datatypes or not
//We are not considering tinyint as MySQL returns display width for tinyint. It is an exceptional case.
wyBool
IsDatatypeDeprecatedSizeType(wyString &datatype)
{
if (!(
datatype.CompareI("tinyint") == 0 ||
if (!(datatype.CompareI("tinyint") == 0 ||
datatype.CompareI("smallint") == 0 ||
datatype.CompareI("mediumint") == 0 ||
datatype.CompareI("int") == 0 ||
Expand Down Expand Up @@ -4710,7 +4715,7 @@ RemovePattern(wyString &text, const wyChar* pattern)

re = pcre_compile(
pattern, /* the pattern */
PCRE_UTF8 | PCRE_CASELESS | PCRE_NEWLINE_CR,/* default options */ //match is a case insensitive
PCRE_UTF8 | PCRE_CASELESS | PCRE_NEWLINE_CR,/* default options */ //match is a case insensitive
&error, /* for error message */
&erroffset, /* for error offset */
NULL); /* use default character tables */
Expand Down Expand Up @@ -4747,9 +4752,9 @@ RemovePattern(wyString &text, const wyChar* pattern)

}

void
void
SetSslAuthentication(MYSQL *mysql, ConnectionInfo *conninfo)
{
{
/// SSL Connection if ssl is selected
if (conninfo->m_issslchecked == wyTrue)
{
Expand Down Expand Up @@ -4779,3 +4784,30 @@ SetSslAuthentication(MYSQL *mysql, ConnectionInfo *conninfo)
}
}
}

wyUInt32
GetConnectionId(Tunnel *tunnel, MYSQL *mysql)
{
MYSQL_RES *myres;
MYSQL_ROW myrow;
wyString query;
wyString idstr;
wyUInt32 conectionid = 0;
query.SetAs("SELECT CONNECTION_ID()");
myres = SjaExecuteAndGetResult(tunnel, &mysql, query);
if (!myres)
{
//collation.SetAs("latin1");
return wyFalse;
}

myrow = sja_mysql_fetch_row(tunnel, myres);

if (myrow[0])
idstr.SetAs(myrow[0]);

if (myres)
sja_mysql_free_result(tunnel, myres);

return idstr.GetAsInt32();
}
6 changes: 3 additions & 3 deletions src/ConnectionBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ ConnectionBase::OnInitDialog(HWND hwnd, LPARAM lparam)
// also sets the maximum text which can be entered into the value fields.
SendMessage(GetDlgItem(hwnd, IDC_DLGCONNECT_HOST), EM_LIMITTEXT, 255, 0);
SendMessage(GetDlgItem(hwnd, IDC_DLGCONNECT_USER), EM_LIMITTEXT, 255, 0);
SendMessage(GetDlgItem(hwnd, IDC_DLGCONNECT_PASSWORD), EM_LIMITTEXT, 255, 0);
SendMessage(GetDlgItem(hwnd, IDC_DLGCONNECT_PASSWORD), EM_LIMITTEXT, SIZE_2048, 0);
SendMessage(GetDlgItem(hwnd, IDC_DLGCONNECT_PORT), EM_LIMITTEXT, 5, 0);
SendMessage(GetDlgItem(hwnd, IDC_TIMEOUTEDIT), EM_LIMITTEXT, 6, 0);
SendMessage(GetDlgItem(hwnd, IDC_PINGINTERVAL), EM_LIMITTEXT, 6, 0);
Expand Down Expand Up @@ -1557,7 +1557,7 @@ ConnectionBase::GetInitialDetails(HWND hdlg)
wyString timeout, conn, dirstr, pwdstr, tempstr, isencrypted;
wyString codepage, userstr, hoststr, portstr, dbstr;
wyWChar directory[MAX_PATH+1]={0}, *lpfileport=0;
wyChar pwd[SIZE_512]={0};
wyChar pwd[SIZE_2048]={0};
wyBool decodepwd = wyTrue;
wyUInt32 ret, usecompress = 1, isdefwaittimeout = 1, readonly = 0/*, usecleartext = 0*/;
ConnectionInfo conninfo;
Expand Down Expand Up @@ -2629,7 +2629,7 @@ void
ConnectionBase::SaveServerDetails(HWND hwnd, const wyChar *conn, const wyChar *directory)
{
wyInt32 ret = 1, value = 1;
wyWChar temp[SIZE_1024] = {0};
wyWChar temp[SIZE_2048] = {0};
wyString tempstr, isencrypted;

// Server Host
Expand Down
8 changes: 4 additions & 4 deletions src/ConnectionCommunity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ ConnectionCommunity::ConnectToMySQL(HWND hdlg, ConnectionInfo *coninfo)
wyUInt32 portno, client=0;
wyInt32 ret;
wyWChar host[SIZE_512]={0}, user[SIZE_512]={0}, timeout[32] = {0};
wyWChar pwd[SIZE_512]={0}, port[10]={0};
wyWChar pwd[SIZE_2048]={0}, port[10]={0};
MYSQL *mysql, *temp;
wyString strinitcommand;

Expand All @@ -396,7 +396,7 @@ ConnectionCommunity::ConnectToMySQL(HWND hdlg, ConnectionInfo *coninfo)
ret = SendMessage(GetDlgItem(hdlg, IDC_DLGCONNECT_HOST), WM_GETTEXT,(WPARAM)SIZE_512-1, (LPARAM)host);
ret = SendMessage(GetDlgItem(hdlg, IDC_DLGCONNECT_USER), WM_GETTEXT,(WPARAM)SIZE_512-1, (LPARAM)user);
ret = SendMessage(GetDlgItem(hdlg, IDC_DLGCONNECT_PORT), WM_GETTEXT,(WPARAM)9, (LPARAM)port);
ret = SendMessage(GetDlgItem(hdlg, IDC_DLGCONNECT_PASSWORD), WM_GETTEXT,(WPARAM)SIZE_512-1, (LPARAM)pwd);
ret = SendMessage(GetDlgItem(hdlg, IDC_DLGCONNECT_PASSWORD), WM_GETTEXT,(WPARAM)SIZE_2048-1, (LPARAM)pwd);

portno = _wtoi(port);

Expand Down Expand Up @@ -488,7 +488,7 @@ ConnectionCommunity::OnConnect(HWND hwnd, ConnectionInfo * dbname)
MYSQL *mysql;
HWND lastfocus = GetFocus();
wyString conn, temp, dirnamestr;
wyWChar directory[MAX_PATH + 1] = {0}, *lpfileport = 0, pass[MAX_PATH + 1] = {0};
wyWChar directory[MAX_PATH + 1] = {0}, *lpfileport = 0, pass[SIZE_2048] = {0};
HWND hwndcombo;
wyInt32 count, storepwd, ret;

Expand Down Expand Up @@ -567,7 +567,7 @@ ConnectionCommunity::OnConnect(HWND hwnd, ConnectionInfo * dbname)
}
else
{
GetWindowText(GetDlgItem(hwnd, IDC_DLGCONNECT_PASSWORD), pass, MAX_PATH);
GetWindowText(GetDlgItem(hwnd, IDC_DLGCONNECT_PASSWORD), pass, SIZE_2048);
temp.SetAs(pass);
EncodePassword(temp);
wyChar *encodestr = temp.EncodeBase64Password();
Expand Down
2 changes: 1 addition & 1 deletion src/CustGrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3249,7 +3249,7 @@ CCustGrid::DrawRowColumns(HDC hdcmem, PRECT rect, PRECT rectwin, wyUInt32 *totcx
if(temprowlist)
rect->right = rect->right + temprowlist->rowcx;
}
else if(pgvcolnode && pgvcolnode->isshow == wyTrue)
else // if(pgvcolnode && pgvcolnode->isshow == wyTrue)
{
rect->top = rect->top + m_hight;
rect->bottom = rect->top + m_hight;
Expand Down
Loading

0 comments on commit c3dd825

Please sign in to comment.