mirror of
https://github.com/levinsv/pgadmin3.git
synced 2026-05-21 06:45:27 -06:00
fix warning clang
This commit is contained in:
parent
2cde1c04f4
commit
2583f616d9
3 changed files with 11 additions and 11 deletions
|
|
@ -1047,9 +1047,6 @@ bool pgConn::IsAlive()
|
||||||
|
|
||||||
int pgConn::GetStatus() const
|
int pgConn::GetStatus() const
|
||||||
{
|
{
|
||||||
if (!this)
|
|
||||||
return PGCONN_BAD;
|
|
||||||
|
|
||||||
if (conn)
|
if (conn)
|
||||||
((pgConn *)this)->connStatus = PQstatus(conn);
|
((pgConn *)this)->connStatus = PQstatus(conn);
|
||||||
|
|
||||||
|
|
@ -1246,7 +1243,7 @@ bool pgConn::TableHasColumn(wxString schemaname, wxString tblname, const wxStrin
|
||||||
if (schemaname.IsEmpty())
|
if (schemaname.IsEmpty())
|
||||||
schemaname = wxT("public");
|
schemaname = wxT("public");
|
||||||
|
|
||||||
if (this && GetStatus() == PGCONN_OK)
|
if (GetStatus() == PGCONN_OK)
|
||||||
{
|
{
|
||||||
tblname.Replace(wxT("\\"), wxT("\\\\"));
|
tblname.Replace(wxT("\\"), wxT("\\\\"));
|
||||||
tblname.Replace(wxT("'"), wxT("''"));
|
tblname.Replace(wxT("'"), wxT("''"));
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,7 @@ wxSize GetBestSize(wxGrid& grid,
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Draw(wxGrid& grid, wxGridCellAttr& attr, wxDC& dc,
|
void Draw(wxGrid& grid, wxGridCellAttr& attr, wxDC& dc,
|
||||||
const wxRect& rect, int row, int col, bool isSelected);
|
const wxRect& rect, int row, int col, bool isSelected) wxOVERRIDE;
|
||||||
CursorCellRenderer(int thous_pixel_sep);
|
CursorCellRenderer(int thous_pixel_sep);
|
||||||
private:
|
private:
|
||||||
int thousands_pixel_sep;
|
int thousands_pixel_sep;
|
||||||
|
|
|
||||||
|
|
@ -972,16 +972,16 @@ int FormatterSQL::ParseSql(int flags) {
|
||||||
vi.txt = tmp;
|
vi.txt = tmp;
|
||||||
vi.type = keyword;
|
vi.type = keyword;
|
||||||
vi.flags = flg;
|
vi.flags = flg;
|
||||||
if (tmp == "from" && i2 >= 2) {
|
if (tmp == "from" && i2 >= 2) { // special case "distinct from" this no "from"
|
||||||
wxString s = items[items.size() - 2].txt;
|
wxString s = items[items.size() - 2].txt;
|
||||||
if (s.Len() >= 8 && s.substr(s.Len() - 8).CmpNoCase("distinct") == 0) {
|
if (s.Len() >= 8 && s.substr(s.Len() - 8).CmpNoCase("distinct") == 0) {
|
||||||
vi.flags = 0;
|
vi.flags = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (keyEntities[n].name == "case") {
|
if (strcmp(keyEntities[n].name,"case") == 0) {
|
||||||
bracket.push(items.size());
|
bracket.push(items.size());
|
||||||
}
|
}
|
||||||
else if (keyEntities[n].name == "end") {
|
else if (strcmp(keyEntities[n].name,"end") == 0) {
|
||||||
int idx = -1;
|
int idx = -1;
|
||||||
if (bracket.size() > 0) {
|
if (bracket.size() > 0) {
|
||||||
idx = bracket.top();
|
idx = bracket.top();
|
||||||
|
|
@ -994,14 +994,17 @@ int FormatterSQL::ParseSql(int flags) {
|
||||||
vi.endlevel = idx;
|
vi.endlevel = idx;
|
||||||
if (idx != -1) items[idx].endlevel = items.size();
|
if (idx != -1) items[idx].endlevel = items.size();
|
||||||
|
|
||||||
} else if (keyEntities[n].name == "then"||
|
} else if (strcmp(keyEntities[n].name, "then")== 0 ||
|
||||||
keyEntities[n].name == "loop" ) { // for plpgsql
|
strcmp(keyEntities[n].name,"loop") == 0 ) { // for plpgsql query without ";"
|
||||||
// if ... then
|
// if ... then
|
||||||
// while ... loop or for .. in query loop
|
// while ... loop or for .. in query loop
|
||||||
|
|
||||||
|
// special break parse query ONLY recurse level == 0
|
||||||
if (bracket.size() == 0) {
|
if (bracket.size() == 0) {
|
||||||
i=i+tmp.Len()-1;
|
i=i+tmp.Len()-1; // skip stop keyword
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
//
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i += tmp.Len() - 1;
|
i += tmp.Len() - 1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue