mysql字符串查询大小写问题
2015-11-01 10:52
603 查看
1、引入问题
在进行研究innodb隐式锁转换显示锁时,看到代码有这么一段:
else if (0 == cmp_dtuple_rec(entry, rec, offsets)) {
/* The delete marks of rec and prev_version should be
equal for rec to be in the state required by
prev_version */
if (rec_del != vers_del) {
break;
}
/* It is possible that the row was updated so that the
secondary index record remained the same in
alphabetical ordering, but the field values changed
still. For example, 'abc' -> 'ABC'. Check also that. */
dtuple_set_types_binary(
entry, dtuple_get_n_fields(entry));
if (0 != cmp_dtuple_rec(entry, rec, offsets)) {
break;
}
不明白为什么要判断2次?
2、为了解决字符串大小写的问题
mysql默认下字符串校验是不区分大小写的:
所以这里需要设置binary后再次进行比对判断
在进行研究innodb隐式锁转换显示锁时,看到代码有这么一段:
else if (0 == cmp_dtuple_rec(entry, rec, offsets)) {
/* The delete marks of rec and prev_version should be
equal for rec to be in the state required by
prev_version */
if (rec_del != vers_del) {
break;
}
/* It is possible that the row was updated so that the
secondary index record remained the same in
alphabetical ordering, but the field values changed
still. For example, 'abc' -> 'ABC'. Check also that. */
dtuple_set_types_binary(
entry, dtuple_get_n_fields(entry));
if (0 != cmp_dtuple_rec(entry, rec, offsets)) {
break;
}
不明白为什么要判断2次?
2、为了解决字符串大小写的问题
mysql默认下字符串校验是不区分大小写的:
所以这里需要设置binary后再次进行比对判断
相关文章推荐
- mysql基础0之配置
- mysql AUTO_INCREMENT
- c# + Maticsoft.DBUtility+ mysql 做winform的遇到的一些问题及处理
- mysql sysbench测试安装及命令
- mysql计算经纬度亮点之间的距离
- mysql load infile和into outfile
- windows下解决mysql密码更改问题
- MySQL CMake 安装说明
- MySQL数据库基本操作
- 浅谈 sqlserver 和 mysql存储过程、函数的区别
- MySQL常用数据类型
- 用SQLyog和NativeSQL将数据从sqlserver导入到mysql
- mysql 从一个表中查数据,插入另一个表
- navicat for mysql转存数据库
- Mysql的安装、启动及使用
- Mysql的发行版本小结
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'
- mysql命令执行过程图学习
- jboss-as-7.1.1.Final配置Jndi数据源(以mysql为例)
- jboss-as-7.1.1.Final配置Jndi数据源(以mysql为例)