File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 9
9
username: LOCALUSERNAME
10
10
password:
11
11
database: mysql2_test
12
+
13
+ numericuser:
14
+ host: localhost
15
+ username: LOCALUSERNAME
16
+ password:
17
+ database: 12345
Original file line number Diff line number Diff line change @@ -104,6 +104,16 @@ def connect *args
104
104
ssl_client . close
105
105
end
106
106
107
+ it "should be able to connect to database with numeric-only name" do
108
+ lambda {
109
+ creds = DatabaseCredentials [ 'numericuser' ]
110
+ @client . query "CREATE DATABASE IF NOT EXISTS `#{ creds [ 'database' ] } `"
111
+ @client . query "GRANT ALL ON `#{ creds [ 'database' ] } `.* TO #{ creds [ 'username' ] } @`#{ creds [ 'host' ] } `"
112
+ client = Mysql2 ::Client . new creds
113
+ @client . query "DROP DATABASE IF EXISTS `#{ creds [ 'database' ] } `"
114
+ } . should_not raise_error
115
+ end
116
+
107
117
it "should respond to #close" do
108
118
@client . should respond_to ( :close )
109
119
end
You can’t perform that action at this time.
0 commit comments