func_equal.test
Upload User: tsgydb
Upload Date: 2007-04-14
Package Size: 10674k
Code Size: 1k
Category:

MySQL

Development Platform:

Visual C++

  1. #
  2. # Testing of the <=> operator
  3. #
  4. #
  5. # First some simple tests
  6. #
  7. select 0<=>0,0.0<=>0.0,"A"<=>"A",NULL<=>NULL;
  8. select 1<=>0,0<=>NULL,NULL<=>0;
  9. select 1.0<=>0.0,0.0<=>NULL,NULL<=>0.0;
  10. select "A"<=>"B","A"<=>NULL,NULL<=>"A";
  11. #
  12. # Test with tables
  13. #
  14. drop table if exists t1,t2;
  15. create table t1 (id int, value int);
  16. create table t2 (id int, value int);
  17. insert into t1 values (1,null);
  18. insert into t2 values (1,null);
  19. select t1.*, t2.*, t1.value<=>t2.value from t1, t2 where t1.id=t2.id and t1.id=1;
  20. select * from t1 where id <=>id;
  21. select * from t1 where value <=> value;
  22. select * from t1 where id <=> value or value<=>id;
  23. drop table t1,t2;