Skip to content

Commit

Permalink
SQLyog 13.1.9 GA
Browse files Browse the repository at this point in the history
  • Loading branch information
sandhyawy committed Feb 8, 2022
1 parent 51d3964 commit 1b241cf
Show file tree
Hide file tree
Showing 13 changed files with 915 additions and 564 deletions.
81 changes: 41 additions & 40 deletions include/CommonHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
#define NCP_UTF16 3
#define NCP_ASCII 4

#define FMT_SPACE_4 " "
#define FMT_SPACE_4 " "

#define REGKEY "Provide any UUID here"

Expand All @@ -82,8 +82,8 @@
#define CPI_LATIN2 28592
#define CPI_SWE7 20107
#define CPI_ASCII 20127
#define CPI_UJIS 51932
#define CPI_SJIS 932
#define CPI_UJIS 51932
#define CPI_SJIS 932
#define CPI_HEBREW 28598
#define CPI_TIS620 874
#define CPI_EUCKR 51949
Expand Down Expand Up @@ -152,7 +152,7 @@ class SelectedObjects: public wyElem
enum fkeyOption
{
NOOPTION = 0, //if no option selected for ON DELETE or ON UPDATE
CASCADE = 1,
CASCADE = 1,
SETNULL = 2,
NOACTION = 3,
RESTRICT = 4
Expand Down Expand Up @@ -213,7 +213,7 @@ wyBool EndTransaction(Tunnel *tunnel, MYSQL *mysql);
*/
bool ReConnectSSH(ConnectionInfo *coninfo);

#ifdef WIN32
#ifdef WIN32
///Create SSH session
/**
@param coninfo : IN ConnectionInfo pointer
Expand Down Expand Up @@ -275,10 +275,10 @@ void GetTimeString(wyString& buff, wyChar *timesep);
@param extension : IN File extension
@param bufferlength : IN Buffer length
@param buffer : OUT Pointer to the buffer that receives the path and file name of the file found.
@param lpfileport : OUT Pointer to the variable that receives the address (within buffer) of the last component of the valid path and file name, which is the address of the character immediately following the final backslash (\) in the path.
@param lpfileport : OUT Pointer to the variable that receives the address (within buffer) of the last component of the valid path and file name, which is the address of the character immediately following the final backslash (\) in the path.
@returns wyTrue if successful else wyFalse
*/
wyBool SearchFilePath(wyWChar *filename, wyWChar *extension, wyInt32 bufferlength,
wyBool SearchFilePath(wyWChar *filename, wyWChar *extension, wyInt32 bufferlength,
wyWChar *buffer, wyWChar **lpfileport);

/// Copies table from new to old
Expand Down Expand Up @@ -317,7 +317,7 @@ wyInt32 GetBodyOfTrigger(wyString *body );
@param definer : OUT definer
@returns wyTrue on success else wyFalse
*/
wyBool GetCreateTriggerString(HWND hwnd , Tunnel * tunnel, PMYSQL mysql, const wyChar *db,
wyBool GetCreateTriggerString(HWND hwnd , Tunnel * tunnel, PMYSQL mysql, const wyChar *db,
const wyChar *trigger, wyString &strtrigger, wyString &strmsg, wyBool isdefiner = wyFalse);
#endif

Expand All @@ -326,7 +326,7 @@ wyBool GetCreateTriggerString(HWND hwnd , Tunnel * tunnel, PMYSQL mysql, const
@param tunnel : IN Tunnel pointer
@param mysql : IN Pointer to mysql pointer
@param strmsg : OUT The SELECT stmt
@returns void
@returns void
*/
void GetError(Tunnel * tunnel, PMYSQL mysql, wyString &strmsg);

Expand All @@ -341,7 +341,7 @@ void GetError(Tunnel * tunnel, PMYSQL mysql, wyString &strmsg);
@param queryex : OUT query
@returns wyTrue on success else wyFalse
*/
wyBool GetCreateFunctionString(Tunnel * tunnel, PMYSQL mysql, const wyChar *db, const wyChar * function,
wyBool GetCreateFunctionString(Tunnel * tunnel, PMYSQL mysql, const wyChar *db, const wyChar * function,
wyString &strfunction, wyString &strmsg, wyString *queryex = NULL);

/// Gets the CREATE PROCEDURE string
Expand All @@ -355,7 +355,7 @@ wyBool GetCreateFunctionString(Tunnel * tunnel, PMYSQL mysql, const wyChar *db,
@param queryex : OUT query
@returns wyTrue on success else wyFalse
*/
wyBool GetCreateProcedureString(Tunnel * tunnel, PMYSQL mysql, const wyChar *db, const wyChar *procedure,
wyBool GetCreateProcedureString(Tunnel * tunnel, PMYSQL mysql, const wyChar *db, const wyChar *procedure,
wyString &strprocedure, wyString &strmsg, wyString *queryex = NULL);
/// Gets the CREATE EVENT string
/**
Expand All @@ -368,11 +368,11 @@ wyBool GetCreateProcedureString(Tunnel * tunnel, PMYSQL mysql, const wyChar *db
@param queryex : OUT query
@returns wyTrue on success else wyFalse
*/
wyBool GetCreateEventString(Tunnel * tunnel, PMYSQL mysql, const wyChar *db, const wyChar *event,
wyBool GetCreateEventString(Tunnel * tunnel, PMYSQL mysql, const wyChar *db, const wyChar *event,
wyString &strevent, wyString &strmsg, wyString *queryex);


/// This function gets only the REAL comment, strips of Foreign Key definitions, etc
/// This function gets only the REAL comment, strips of Foreign Key definitions, etc
/**
@param comment : OUT Comment statement
@returns comment string
Expand All @@ -395,7 +395,7 @@ wyBool GetCharsetString(wyString &charsetstring);
@param whereclause : IN WHERE clause to consider while counting rows
@returns the row count
*/
wyUInt32 GetRowCount(Tunnel *tunnel, MYSQL *mysql, const wyChar *db ,
wyUInt32 GetRowCount(Tunnel *tunnel, MYSQL *mysql, const wyChar *db ,
const wyChar *table, const wyChar * whereclause);


Expand All @@ -408,10 +408,10 @@ wyUInt32 GetRowCount(Tunnel *tunnel, MYSQL *mysql, const wyChar *db ,
@param strcreate : OUT The CREATE statement
@returns wyTrue on success else wyFalse
*/
wyBool GetCreateTableString(Tunnel * tunnel, PMYSQL pmysql, const wyChar *db,
wyBool GetCreateTableString(Tunnel * tunnel, PMYSQL pmysql, const wyChar *db,
const wyChar* tbl, wyString &strcreate, wyString &query);

/// Reverses the given string
/// Reverses the given string
/**
@param text : IN/OUT Text to change
@returns void
Expand Down Expand Up @@ -494,7 +494,7 @@ wyChar *AllocateBuff(wyInt32 size);
*/
wyChar *RewAllocateBuff(wyChar *buff, wyInt32 size);

/// Creates a tunnel
/// Creates a tunnel
/**
@param istunnel : IN tunneling or not.
@returns a instance of the Tunnel(Child) class
Expand All @@ -516,7 +516,7 @@ wyBool CheckSQLyogFiles(const wyWChar *filename);
@param extension : IN File extension
@returns wyTrue on success else wyFalse
*/
wyBool CheckFileExists(wyWChar *buffer, const wyWChar *path, const wyWChar *filename,
wyBool CheckFileExists(wyWChar *buffer, const wyWChar *path, const wyWChar *filename,
const wyWChar *extension);

/// Gets the field inforamtion
Expand All @@ -528,10 +528,10 @@ wyBool CheckFileExists(wyWChar *buffer, const wyWChar *path, const wyWChar *fil
@param tgtmysql : IN Pointer to target mysql pointer
@returns void
*/
void GetFieldInfoString(Tunnel *tunnel, MYSQL_RES *myres,
void GetFieldInfoString(Tunnel *tunnel, MYSQL_RES *myres,
wyString &strcreate, Tunnel *tgttunnel, PMYSQL tgtmysql);

/// Check for presence of ON UPDATE statement
/// Check for presence of ON UPDATE statement
/**
@param strcreate : IN CREATE statement
@param fieldpos : IN Field position
Expand Down Expand Up @@ -618,7 +618,7 @@ wyInt32 EncodeBase64(const wyChar *inp, size_t insize, wyChar **outptr);
/// Decodes a string
/**
@param dest : OUT Destination
@param src : IN Source
@param src : IN Source
@returns void
*/
void DecodeQuantum(wyUChar *dest, const wyChar *src);
Expand All @@ -632,9 +632,9 @@ void DecodeQuantum(wyUChar *dest, const wyChar *src);
void ExtractEngineName(wyChar *engine, wyString &enginename);


/// Checks whether the engine is listed in the list
/// Checks whether the engine is listed in the list
/**
@param engine : IN engine name
@param engine : IN engine name
@returns wyBool, wyTrue if exists, otherwise wyFalse
*/
wyBool IsSupportedEngine(wyString &enginename);
Expand All @@ -643,7 +643,7 @@ wyBool IsSupportedEngine(wyString &enginename);
/**
@param tunnel : IN Tunnel pointer
@param mysql : IN Mysql pointer
@param strengine: OUT engines seperated be semicolon(;)
@param strengine: OUT engines seperated be semicolon(;)
*/
void GetTableEngineString(Tunnel *tunnel, PMYSQL mysql, wyString &strengine);

Expand Down Expand Up @@ -707,7 +707,7 @@ wyBool GetForeignKeyInfo(wyString *showcreate,
void ExamineData(wyString &codepage, wyString &buffer);
#endif

///
///
wyBool CheckForUtf8(wyString &pBuffer);
wyInt32 DetectFileFormat(wyChar *pBuffer, wyInt32 pBytesRead, wyInt32 *pHeaderSize);

Expand Down Expand Up @@ -752,8 +752,8 @@ wyBool GetMySqlDataType(MysqlDataType *rettypedata, MYSQL_FIELD *fields, wyInt32
*/
wyInt32 DeletePrivateProfileString(wyChar *strkey, wyChar *section, wyChar *filename);

wyInt32 HandleMySQLRealQuery(Tunnel *tunnel, MYSQL * mysql, const char * query,
unsigned long length, bool isbadforxml, bool batch = false,
wyInt32 HandleMySQLRealQuery(Tunnel *tunnel, MYSQL * mysql, const char * query,
unsigned long length, bool isbadforxml, bool batch = false,
bool isend = false, bool * stop = 0, bool isread = false, bool fksethttpimport = false);

/// Executes an SQL query specified as a counted string.
Expand All @@ -778,7 +778,7 @@ void GetColLength(MYSQL_ROW row, wyInt32 numcols, wyInt32 col, wyUInt32 *len);

///Gets all parsed infos of a foreign key and insert into a struct
/**
@param fkeyinfo : IN sting contains a f-key details
@param fkeyinfo : IN sting contains a f-key details
@param fkeyparam : OUT struct loads with F-key details parsed from 'key'
@return wyTrue for success, else wyFalse
*/
Expand All @@ -801,15 +801,15 @@ wyBool GetParentTable(wyString *fkeyinfo, wyString *parenttable, wyString* par
*/
wyBool GetConstraintName(wyString *fkeyinfo, wyString *constraintname);

///Gets the parent table fields involved in relationship
///Gets the parent table fields involved in relationship
/**
@param fkeyinfo : IN Foreign key infos
@param fkeyparam : OUT struct used to store all parsed infos in F-key details
@return wyTrue while success , else wyFalse
*/
wyBool GetParentTableFlds(wyString *fkeyinfo, LFKEYINFOPARAM fkeyparam);

///Gets the child table fields involved in relationship
///Gets the child table fields involved in relationship
/**
@param fkeyinfo : IN Foreign key infos
@param fkeyparam : OUT struct used to store all parsed infos in F-key details
Expand All @@ -821,14 +821,14 @@ wyBool GetChildTableFlds(wyString *fkeyinfo, LFKEYINFOPARAM fkeyparam);
/**
@param fkeyinfo : IN Foreign key infos
@param fkeyparam : OUT struct used to store all parsed infos in F-key details
@param isupdate : IN default parameter, wyTrue for ON UPDATE , wyFalse for ON DELETE
@param isupdate : IN default parameter, wyTrue for ON UPDATE , wyFalse for ON DELETE
@return NoOption ON DELETE is not selectd, or Cascade/SetNull/NoAction/Restrict , according to the one selected
*/
fkeyOption GetOnFkeyOption(wyString *fkeyinfo, LFKEYINFOPARAM fkeyparam, wyBool isupdate = wyTrue);
//free up the memory .
/**
@param list : IN linked list reference.
@return
@return
*/
void ReleaseMemory(List *list);

Expand Down Expand Up @@ -862,7 +862,7 @@ void ExecuteInitCommands(MYSQL* mysql, Tunnel* tunnel, wyString& initcommands

/// Gets the field inforamtion of the view
/**
@param buffer : IN / OUT Buffer
@param buffer : IN / OUT Buffer
@param tunnel : IN Tunnel pointer
@param view : IN View name
@param res : IN Mysql result pointer
Expand All @@ -874,7 +874,7 @@ wyBool DumpViewStruct(wyString * buffer, Tunnel * tunnel, const wyChar *
/**
@param tunnel : IN Tunnel pointer
@param mysql : IN Mysql pointer
@param tablename : IN table name
@param tablename : IN table name
@param dbname : IN database name
&param strengine : OUT function stores the Engine name to this wyString variable
@return wyTrue if it success else return wyFalse
Expand Down Expand Up @@ -904,7 +904,7 @@ wyBool InitWinSock();
*/
//#if ! defined COMMUNITY && defined _WIN32
#if defined _WIN32
wyBool LockPlinkLockFile(wyFile *plinklock);
wyBool LockPlinkLockFile(wyFile *plinklock);
#endif

#ifdef _WIN32
Expand Down Expand Up @@ -1007,6 +1007,9 @@ void RemoveDefaultIntWidth(wyString &datatypestr);

void RemovePattern(wyString &text, const wyChar* pattern);


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

//void DebugLog(const char *buffer);
#ifdef _WIN32
void WriteLog(const wyChar* str);
Expand All @@ -1021,7 +1024,7 @@ class ConvertString
ConvertString();
~ConvertString();

/// Converts the input(wide) string to Utf8
/// Converts the input(wide) string to Utf8
/**
@param widestr : IN widestring to convert
@returns utf8 string
Expand All @@ -1031,12 +1034,12 @@ class ConvertString
/// converts input (utf8) string to widechar
/**
@param utf8str : IN utf8 string to convert
@retuns wide string
@retuns wide string
*/
wyWChar* ConvertUtf8ToWideChar(wyChar *utf8str);

wyWChar * ConvertAnsiToWideChar(wyChar* ansistr);
wyChar* Utf8toAnsi(const wyChar *utf8, wyInt32 len);
wyChar* Utf8toAnsi(const wyChar *utf8, wyInt32 len);

private:
/// utf8 buffer
Expand All @@ -1052,5 +1055,3 @@ class ConvertString
#endif // _win32

#endif


7 changes: 7 additions & 0 deletions include/FrameWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,13 @@ class FrameWindow
*/
void OnWmMenuCommand(HWND hwnd, WPARAM wparam, LPARAM lparam);

// replace all /n with /r/n in the given string
/**
@param value : IN string that needs formatting
@returns void
*/
void FormatStringFromDatabase(wyString &value);

/// Handles WM_MENUSELECT message, changes the status bar information on mouse over change
/**
@param menuid : IN Menu id
Expand Down
6 changes: 6 additions & 0 deletions include/MySQLVersionHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,15 @@ for virtual columns Persistent->Stored
*/
wyBool IsMariaDB10309(Tunnel * tunnel, PMYSQL mysql);

//MariaDB 10.5.2 for new privileges
wyBool IsMariaDB100502(Tunnel * tunnel, PMYSQL mysql);

//MySQL 5.7.0 for Virtual/Stored columns
wyBool IsMySQL57(Tunnel * tunnel, PMYSQL mysql);

//MySQL 5.7.6 or above for Alter/Create User query
wyBool IsMySQL576(Tunnel * tunnel, PMYSQL mysql);

//MySQL 5.7.3 EXPLAIN EXTENDED is removed
wyBool IsMySQL573(Tunnel * tunnel, PMYSQL mysql);

Expand Down
21 changes: 21 additions & 0 deletions include/UserManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,13 @@ class UserManager
*/
wyBool GetServerPrivsForRoutine();

// Function checks for the privilege in privilege array and returns its index
/**
@param value : IN privilege to be searched
@returns the index of privilege
*/
wyInt32 GetPrivilegeIndex(wyString& value);

///Function identifies all the privileges given in the first parameter and stores the currusponding mapping index in the second parameter
/**
@param value : IN string to parse
Expand Down Expand Up @@ -573,6 +580,12 @@ class UserManager
*/
wyBool ApplyLimitations();

///Function executes the query required to apply the limiations for newly added user
/**
@returns wyTrue on success else wyFalse
*/
wyBool CreateOrAlterUserWithResourceLimitaions(wyString& tempuser, wyString& temphost, wyString& tempauthplugin, wyString& temppassword, wyBool passwordchanged);

///Helper function used to execute various queries in User Manager
/**
@param query : IN query to be executed
Expand Down Expand Up @@ -662,6 +675,8 @@ class UserManager

void SetResetDBContext(wyBool isset);

wyBool CheckHiddenPrivelegeMariaDB100502(wyChar* priv);

private:

USERLIST *m_userlist;
Expand All @@ -672,6 +687,12 @@ class UserManager
//static array to hold the mysql privileges and currusponding column names till date
static wyChar* m_privmapping[];

//static array to hold new mariadb privileges introduced in version 10.5.2
static wyChar* m_mariadb_100502_priv[];

//static array to hold mariadb privileges that are renamed or divided from version 10.5.2
static wyChar* m_mariadb_100502_hide_priv[];

//dialog handle
HWND m_hwnd;

Expand Down
Loading

0 comments on commit 1b241cf

Please sign in to comment.