~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

Big merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
#include <drizzled/function/get_system_var.h>
89
89
#include <mysys/thr_lock.h>
90
90
#include <drizzled/message/table.pb.h>
 
91
#include <drizzled/message/schema.pb.h>
91
92
#include <drizzled/statement.h>
92
93
#include <drizzled/statement/alter_schema.h>
93
94
#include <drizzled/statement/alter_table.h>
129
130
#include <drizzled/statement/truncate.h>
130
131
#include <drizzled/statement/unlock_tables.h>
131
132
#include <drizzled/statement/update.h>
 
133
#include <drizzled/db.h>
132
134
 
133
135
using namespace drizzled;
134
136
 
1366
1368
          {
1367
1369
            statement::CreateSchema *statement= (statement::CreateSchema *)Lex->statement;
1368
1370
 
1369
 
            statement->create_info.default_table_charset= $4;
1370
 
            statement->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
 
1371
            message::Schema &schema_message= statement->schema_message;
 
1372
            schema_message.set_collation($4->name);
1371
1373
          }
1372
1374
        ;
1373
1375
 
2416
2418
            {
2417
2419
              DRIZZLE_YYABORT;
2418
2420
            }
2419
 
            if (check_table_name($3->table.str,$3->table.length) || ($3->db.str && check_db_name(&$3->db)))
 
2421
 
 
2422
            if (check_table_name($3->table.str,$3->table.length))
2420
2423
            {
2421
2424
              my_error(ER_WRONG_TABLE_NAME, MYF(0), $3->table.str);
2422
2425
              DRIZZLE_YYABORT;
2423
2426
            }
 
2427
 
 
2428
            if ($3->db.str)
 
2429
            {
 
2430
              std::string database_name($3->db.str);
 
2431
              NonNormalisedDatabaseName non_normalised_database_name(database_name);
 
2432
              NormalisedDatabaseName normalised_database_name(non_normalised_database_name);
 
2433
              if (! normalised_database_name.isValid())
 
2434
              {
 
2435
                my_error(ER_WRONG_TABLE_NAME, MYF(0), $3->table.str);
 
2436
                DRIZZLE_YYABORT;
 
2437
              }
 
2438
            }
2424
2439
            lex->name= $3->table;
2425
2440
            statement->alter_info.flags.set(ALTER_RENAME);
2426
2441
          }