Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sql id changes #363

Closed
wants to merge 3 commits into from
Closed

Conversation

venkatsridhar95
Copy link
Collaborator

@venkatsridhar95 venkatsridhar95 commented Aug 22, 2023

Changes to retrieve sql_id from Oracle. This will be added as part of the EXEC CAL message. It would be easier to map SQLHash -> Oracle sql_id

Note: The flag (OCI_PREP2_GET_SQL_ID) used is newly introduced and is not backward compatible with the 11g client.

@venkatsridhar95 venkatsridhar95 marked this pull request as ready for review August 22, 2023 02:13
Copy link
Collaborator

@shtiencode shtiencode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to remove DO_OCI_HANDLE_FREE macro and real_oci_handle_free() given that OCIHandleFree() is avoided when using OCIStmtPrepare2() per oracle doc, it looks dead code here.

@venkatsridhar95
Copy link
Collaborator Author

We need real_oci_handle_free() for other handles (service context handle, error handle, and a few others). Stmt handle alone will use OCIStmtRelease()

@shtiencode
Copy link
Collaborator

We need real_oci_handle_free() for other handles (service context handle, error handle, and a few others). Stmt handle alone will use OCIStmtRelease()

Got it, thanks. Perhaps add a comment around the macro not to use for statement handle.

Copy link
Collaborator

@shtiencode shtiencode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good.

@venkatsridhar95
Copy link
Collaborator Author

Pls do not merge. I'll move the existing main to the internal mirror before merging this PR.

errhp);
if (rc2 != OCI_SUCCESS) {
WRITE_LOG_ENTRY(logfile, LOG_DEBUG, "error getting sql_id");
sql_error(rc2, stmt);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked and believe we are logging and continuing

@@ -1042,7 +1043,7 @@ int OCCChild::handle_command(const int _cmd, std::string &_line)

OCIAttrSet((dvoid *)authp, OCI_HTYPE_SESSION, (dvoid *) const_cast<char*>(m_scuttle_id.c_str()),
m_scuttle_id.length(), OCI_ATTR_CLIENT_INFO, errhp);

sql_id_str = ""; // Reset sql_id_str before execute
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps do in PREPARE with m_bind_data.clear()

@venkatsridhar95 venkatsridhar95 marked this pull request as draft August 23, 2023 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants