generators::legacy0::generate(): SQL bug fix.