MDL-31186 fix wrong context preloading sql