The provisions of Chapter 8 (commencing with Section 469) of Title 6 of Part 2 of the Code of Civil Procedure relating to variance and amendment of pleadings in civil actions shall apply to petitions and proceedings under this chapter, to the same extent and with the same effect as if proceedings under this chapter were civil actions.