If a parent wants to stop a child doing stupid or dengerous things by hit the child's buttock, what's name for this behaviour? hit a child?

I heard this is illegal in Canada, is this true even if the parent does not hurt the child and just want to make the child feel the pain and stop doing bad things.
Spanking or paddling is what my mom did to me when I was bad....
Haha, spanking, I guess it is.