This commit is contained in:
Sergey 2022-04-15 02:35:54 +05:00
parent 91a1160e13
commit 1e6d5b9be9
10 changed files with 267 additions and 11 deletions

1
.gitignore vendored
View file

@ -20,3 +20,4 @@ x64/Release_(3.0)/*.txt
*.pdb
ctl/ctlMonitorWidget.cpp
include/ctl/ctlMonitorWidget.h
build/*

21
.vscode/c_cpp_properties.json vendored Normal file
View file

@ -0,0 +1,21 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}",
"/usr/include/libxml2",
"/usr/include/pgsql/server",
"/usr/include/wx-3.1"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu17",
"cppStandard": "c++17",
"intelliSenseMode": "linux-gcc-x64",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}

62
CMakeLists.txt Normal file
View file

@ -0,0 +1,62 @@
cmake_minimum_required(VERSION 3.0.0)
project(pgAdmin3 VERSION 1.24.0)
include_directories(. include)
add_compile_definitions(WX_PRECOMP)
add_compile_definitions(WX_PRECOMP)
add_compile_definitions(wxUSE_UNICODE)
add_compile_definitions(EMBED_XRC)
#add_compile_definitions(EMBED_XRC)
SET(GCC_COVERAGE_COMPILE_FLAGS "-Wdeprecated-declarations")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
file(GLOB_RECURSE SOURCES
src/*.c*
agent/*.c*
ctl/*.c*
db/*.c*
dd/*.c* debugger/*.c* dlg/*.c* frm/*.c*
gqb/*.c*
hotdraw/*.c* ogl/*.c* pgscript/*.c*
pro_scheduler/*.c* schema/*.c* slony/*.c* ui/*.c* utils/*.c*
)
##########################################################
find_package(LibXml2 REQUIRED)
if(NOT LIBXML2_FOUND)
message(SEND_ERROR "Failed to find LibXml2")
return()
else()
include_directories(${LIBXML2_INCLUDE_DIR})
endif()
find_package(wxWidgets REQUIRED)
if(NOT wxWidgets_FOUND)
message(SEND_ERROR "Failed to find wxWidgets")
return()
else()
message(STATUS "wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}" )
include(${wxWidgets_USE_FILE})
include_directories(${wxWidgets_INCLUDE_DIRS})
link_libraries(${wxWidgets_LIBRARIES})
endif()
find_package(PostgreSQL REQUIRED)
if(NOT wxWidgets_FOUND)
message(SEND_ERROR "Failed to find PostgreSql")
return()
else()
include(${wxWidgets_USE_FILE})
include_directories(${PostgreSQL_INCLUDE_DIRS})
include_directories(${PostgreSQL_INCLUDE_DIRS}/server)
link_libraries(${PostgreSQL_LIBRARIES})
endif()
#include(CTest)
#enable_testing()
add_executable(pgAdmin3 pgAdmin3.cpp ${SOURCES})
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
#include(CPack)

164
config.h Normal file
View file

@ -0,0 +1,164 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <arpa/inet.h> header file. */
#define HAVE_ARPA_INET_H 1
/* disabled non-blocking sockets */
/* #undef HAVE_DISABLED_NONBLOCKING */
/* Define to 1 if you have the <errno.h> header file. */
#define HAVE_ERRNO_H 1
/* Define to 1 if you have the `EVP_aes_128_ctr' function. */
/* #undef HAVE_EVP_AES_128_CTR */
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* use FIONBIO for non-blocking sockets */
/* #undef HAVE_FIONBIO */
/* Define to 1 if you have the `gethostbyname' function. */
#define HAVE_GETHOSTBYNAME 1
/* Define to 1 if you have the `inet_ntoa' function. */
#define HAVE_INET_NTOA 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* use ioctlsocket() for non-blocking sockets */
/* #undef HAVE_IOCTLSOCKET */
/* use Ioctlsocket() for non-blocking sockets */
/* #undef HAVE_IOCTLSOCKET_CASE */
/* Define if you have the gcrypt library. */
/* #undef HAVE_LIBGCRYPT */
/* Define if you have the ssl library. */
/* #undef HAVE_LIBSSL */
/* Define if you have the z library. */
/* #undef HAVE_LIBZ */
/* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1
/* Define to 1 if you have the <netdb.h> header file. */
#define HAVE_NETDB_H 1
/* Define to 1 if you have the <netinet/in.h> header file. */
#define HAVE_NETINET_IN_H 1
/* Compile libssh2 with OpenSSL support */
/* #undef HAVE_OPENSSL_CRYPTO */
/* use O_NONBLOCK for non-blocking sockets */
#define HAVE_O_NONBLOCK 1
/* use SO_NONBLOCK for non-blocking sockets */
/* #undef HAVE_SO_NONBLOCK */
/* Define to 1 if stdbool.h conforms to C99. */
#define HAVE_STDBOOL_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdio.h> header file. */
#define HAVE_STDIO_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strchr' function. */
#define HAVE_STRCHR 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#define HAVE_SYS_IOCTL_H 1
/* Define to 1 if you have the <sys/select.h> header file. */
#define HAVE_SYS_SELECT_H 1
/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/uio.h> header file. */
#define HAVE_SYS_UIO_H 1
/* Define to 1 if you have the <sys/un.h> header file. */
#define HAVE_SYS_UN_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if the system has the type `_Bool'. */
#define HAVE__BOOL 1
/* Compile in zlib support */
/* #undef LIBSSH2_HAVE_ZLIB */
/* Use libgcrypt */
/* #undef LIBSSH2_LIBGCRYPT */
/* Compile libssh2 with OpenSSL support */
/* #undef LIBSSH2_OPENSSL */
/* Name of package */
#define PACKAGE "pgadmin3"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "pgadmin-support@postgresql.org"
/* Define to the full name of this package. */
#define PACKAGE_NAME "pgadmin3"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "pgadmin3 1.23.0-dev"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "pgadmin3"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.23.0-dev"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Version number of package */
#define VERSION "1.23.0-dev"
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */

