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

HammerDB CLI issue with Changing MsSQLs ODBC Driver #118

Closed
ivedw opened this issue Apr 6, 2020 · 3 comments · Fixed by #119
Closed

HammerDB CLI issue with Changing MsSQLs ODBC Driver #118

ivedw opened this issue Apr 6, 2020 · 3 comments · Fixed by #119

Comments

@ivedw
Copy link

ivedw commented Apr 6, 2020

When trying to replicate the GUI workflow I have used on the CLI, when I try to change the driver in the connection setting, with the command:

diset connection mssqls_odbc_driver {ODBC Driver 17 for SQL Server}

I get the following error:

Clearing Script, reload script to activate new setting
Script cleared
Error: Driver script must be either "test" or "timed"

I noticed this is same error given when I try to change the value in the "tpcc" part of the dict that is similar: "mssqls_driver".

I think the problem might be that the variable checking logic from the tpcc driver item might be crossed with the connection part of the dict.

Thanks

@sm-shaw
Copy link
Contributor

sm-shaw commented Apr 7, 2020

Hi, yes confirmed as a bug. It is checking if the driver has been changed by matching "*driver" and then picking this up for this particular variable that clashes. A fix will be added to the next version. As a workaround you can run the following instead and set the value directly (it is advisable to drag the command window out a big larger so the line does not overlap when typing).

hammerdb>dict set configmssqlserver connection mssqls_odbc_driver {ODBC Driver 17 for SQL Server}
connection {mssqls_server (local) mssqls_linux_server localhost mssqls_tcp false mssqls_port 1433 mssqls_azure false mssqls_authentication windows mssqls_linux_authent sql mssqls_odbc_driver {ODBC Driver 17 for SQL Server} mssqls_linux_odbc {ODBC Driver 17 for SQL Server} mssqls_uid sa mssqls_pass admin} tpcc {mssqls_count_ware 1 mssqls_num_vu 1 mssqls_dbase tpcc mssqls_imdb false mssqls_bucket 1 mssqls_durability SCHEMA_AND_DATA mssqls_total_iterations 1000000 mssqls_raiseerror false mssqls_keyandthink false mssqls_checkpoint false mssqls_driver timed mssqls_rampup 2 mssqls_duration 5 mssqls_allwarehouse false mssqls_timeprofile false mssqls_async_scale false mssqls_async_client 10 mssqls_async_verbose false mssqls_async_delay 1000} tpch {mssqls_scale_fact 1 mssqls_maxdop 2 mssqls_tpch_dbase tpch mssqls_num_tpch_threads 1 mssqls_colstore false mssqls_total_querysets 1 mssqls_raise_query_error false mssqls_verbose false mssqls_refresh_on false mssqls_update_sets 1 mssqls_trickle_refresh 1000 mssqls_refresh_verbose false}
hammerdb>print dict
Dictionary Settings for MSSQLServer
connection {
 mssqls_server         = (local)
 mssqls_linux_server   = localhost
 mssqls_tcp            = false
 mssqls_port           = 1433
 mssqls_azure          = false
 mssqls_authentication = windows
 mssqls_linux_authent  = sql
 mssqls_odbc_driver    = ODBC Driver 17 for SQL Server
 mssqls_linux_odbc     = ODBC Driver 17 for SQL Server
 mssqls_uid            = sa
 mssqls_pass           = admin
}
tpcc       {
 mssqls_count_ware       = 1
 mssqls_num_vu           = 1
 mssqls_dbase            = tpcc
 mssqls_imdb             = false
 mssqls_bucket           = 1
 mssqls_durability       = SCHEMA_AND_DATA
 mssqls_total_iterations = 1000000
 mssqls_raiseerror       = false
 mssqls_keyandthink      = false
 mssqls_checkpoint       = false
 mssqls_driver           = timed
 mssqls_rampup           = 2
 mssqls_duration         = 5
 mssqls_allwarehouse     = false
 mssqls_timeprofile      = false
 mssqls_async_scale      = false
 mssqls_async_client     = 10
 mssqls_async_verbose    = false
 mssqls_async_delay      = 1000
}

hammerdb>

The setting of the driver value in tpcc itself is not affected as the string match works correctly here so it is only the mismatch that needs fixing.

hammerdb>diset tpcc mssqls_driver test
Clearing Script, reload script to activate new setting
Script cleared
Changed tpcc:mssqls_driver from timed to test for MSSQLServer

hammerdb>diset tpcc mssqls_driver timed
Clearing Script, reload script to activate new setting
Script cleared
Changed tpcc:mssqls_driver from test to timed for MSSQLServer

sm-shaw added a commit to sm-shaw/HammerDB that referenced this issue Apr 7, 2020
abondvt89 added a commit that referenced this issue Apr 7, 2020
Fix for Issue #118 using diset with variables with spaces
@sm-shaw sm-shaw linked a pull request Apr 8, 2020 that will close this issue
@sm-shaw sm-shaw closed this as completed Apr 8, 2020
@jcybul
Copy link

jcybul commented Sep 1, 2023

Hello, Im seeing this same error when I use the web service to try and set the driver. I'm on HammerDB version 4.7.
like this:
Invoke-RestMethod -Uri http://localhost:8080/diset -Method Post -Body '"dict" : "connection", "key" :"mssqls_odbc_driver", "value" : "ODBC Driver 17 for SQL Server"' -ContentType application/json

@sm-shaw
Copy link
Contributor

sm-shaw commented Sep 2, 2023

The REST interface was deprecated following the discussion in this issue #420 because of lack of use.
The web service now provides a read-only viewer to jobs showing charts for results, timings, transaction counts etc. #352
Although the current web service was designed to be compatible with the former REST interface if there was ever a need. (i.e. add the commands to the web interface to do diset, vurun etc) there are no current plans to do so.
Therefore, an update to fix this will not be added as this section of code has already been removed.

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 a pull request may close this issue.

3 participants