Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/DatabaseLibrary/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,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:
Expand Down
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"
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