Skip to content

Commit 5de8e2d

Browse files
ParadoxV5vuvova
authored andcommitted
Update errmsg-utf8.txt re my_snprintf suffixes
* Migrate `sql/share/errmsg-utf8.txt` to use suffix-based, `-Wformat` -compatible `my_snprintf` format extensions introduced in MDEV-21978 * Update relevant tests caught by BuildBot as well While GCC `-Wformat` (with `ATTRIBUTE_FORMAT`) can catch obsolete or malformed format string literals, formats originating from other sources (such as this translations file) (still) require manual review. This commit also escapes the only (1) instance of existing strings conflicted by the introduction of suffixes: (Not all `printf`s goes to `my_snprintf`, thus I `grep`ped and confirmed that this does indeed land on `my_snprintf` eventually.) chi "不能%sSLAVE'%.*s'" This commit also fixes the following: (You’re welcome.) * Delete extraneous spaces after the `%` (they’re all Swahili) * Update `extra/comp_err.c` * Add the missing standard C/C++ specifiers `c`, `i`, `o`, `p` and `X` (Especially `%i`: it otherwise was complaining about the new `%iE`) * Removed the old and obsolete extension formats `%b`, `%M` and `%T`
1 parent 202c2fb commit 5de8e2d

File tree

7 files changed

+1318
-1315
lines changed

7 files changed

+1318
-1315
lines changed

extra/comp_err.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -774,12 +774,15 @@ static ha_checksum checksum_format_specifier(const char* msg)
774774
{
775775
chksum= my_checksum(chksum, p, 1);
776776
switch(*p) {
777+
case 'c':
777778
case 'd':
779+
case 'i':
780+
case 'o':
781+
case 'p':
778782
case 'u':
779783
case 'x':
784+
case 'X':
780785
case 's':
781-
case 'M':
782-
case 'T':
783786
start= 0; /* Not in format specifier anymore */
784787
break;
785788
}

mysql-test/main/perror-win.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ MariaDB error code 150: Foreign key constraint is incorrectly formed
22
Win32 error code 150: System trace information was not specified in your CONFIG.SYS file, or tracing is disallowed.
33
OS error code 23: Too many open files in system
44
Win32 error code 23: Data error (cyclic redundancy check).
5-
MariaDB error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192T' for key %d
5+
MariaDB error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192sT' for key %d
66
Learn more: https://mariadb.com/kb/en/e1062/
77
Win32 error code 1062: The service has not been started.
88
Illegal error code: 30000

mysql-test/main/perror.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Illegal error code: 10000
2-
MariaDB error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192T' for key %d
2+
MariaDB error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192sT' for key %d
33
Learn more: https://mariadb.com/kb/en/e1062/
44
MariaDB error code 1408 (ER_STARTUP): %s: ready for connections.
55
Version: '%s' socket: '%s' port: %d %s
66
Learn more: https://mariadb.com/kb/en/e1408/
7-
MariaDB error code 1459 (ER_TABLE_NEEDS_UPGRADE): Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!
7+
MariaDB error code 1459 (ER_TABLE_NEEDS_UPGRADE): Upgrade required. Please do "REPAIR %s %sQ" or dump/reload to fix it!
88
Learn more: https://mariadb.com/kb/en/e1459/
99
MariaDB error code 1461 (ER_MAX_PREPARED_STMT_COUNT_REACHED): Can't create more than max_prepared_stmt_count statements (current value: %u)
1010
Learn more: https://mariadb.com/kb/en/e1461/

mysql-test/suite/compat/oracle/r/exception.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ RAISE dup_val_on_index;
106106
END;
107107
$$
108108
CALL p1();
109-
ERROR 23000: Duplicate entry '%-.192T' for key %d
109+
ERROR 23000: Duplicate entry '%-.192sT' for key %d
110110
DROP PROCEDURE p1;
111111
CREATE PROCEDURE p1
112112
AS

mysql-test/suite/rpl/r/rpl_stm_EE_err2.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ drop table t1;
1111
connection slave;
1212
include/wait_for_slave_sql_to_stop.inc
1313
call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.* error code=1062.*Error on slave:.* error.* 0");
14-
Error: "Query caused different errors on master and slave. Error on master: message (format)='Duplicate entry '%-.192T' for key %d' error code=1062 ; Error on slave: actual message='no error', error code=0. Default database: 'test'. Query: 'insert into t1 values(1),(2)'" (expected different error codes on master and slave)
14+
Error: "Query caused different errors on master and slave. Error on master: message (format)='Duplicate entry '%-.192sT' for key %d' error code=1062 ; Error on slave: actual message='no error', error code=0. Default database: 'test'. Query: 'insert into t1 values(1),(2)'" (expected different error codes on master and slave)
1515
Errno: "0" (expected 0)
1616
drop table t1;
1717
include/stop_slave.inc

sql/share/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ You will notice as part of your translation work, you will have to add your lang
1818
sw "isamchk"
1919
sw "LA"
2020
sw "NDIYO"
21-
sw "Haiwezi kuunda faili '% -.200s' (kosa: %M)"
22-
sw "Haiwezi kuunda jedwali %`s.%`s (kosa: %M)"
23-
sw "Haiwezi kuunda hifadhidata '% -.192s' (kosa: %M)"
21+
sw "Haiwezi kuunda faili '% -.200s' (kosa: %iE)"
22+
sw "Haiwezi kuunda jedwali %`s.%`s (kosa: %iE)"
23+
sw "Haiwezi kuunda hifadhidata '% -.192s' (kosa: %iE)"
2424
sw "Haiwezi kuunda hifadhidata '% -.192s'; hifadhidata ipo"
2525

2626
Note that Google translate removes the leading whitespace in the translation file it generates. DO NOT add that leading whitespace back!

0 commit comments

Comments
 (0)