View file

@ -486,7 +486,7 @@ int ctlSQLGrid::Copy(int gensql)
copied = copied + (y2 - y1 + 1);
}
if (generatesql > 1) {
auto &g = m.getmap();
auto g = m.getmap();
wxArrayInt cols;
int maxr = g.size();
int i = 1;
@ -522,7 +522,7 @@ int ctlSQLGrid::Copy(int gensql)
{
wxGridCellCoords& coords = cord[n];
//wxString msg;
//msg.Printf(wxT("Координаты выбраных ячеек row=%d col=%d.\n"), coords.GetRow(), coords.GetCol());
//msg.Printf(wxT("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> row=%d col=%d.\n"), coords.GetRow(), coords.GetCol());
//wxMessageBox(msg, wxT("About coord"), wxOK | wxICON_INFORMATION, this);
int r = coords.GetRow();
if (r == curr_row) {
@ -876,7 +876,7 @@ int recurse(ctlSQLGrid *g, int pos,int row, double &transfer) {
//
lastnode=0;
if (text.at(p)=='-') {
// посчитаем время работы узла
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
double m=1;
// -> Nested Loop (cost=205.13..273.44 rows=4 width=188) (actual time=13.157..13.157 rows=0 loops=1)
wxRegEx foundstr(wxT("actual time=.*?\\.\\.([0-9.]+).*?loops=([0-9]+)\\)"),wxRE_ADVANCED);
@ -899,7 +899,7 @@ int recurse(ctlSQLGrid *g, int pos,int row, double &transfer) {
continue;
} if (p<pos) {
// end level
// leveltime содержит время сумаррное время работы узлов этого уровня
// leveltime <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
transfer=leveltime;
return row;
} if (p>pos) {

View file

@ -30,6 +30,11 @@
*/
#define PG_KEYWORD(a,b,c) {a,c},
const ScanKeyword ScanKeywords[] = {
#ifdef WIN32
#else
#define PG_KEYWORD(a,b,c,d) {a,c},
#endif
#include <parser/kwlist.h>
};
const int NumScanKeywords = lengthof(ScanKeywords);

View file

@ -55,7 +55,7 @@ public:
wxString GetRowLabelValue( int row );
void SetRowGroup(int row);
GroupRows *grp;
int generatesql; // 0 -íåò, 1 - insert , 2 - in_list
int generatesql; // 0 -<EFBFBD><EFBFBD><EFBFBD>, 1 - insert , 2 - in_list
wxString sqlquerytext;
WX_DECLARE_STRING_HASH_MAP( int, ColKeySizeHashMap );
@ -95,7 +95,7 @@ public:
// default group open
rowsGroup[rowgroup]=-rowgroup;
//beg[rowgroup]=rowgroup;
wxASSERT(lastrowgroup>end.Count()," out of bounds");
wxASSERT_MSG(lastrowgroup>end.Count()," out of bounds");
end[rowgroup]=lastrowgroup;
run[rowgroup]=actualtime;
};

View file

@ -140,11 +140,11 @@ private:
int Match_Distance;
protected:
//reportCompareFactory(menuFactoryList *list) : actionFactory(list) {}
wxString reportCompareFactory::GetNodePath(wxTreeItemId node);
wxString GetNodePath(wxTreeItemId node);
wxString ApplyCompareOpts(wxString sql, int metatype);
wxWindow *StartDialog(frmMain *form, pgObject *obj);
void reportCompareFactory::GetExpandedChildNodes(wxTreeItemId node, wxArrayString &expandedNodes, ArraySQL &list,time_t *t,wxBusyInfo *w, MyHashSQL &h_path,int lvl);
std::wstring reportCompareFactory::printdiff(std::wstring str1, std::wstring str2 );
void GetExpandedChildNodes(wxTreeItemId node, wxArrayString &expandedNodes, ArraySQL &list,time_t *t,wxBusyInfo *w, MyHashSQL &h_path,int lvl);
std::wstring printdiff(std::wstring str1, std::wstring str2 );
wxString printlvl(int element,int lvl,ArraySQL &list, wxHashTable &htab);
frmMain *GetFrmMain()
{

View file

@ -1,5 +1,5 @@
#pragma once
#include "wx\dataview.h"
#include "wx/dataview.h"
#include "wx/wx.h"
#include "Storage.h"
class MyDataViewCtrl :

View file

@ -19,8 +19,11 @@
* Diff Match and Patch
* http://code.google.com/p/google-diff-match-patch/
*/
#if WIN32
#include "pgadmin3.h"
#else
#include "pgAdmin3.h"
#endif
#ifndef DIFF_MATCH_PATCH_H_
#define DIFF_MATCH_PATCH_H_