~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/auth_schema/tests/t/basic.test

  • Committer: Daniel
  • Date: 2011-10-08 19:47:11 UTC
  • mto: This revision was merged to the branch mainline in revision 2437.
  • Revision ID: daniel@ubuntu-10-20111008194711-dp47vra0qzjm2o8x
Escape user in SQL statement to avoid SQL injection.  Verify auth table name.  Include auth query in error message.  Tweak formatting to match coding standards.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
connect(conn3, localhost, test_user, test_pass,,);
74
74
SELECT 'auth re-enabled';
75
75
 
 
76
# Escape user name; avoid SQL injection.
 
77
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
 
78
--replace_regex /@'.*?'/@'LOCALHOST'/
 
79
--error ER_ACCESS_DENIED_ERROR
 
80
connect(conn4, localhost, "'; drop table auth.users; select '", test_pass,,);
 
81
 
 
82
SHOW TABLES FROM auth;
 
83
 
 
84
# Don't crash if we try to set the auth table to NULL.
 
85
--error ER_WRONG_ARGUMENTS
 
86
SET GLOBAL auth_schema_table=NULL;
 
87
SHOW VARIABLES LIKE 'auth_schema_table';
 
88
 
 
89
# And don't permit a blank string for the auth table.
 
90
--error ER_WRONG_ARGUMENTS
 
91
SET GLOBAL auth_schema_table='';
 
92
SHOW VARIABLES LIKE 'auth_schema_table';
 
93
 
76
94
DROP SCHEMA auth;