Fix bug in default sql