Support the following:
select @@version
select @@spid
select @@current_database
select @@username
select @@current_schema
The above should be implemented as system variables, not stored in system catalog tables.
Also, note that we do not want to support system functions such as show database(). Instead, we'll create @@variables for the information that the user needs to query.
|
|
139 KB
1. Where may the @@variables appear? Can we have more complex queries where the @@variables are allowed freely or do we just support the exact "select @@variable" query and nothing else? Obviously the later is simpler.
2. What do you mean by "we'll create @@variables for the information that the user needs to query"? Do you want some API so that you can define such @@variables from ADS or is the variables list a constant list part of the driver?
4. current_schema can't really provide any useful info for MongoDB, returning null.
4. current_schema can't really provide any useful info for MongoDB, returning null.
1. Where may the @@variables appear? Can we have more complex queries where the @@variables are allowed freely or do we just support the exact "select @@variable" query and nothing else? Obviously the later is simpler.
We'll go w/ the latter: just support the exact "select @@variable" query and nothing else
1. Where may the @@variables appear? Can we have more complex queries where the @@variables are allowed freely or do we just support the exact "select @@variable" query and nothing else? Obviously the later is simpler.
We'll go w/ the latter: just support the exact "select @@variable" query and nothing else
2. What do you mean by "we'll create @@variables for the information that the user needs to query"? Do you want some API so that you can define such @@variables from ADS or is the variables list a constant list part of the driver?
Answer: the variables list a constant list that is part of the driver
2. What do you mean by "we'll create @@variables for the information that the user needs to query"? Do you want some API so that you can define such @@variables from ADS or is the variables list a constant list part of the driver?
Answer: the variables list a constant list that is part of the driver
3. Are variable names case sensitive?
No, case insensitive
3. Are variable names case sensitive?
No, case insensitive
I get an error for all the system variables using the 0.9 drop.
select @@version
go
select @@current_database
go
>[Error] Script lines: 1-2 --------------------------
com.aquafold.library.common.parsers.unsql.VariableCmd@37c9e704 not implemented.
[Executed: 1/11/2013 1:46:17 PM] [Execution: 0ms]
>[Error] Script lines: 3-4 --------------------------
com.aquafold.library.common.parsers.unsql.VariableCmd@755e7c23 not implemented.
[Executed: 1/11/2013 1:46:17 PM] [Execution: 0ms]
I get an error for all the system variables using the 0.9 drop.
select @@version
go
select @@current_database
go
>[Error] Script lines: 1-2 --------------------------
com.aquafold.library.common.parsers.unsql.VariableCmd@37c9e704 not implemented.
[Executed: 1/11/2013 1:46:17 PM] [Execution: 0ms]
>[Error] Script lines: 3-4 --------------------------
com.aquafold.library.common.parsers.unsql.VariableCmd@755e7c23 not implemented.
[Executed: 1/11/2013 1:46:17 PM] [Execution: 0ms]
My bad: execute() fails for that command, only executeQuery() works.
My bad: execute() fails for that command, only executeQuery() works.
In server properties if i connect as Normal and supply username/password then execute query select @@spid i get The 'serverStatus' command failed with the following error message: 'unauthorized'.
In server properties if i connect as Normal and supply username/password then execute query select @@spid i get The 'serverStatus' command failed with the following error message: 'unauthorized'.
Yes, only the cluster admin is allowed to run serverStatus which returns the pid.
See http://docs.mongodb.org/manual/reference/user-privileges/#clusterAdmin (source https://github.com/mongodb/mongo/blob/master/src/mongo/db/auth/authorization_manager.cpp#L160 )
Yes, only the cluster admin is allowed to run serverStatus which returns the pid.
See http://docs.mongodb.org/manual/reference/user-privileges/#clusterAdmin (source https://github.com/mongodb/mongo/blob/master/src/mongo/db/auth/authorization_manager.cpp#L160 )
Jonathan, please document that select @@spid will only work if you are an "admin" user. You can use the same wordings as the note for the SHOW STATUS command mentioned in issue #8961.
Jonathan, please document that select @@spid will only work if you are an "admin" user. You can use the same wordings as the note for the SHOW STATUS command mentioned in issue #8961.
I've added these select@@ to the documentation here
let me know if I need to modify them in any way.
I've added these select@@ to the documentation here
let me know if I need to modify them in any way.
Issue #8128 |
| Closed |
| Fixed |
| Resolved |
Completion |
| No due date |
| Fixed Build 14.0.0-beta-20 |
| No time estimate |
1. Where may the @@variables appear? Can we have more complex queries where the @@variables are allowed freely or do we just support the exact "select @@variable" query and nothing else? Obviously the later is simpler.
2. What do you mean by "we'll create @@variables for the information that the user needs to query"? Do you want some API so that you can define such @@variables from ADS or is the variables list a constant list part of the driver?