Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: MarketSquare/Robotframework-Database-Library
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v.2.1.3
Choose a base ref
...
head repository: MarketSquare/Robotframework-Database-Library
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 6 commits
  • 6 files changed
  • 2 contributors

Commits on Feb 20, 2025

  1. Fix pymysql tests

    amochin committed Feb 20, 2025
    Copy the full SHA
    9aa14a4 View commit details

Commits on Jun 26, 2025

  1. Copy the full SHA
    1cb38a5 View commit details
  2. Bump version to 2.1.4

    amochin committed Jun 26, 2025
    Copy the full SHA
    8f475a8 View commit details

Commits on Jun 27, 2025

  1. fix #243 - parsing SQL scripts with semicolons and escaped single quotes

    amochin committed Jun 27, 2025
    Copy the full SHA
    afdeb6d View commit details
  2. Merge pull request #246 - Fix blob

    amochin authored Jun 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    87fc583 View commit details
  3. Merge pull request #245

    fix #243 - parsing SQL scripts with semicolons and escaped single quotes
    amochin authored Jun 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    f025f71 View commit details
7 changes: 5 additions & 2 deletions src/DatabaseLibrary/query.py
Original file line number Diff line number Diff line change
@@ -346,7 +346,6 @@ def execute_sql_script(
# check if the semicolon is a part of the value (quoted string)
quotes += sqlFragment.count("'")
quotes -= sqlFragment.count("\\'")
quotes -= sqlFragment.count("''")
inside_quoted_string = quotes % 2 != 0
if inside_quoted_string:
sqlFragment += ";" # restore the semicolon
@@ -827,7 +826,11 @@ def _log_query_results(self, col_names, result_rows, log_head: Optional[int] = N
msg += f"<tr{row_style}>"
msg += f'<th scope="row" style="color:{row_index_text_color}; background-color: {row_index_background_color};{cell_border_and_align}">{i}</th>'
for cell in row:
msg += f'<td style="{cell_border_and_align}">{cell}</td>'
try:
cell_string = str(cell)
except TypeError as e:
cell_string = f"Unable printing the value: {e}"
msg += f'<td style="{cell_border_and_align}">{cell_string}</td>'
msg += "</tr>"
msg += "</table>"
if table_truncated:
2 changes: 1 addition & 1 deletion src/DatabaseLibrary/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "2.1.3"
VERSION = "2.1.4"
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
INSERT INTO person VALUES(5, 'Miles', 'O''Brian');
INSERT INTO person VALUES(5, 'Miles', 'O''Brian');
INSERT INTO person VALUES(6, 'Keiko', 'O''Brian');
2 changes: 1 addition & 1 deletion test/tests/common_tests/connection_params.robot
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ Test Teardown Disconnect From Database
... invalid custom param=TypeError: connect() got an unexpected keyword argument 'blah'
&{Errors pymysql}
... missing basic params=OperationalError: (1045, "Access denied*
... invalid custom param=TypeError: Connection.__init__() got an unexpected keyword argument 'blah'
... invalid custom param=REGEXP: TypeError.*__init__.*got an unexpected keyword argument 'blah'
&{Errors pyodbc}
... missing basic params=REGEXP: InterfaceError.*Data source name not found and no default driver specified.*

5 changes: 3 additions & 2 deletions test/tests/common_tests/script_files.robot
Original file line number Diff line number Diff line change
@@ -29,10 +29,11 @@ Semicolons In Values
Semicolons And Quotes In Values
Run SQL Script File semicolons_and_quotes_in_values
${sql}= Catenate select * from person
... where id=5
... where LAST_NAME='O''Brian'
${results}= Query ${sql}
Length Should Be ${results} 1
Length Should Be ${results} 2
Should Be Equal As Strings ${results}[0] (5, 'Miles', "O'Brian")
Should Be Equal As Strings ${results}[1] (6, 'Keiko', "O'Brian")


*** Keywords ***
29 changes: 29 additions & 0 deletions test/tests/custom_db_tests/oracle_blob.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
*** Settings ***
Documentation Tests for querying a table with BLOB data type.
... The data type naming is DB specific, these tests are designed for Oracle DB only.
Resource ../../resources/common.resource

Suite Setup Connect To DB
Suite Teardown Disconnect From Database
Test Setup Execute Sql String
... CREATE TABLE blob_table (id integer not null unique, data blob)
Test Teardown Execute Sql String DROP TABLE blob_table


*** Variables ***
${DB_MODULE} oracledb
${DB_HOST} 127.0.0.1
${DB_PORT} 1521
${DB_PASS} pass
${DB_USER} db_user
${DB_NAME} db
${ORACLE_LIB_DIR} ${EMPTY}


*** Test Cases ***
Blob Data Type - Logging Results Causes No Error
[Documentation] See https://github.com/MarketSquare/Robotframework-Database-Library/issues/244
${binary_data}= Evaluate b'abc'
Execute Sql String INSERT INTO blob_table VALUES(1, '${binary_data}')
${result}= Query SELECT data FROM blob_table WHERE id=1