-
Notifications
You must be signed in to change notification settings - Fork 681
Update oracledb_session.rb #5193
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
Conversation
Update format_options for sqlplus to support all versions. Reference: Issue 5182
|
Deploy preview for chef-inspec failed. Built with commit 546501e https://app.netlify.com/sites/chef-inspec/deploys/5fbbbe92cad75300076f7c7c |
|
Hello pacopal! Thanks for the pull request! Here is what will happen next:
Thank you for contributing! |
Update format_options for sqlplus to support all versions. Reference: Issue 5182 Signed-off-by: pacopal <fpalomares@hotmail.com>
|
Hi @pacopal - that seems like reasonable enough of a PR to me. It does look like you have some spec failures with your change that might be worth looking at : https://buildkite.com/chef-oss/inspec-inspec-master-verify/builds/2268 |
|
Hello @pacopal , Any thoughts what might be causing these issues? https://buildkite.com/chef-oss/inspec-inspec-master-verify/builds/2268#32f87fdf-1936-4e04-aec5-356941ecbb57 |
|
Hi, Extract: That I fail to understand why such case condition would be needed in the Resource... Maybe to raise an exception if a failed command string has been generated? Should I change it? |
|
@Schwad Hi, I have pushed the code change also for the Test Units. I hope this helps... |
Schwad
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @pacopal - sorry for the delay! 😅 Things are looking good, I approved the rest of the tests. If this passes, would you be able to squash your commits? Thanks!
|
:bump: does this just need a fresh rebase - the update to the resource would be useful for my teams as well. |
@aaronlippold - a fresh rebase would be okay but this is currently only blocked as we're awaiting the commits being squashed |
|
We are also seeing some odd issues with RDS instances as well ... I will either create a new issue or add to this one |
|
Hi. |
|
@pacopal yes - the one outstanding item for you is to squash this from 6 commits into 1 commit. If you would like more guidance around how git squashing works just let me know and I'll help you out |
Update format_options for sqlplus to support all versions. Reference: Issue 5182 Signed-off-by: Francisco Palomares <fpalomares@hotmail.com> Fixed Test Unit to compare with new values
|
@Schwad |
|
The test errors - due to rspec version changing the text output of "falsey" - have nothing to do with your PR. This can merge. |
Description
Running inspec from the database servers and using oracledb_session will fail, when the database server version is 12.1 or 11g. This is because the sqlplus version installed in the database servers will match with the database versions.
oracledb_session is using the following format options:
format_options = "SET MARKUP CSV ON\nSET PAGESIZE 32000\nSET FEEDBACK OFF"
Unfortunately "SET MARKUP CSV ON" was introduced in sqlplus version 12.2.0.1. So prior versions will miss it.
Reference:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqprn/index.html#SQPRN-GUID-98CEF1F8-FB5A-495F-8771-693546655613
The workaround provided by this PR is to replace the format options with a more generic set:
format_options = "SET PAGESIZE 32000\nSET FEEDBACK OFF\nSET UNDERLINE OFF"
Related Issue
oracledb_session doesnt work with sqlplus 12.1 or lower.
Types of changes
Checklist: