以下mysql查询结果返回'TRUE'
,
select if('testString' in ( 0 ), 'TRUE', 'FALSE') from sampleTable
有人可以解释为什么吗?
答案 0 :(得分:1)
您可以尝试使用
TransformationProcessProvider providerMock = mock(TransformationProcessProvider.class);
TransformationProcess transMock = mock(TransformationProcess.class);
when(providerMock.getTransformationProcess()).thenReturn(transMock);
when(transMock.checkTransformationRule(Mockito.any(), eq(dummyDataMap), eq(mockStatement))).thenReturn(validationDataMap);
Validator validatorUnderTest = new Validator(providerMock);
这样做是因为“ testString”的类型转换为UN SIGN = 0
然后
select cast('testString' AS UNSIGNED) from dual ; // return 0
匹配强制转换值(0)中的0并返回TRUE