mysql custom linkage sample