Questions About the IF Function

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 关于if函数的疑问

| username: Jolyne

[TiDB Usage Environment] Production Environment / Testing / Poc
[TiDB Version]
[Reproduction Path] What operations were performed when the problem occurred
In the ASCII table, the code value of uppercase letters is less than that of lowercase letters, but why is the result the same when the if function is written like this?
[Encountered Problem: Problem Phenomenon and Impact]
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]

| username: DBAER | Original post link

Parameter: lower_case_table_names

| username: Jolyne | Original post link

Understood, comparison is case-insensitive. I saw in the video that the teacher mentioned the code value of lowercase letters is greater than that of uppercase letters. Indeed, the query results are equal.

| username: 友利奈绪 | Original post link

Useful, thanks for sharing.

| username: TiDBer_LM | Original post link

Thanks for sharing! Marked!

| username: stephanie | Original post link

I feel this is related to the database’s character set settings.
Character Set and Collation | PingCAP Documentation Center

| username: TiDBer_QYr0vohO | Original post link

Thank you! Mark

| username: dba远航 | Original post link

This is caused by ignoring case sensitivity, lower_case_table_names.

| username: xiaoqiao | Original post link

Case insensitive now.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.