home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 May (DVD) / Macworld Resource DVD May 2003.toast / Data / Software / Bonus / Database / mysql-max-3.23.55.sit / mysql-max-3.23.55-apple-darwi.1 / mysql-test / t / func_equal.test < prev    next >
Encoding:
Text File  |  2003-01-21  |  641 b   |  30 lines  |  [TEXT/ttxt]

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