Support for OR operation

Ported from mysql module