From 6cb096f1dc5c37b1147efb8a029302e36eb436d4 Mon Sep 17 00:00:00 2001 From: arvanus Date: Thu, 30 Nov 2023 09:59:51 -0300 Subject: [PATCH 1/5] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 3098d767..15e78f73 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,9 @@ The following people also made a significant non-coding contributions: * Alex Stanciu * Barbara Del Vecchio +Notice: +Now you can download latest Windows snapshot builds directly from the `Build Flamerobin for Windows` Action + License --------------------------- FlameRobin code is licensed under the MIT license. From 1e18b7374e47195a422325f1e32263cff4614ad5 Mon Sep 17 00:00:00 2001 From: Lucas Rubian Schatz Date: Tue, 5 Dec 2023 15:14:16 -0300 Subject: [PATCH 2/5] Update InsertParametersDialog.cpp Fix numeric(x,n) receiving parameter value as integer --- src/gui/InsertParametersDialog.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/InsertParametersDialog.cpp b/src/gui/InsertParametersDialog.cpp index 91fe22ce..09248a4c 100644 --- a/src/gui/InsertParametersDialog.cpp +++ b/src/gui/InsertParametersDialog.cpp @@ -686,6 +686,7 @@ void InsertParametersDialog::OnOkButtonClick(wxCommandEvent& WXUNUSED(event)) row = (*it)-1; IBPP::SDT parameterType = statementM->ParameterType(parameterslist.back()); //statementM->ParameterType(row + 1); int subtype = statementM->ParameterSubtype(parameterslist.back()); + int scale = statementM->ParameterScale(parameterslist.back()); if (sel == ioNull) { @@ -780,6 +781,14 @@ void InsertParametersDialog::OnOkButtonClick(wxCommandEvent& WXUNUSED(event)) statementM->Set(row + 1, (int)d1); break; case IBPP::SDT::sdLargeint: + if (scale != 0) + { + double d3; + if (!value.ToDouble(&d3)) + throw FRError(_("Invalid float numeric value")); + statementM->Set(row + 1, (float)d3); + break; + } wxLongLong_t d2; if (!value.ToLongLong(&d2)) throw FRError(_("Invalid large integer value")); From 3d0187052c69bf290626171a0c2f64726790b683 Mon Sep 17 00:00:00 2001 From: Lucas Rubian Schatz Date: Tue, 5 Dec 2023 15:21:47 -0300 Subject: [PATCH 3/5] IBPP Add RowImpl::ColumnSQLType IBPP Add `int RowImpl::ColumnSQLType(int varnum)` method --- src/gui/ExecuteSqlFrame.cpp | 8 ++++++-- src/ibpp/_ibpp.h | 2 ++ src/ibpp/ibpp.h | 1 + src/ibpp/row.cpp | 12 ++++++++++++ src/ibpp/statement.cpp | 10 ++++++++++ 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/gui/ExecuteSqlFrame.cpp b/src/gui/ExecuteSqlFrame.cpp index b5c6b7e2..1bb2fc79 100644 --- a/src/gui/ExecuteSqlFrame.cpp +++ b/src/gui/ExecuteSqlFrame.cpp @@ -2495,14 +2495,18 @@ bool ExecuteSqlFrame::execute(wxString sql, const wxString& terminator, databaseM->getCharsetConverter())); wxString aliasname(std2wxIdentifier(statementM->ColumnAlias(i), databaseM->getCharsetConverter())); - log(wxString::Format(_("Field #%02d: %s.%s Alias:%s Type:%s"), + log(wxString::Format(_("Field #%02d: %s.%s Alias:%s Type:%s sqlype: %d subtype: %d len: %d scale: %d"), i, tablename.c_str(), colname.c_str(), aliasname.c_str(), IBPPtype2string( databaseM, statementM->ColumnType(i), statementM->ColumnSubtype(i), statementM->ColumnSize(i), - statementM->ColumnScale(i)).c_str() + statementM->ColumnScale(i)).c_str(), + statementM->ColumnSQLType(i), + statementM->ColumnSubtype(i), + statementM->ColumnSize(i), + statementM->ColumnScale(i) ), ttSql); } } diff --git a/src/ibpp/_ibpp.h b/src/ibpp/_ibpp.h index bb6c770d..cacd10de 100644 --- a/src/ibpp/_ibpp.h +++ b/src/ibpp/_ibpp.h @@ -1072,6 +1072,7 @@ class RowImpl : public IBPP::IRow const char* ColumnAlias(int); const char* ColumnTable(int); IBPP::SDT ColumnType(int); + int ColumnSQLType(int); int ColumnSubtype(int); int ColumnSize(int); int ColumnScale(int); @@ -1241,6 +1242,7 @@ class StatementImpl : public IBPP::IStatement const char* ColumnAlias(int); const char* ColumnTable(int); IBPP::SDT ColumnType(int); + int ColumnSQLType(int); int ColumnSubtype(int); int ColumnSize(int); int ColumnScale(int); diff --git a/src/ibpp/ibpp.h b/src/ibpp/ibpp.h index fdd46838..7f52195e 100644 --- a/src/ibpp/ibpp.h +++ b/src/ibpp/ibpp.h @@ -935,6 +935,7 @@ namespace IBPP virtual const char* ColumnAlias(int) = 0; virtual const char* ColumnTable(int) = 0; virtual SDT ColumnType(int) = 0; + virtual int ColumnSQLType(int) = 0; virtual int ColumnSubtype(int) = 0; virtual int ColumnSize(int) = 0; virtual int ColumnScale(int) = 0; diff --git a/src/ibpp/row.cpp b/src/ibpp/row.cpp index 5ab300af..5642bc07 100644 --- a/src/ibpp/row.cpp +++ b/src/ibpp/row.cpp @@ -733,6 +733,18 @@ const char* RowImpl::ColumnTable(int varnum) return var->relname; } +int RowImpl::ColumnSQLType(int varnum) +{ + if (mDescrArea == 0) + throw LogicExceptionImpl("Row::ColumnType", _("The row is not initialized.")); + if (varnum < 1 || varnum > mDescrArea->sqld) + throw LogicExceptionImpl("Row::ColumnType", _("Variable index out of range.")); + + IBPP::SDT value; + XSQLVAR* var = &(mDescrArea->sqlvar[varnum - 1]); + return var->sqltype & ~1; +} + IBPP::SDT RowImpl::ColumnType(int varnum) { if (mDescrArea == 0) diff --git a/src/ibpp/statement.cpp b/src/ibpp/statement.cpp index c6b59a3d..481ac8fb 100644 --- a/src/ibpp/statement.cpp +++ b/src/ibpp/statement.cpp @@ -1474,6 +1474,16 @@ const char* StatementImpl::ColumnTable(int varnum) return mOutRow->ColumnTable(varnum); } +int StatementImpl::ColumnSQLType(int varnum) +{ + if (mHandle == 0) + throw LogicExceptionImpl("Statement::ColumnType", _("No statement has been prepared.")); + if (mOutRow == 0) + throw LogicExceptionImpl("Statement::ColumnType", _("The statement does not return results.")); + + return mOutRow->ColumnSQLType(varnum); +} + IBPP::SDT StatementImpl::ColumnType(int varnum) { if (mHandle == 0) From c58ed7e30e3481e687c0a062a48e72c7f228731d Mon Sep 17 00:00:00 2001 From: Lucas Rubian Schatz Date: Tue, 30 Jan 2024 14:46:00 -0300 Subject: [PATCH 4/5] Update StringUtils.cpp closes #366 when there is a case where the SQL extrapolates the (default) 80 max char col size, and a word with space is wrapped with a quote, and you are in the second line, it'll wrongly wrap to the thirth line breaking the quoted string --- src/core/StringUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/StringUtils.cpp b/src/core/StringUtils.cpp index 02200777..2e12b8b6 100644 --- a/src/core/StringUtils.cpp +++ b/src/core/StringUtils.cpp @@ -259,7 +259,7 @@ wxString wrapText(const wxString& text, size_t maxWidth, size_t indent) if (lastSpace != text.end()) { size_t width = line.Length(); - if (width > maxWidth - indentStr.Length()) + if ((width > maxWidth - indentStr.Length()) && (wrapState == none)) { // remove the last word from this line line.erase(lastSpace - lineStart, it + 1 - lineStart); From e7533b2dab98680a196614b00fb5b3ce94a2be87 Mon Sep 17 00:00:00 2001 From: Lucas Rubian Schatz Date: Tue, 30 Jan 2024 14:50:55 -0300 Subject: [PATCH 5/5] Update ExecuteSqlFrame.cpp --- src/gui/ExecuteSqlFrame.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/ExecuteSqlFrame.cpp b/src/gui/ExecuteSqlFrame.cpp index 1bb2fc79..fd4c479f 100644 --- a/src/gui/ExecuteSqlFrame.cpp +++ b/src/gui/ExecuteSqlFrame.cpp @@ -2503,10 +2503,10 @@ bool ExecuteSqlFrame::execute(wxString sql, const wxString& terminator, statementM->ColumnSubtype(i), statementM->ColumnSize(i), statementM->ColumnScale(i)).c_str(), - statementM->ColumnSQLType(i), - statementM->ColumnSubtype(i), - statementM->ColumnSize(i), - statementM->ColumnScale(i) + statementM->ColumnSQLType(i), + statementM->ColumnSubtype(i), + statementM->ColumnSize(i), + statementM->ColumnScale(i) ), ttSql); } }