forked from France-ioi/bebras-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.scratchpad
84 lines (61 loc) · 2.41 KB
/
.scratchpad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
####################################3
Running the sample database resulted to the following:
mysql> sampleDatabase/database_content.sql
-> ;
;
^C
mysql> source sampleDatabase/database_content.sql;
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
ERROR 1264 (22003): Out of range value for column 'iVersion' at row 1
ERROR 1264 (22003): Out of range value for column 'iVersion' at row 1
Query OK, 14 rows affected (0.00 sec)
Records: 14 Duplicates: 0 Warnings: 0
ERROR 1264 (22003): Out of range value for column 'iVersion' at row 1
ERROR 1264 (22003): Out of range value for column 'iVersion' at row 1
Query OK, 1 row affected (0.01 sec)
ERROR 1264 (22003): Out of range value for column 'iVersion' at row 1
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO `algorea_registration` (`ID`, `firstName`, `lastName`, `genre`, `ema' at line 5
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COMMIT' at line 3
Todo: find out what the hell is happening and fix it.
##########
fix the rtl of the contest interface for Farsi language.
###
DELIMITER //
CREATE PROCEDURE UpdateColumn5()
BEGIN
DECLARE done INT DEFAULT 0;
DECLARE tableName CHAR(64);
DECLARE cur CURSOR FOR
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'beaver_contest'
AND table_type = 'BASE TABLE'; -- Only include base tables
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
OPEN cur;
read_loop: LOOP
FETCH cur INTO tableName;
IF done THEN
LEAVE read_loop;
END IF;
IF EXISTS (SELECT *
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = 'beaver_contest'
AND TABLE_NAME = tableName
AND COLUMN_NAME = 'iVersion') THEN
SET @s = CONCAT('ALTER TABLE `', tableName, '` MODIFY iVersion BIGINT;'); -- Changed INT(32) to BIGINT
PREPARE stmt FROM @s;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
END IF;
END LOOP;
CLOSE cur;
END//
DELIMITER ;
###