-
Notifications
You must be signed in to change notification settings - Fork 24
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
Result #1013
Closed
Closed
Result #1013
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
...atrixOne/Reference/Variable/system-variables/keep_user_target_list_in_result.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# keep_user_target_list_in_result 保持查询结果集列名与用户指定大小写一致 | ||
|
||
在 MatrixOne 查询中,保持结果集列名与用户指定的名称大小一致,除了可以通过使用别名(alias)来实现,还可以通过设置参数来实现。 | ||
|
||
`keep_user_target_list_in_result` 是 MatrixOne 设置查询结果集列名与用户指定的名称大小写是否一致的一个参数。 | ||
|
||
## 配置 | ||
|
||
在命令行执行以下语句: | ||
|
||
```sql | ||
set global keep_user_target_list_in_result = 1;// 默认为 0,重新连接数据库生效 | ||
``` | ||
|
||
## 示例 | ||
|
||
```sql | ||
create table t1(aa int, bb int, cc int, AbC varchar(25), A_BC_d double); | ||
insert into t1 values (1,2,3,'A',10.9); | ||
|
||
mysql> select * from t1; | ||
+------+------+------+------+--------+ | ||
| aa | bb | cc | abc | a_bc_d | | ||
+------+------+------+------+--------+ | ||
| 1 | 2 | 3 | A | 10.9 | | ||
+------+------+------+------+--------+ | ||
1 row in set (0.00 sec) | ||
|
||
mysql> select @@keep_user_target_list_in_result;--查询参数值,默认关闭 | ||
+-----------------------------------+ | ||
| @@keep_user_target_list_in_result | | ||
+-----------------------------------+ | ||
| 0 | | ||
+-----------------------------------+ | ||
1 row in set (0.01 sec) | ||
|
||
mysql> select aA, bB, CC, abc, a_Bc_D from t1;--在设置关闭情况下,查询结果集列名与用户指定的名称大小写不一致 | ||
+------+------+------+------+--------+ | ||
| aa | bb | cc | abc | a_bc_d | | ||
+------+------+------+------+--------+ | ||
| 1 | 2 | 3 | A | 10.9 | | ||
+------+------+------+------+--------+ | ||
1 row in set (0.00 sec) | ||
|
||
mysql> set global keep_user_target_list_in_result =1;--开启查询结果集列名与用户指定的名称大小一致设置 | ||
Query OK, 0 rows affected (0.01 sec) | ||
|
||
mysql> exit;--退出数据库重新连接后参数生效 | ||
|
||
mysql> select @@keep_user_target_list_in_result;--查询参数值,开启成功 | ||
+-----------------------------------+ | ||
| @@keep_user_target_list_in_result | | ||
+-----------------------------------+ | ||
| 1 | | ||
+-----------------------------------+ | ||
1 row in set (0.00 sec) | ||
|
||
mysql> select aA, bB, CC, abc, a_Bc_D from t1;--在设置开启情况下,查询结果集列名与用户指定的名称大小写一致 | ||
+------+------+------+------+--------+ | ||
| aA | bB | CC | abc | a_Bc_D | | ||
+------+------+------+------+--------+ | ||
| 1 | 2 | 3 | A | 10.9 | | ||
+------+------+------+------+--------+ | ||
1 row in set (0.00 sec) | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
现在默认应该是1,需要确认下